# HG changeset patch
# User Yaroslav Halchenko <debian@onerussian.com>
# Date 1356032096 18000
#      Thu Dec 20 14:34:56 2012 -0500
# Node ID c4b37a06bf9bdaace58db4b1d4606fb4db59f9be
# Parent  140a8b8f25b7513ae4f44af4aca5ac01b93daab6
BF: replace show-ref with rev-parse --verify for determining current commit

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

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@
         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)