Explorar el Código

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 hace 13 años
padre
commit
8b475ea3e6
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3
    1
      gitstats

+ 3
- 1
gitstats Ver fichero

@@ -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():