Quellcode durchsuchen

Fix incorrect gitstats version.

If the VERSION variable was not filled in, gitstats would run
'git rev-parse' on the repository being examined instead of the
gitstats repository.

Signed-off-by: Sven van Haastregt <svhaastr@liacs.nl>
Sven van Haastregt vor 13 Jahren
Ursprung
Commit
8b475ea3e6
1 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  1. 3
    1
      gitstats

+ 3
- 1
gitstats Datei anzeigen

@@ -92,7 +92,9 @@ VERSION = 0
92 92
 def getversion():
93 93
 	global VERSION
94 94
 	if VERSION == 0:
95
-		VERSION = getpipeoutput(["git rev-parse --short %s" % getcommitrange('HEAD')]).split('\n')[0]
95
+		gitstats_repo = os.path.dirname(os.path.abspath(__file__))
96
+		VERSION = getpipeoutput(["git --git-dir=%s/.git --work-tree=%s rev-parse --short %s" %
97
+			(gitstats_repo, gitstats_repo, getcommitrange('HEAD').split('\n')[0])])
96 98
 	return VERSION
97 99
 
98 100
 def getgitversion():