buildtools: fix --git-local-changes option
authorStefan Metzmacher <metze@samba.org>
Thu, 2 Dec 2010 00:58:10 +0000 (01:58 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 2 Dec 2010 08:09:21 +0000 (09:09 +0100)
If we set the GIT_DIR envvar we also need to set GIT_WORK_TREE,
otherwise we can't expect valid output from 'git diff HEAD'.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Dec  2 09:09:21 CET 2010 on sn-devel-104

buildtools/wafsamba/samba_version.py

index df715840cbfdf8878618b1935645348871ba65e2..076615b6c46a5c2522d5637b9725036d13e3e307 100644 (file)
@@ -50,6 +50,7 @@ def git_version_summary(path, env=None):
         return ("GIT-UNKNOWN", {})
 
     os.putenv('GIT_DIR', '%s/.git' % path)
+    os.putenv('GIT_WORK_TREE', path)
     git = Utils.cmd_output(env.GIT + ' show --pretty=format:"%h%n%ct%n%H%n%cd" --stat HEAD', silent=True)
 
     lines = git.splitlines()