From: Stefano Rivera <stefanor@debian.org>
Date: Tue, 24 Aug 2021 14:03:04 -0700
Subject: Calculate the version from the script, not the entry_point

Forwarded: https://github.com/newren/git-filter-repo/pull/277
---
 git-filter-repo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-filter-repo b/git-filter-repo
index b91bd96..6248db7 100755
--- a/git-filter-repo
+++ b/git-filter-repo
@@ -1597,7 +1597,7 @@ class GitUtils(object):
 
   @staticmethod
   def print_my_version():
-    with open(sys.argv[0], 'br') as f:
+    with open(__file__, 'br') as f:
       contents = f.read()
     # If people replaced @@LOCALEDIR@@ string to point at their local
     # directory, undo it so we can get original source version.
