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
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)