BF: replace show-ref with rev-parse --verify for determining current commit
authorYaroslav Halchenko <debian@onerussian.com>
Thu, 20 Dec 2012 19:34:56 +0000 (14:34 -0500)
committerYaroslav Halchenko <debian@onerussian.com>
Thu, 20 Dec 2012 19:34:56 +0000 (14:34 -0500)
git show-ref -s HEAD  has shown to not work in all scenarios
and git rev-parse --help provides this as an ultimate example:

         ยท   Print the object name of the current commit:

               $ git rev-parse --verify HEAD

setup.py

index 7b605dd..5bce5d9 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@ class sdist(sdist_orig):
         self.force_manifest = 1
         if (sys.platform != "win32" and 
             os.path.isdir('.git')):
-            assert os.system("git show-ref -s HEAD > .gitrev") == 0
+            assert os.system("git rev-parse --verify HEAD > .gitrev") == 0
         sdist_orig.run(self)
 add_command_class('sdist', sdist)