|
|
|
|
@ -46,11 +46,15 @@ def pkg_commit_hash(pkg_path):
|
|
|
|
|
while cur_path != par_path:
|
|
|
|
|
cur_path = par_path
|
|
|
|
|
if p.exists(p.join(cur_path, '.git')):
|
|
|
|
|
proc = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'],
|
|
|
|
|
stdout=subprocess.PIPE,
|
|
|
|
|
stderr=subprocess.PIPE,
|
|
|
|
|
cwd=pkg_path)
|
|
|
|
|
repo_commit, _ = proc.communicate()
|
|
|
|
|
try:
|
|
|
|
|
proc = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'],
|
|
|
|
|
stdout=subprocess.PIPE,
|
|
|
|
|
stderr=subprocess.PIPE,
|
|
|
|
|
cwd=pkg_path)
|
|
|
|
|
repo_commit, _ = proc.communicate()
|
|
|
|
|
except OSError:
|
|
|
|
|
repo_commit = None
|
|
|
|
|
|
|
|
|
|
if repo_commit:
|
|
|
|
|
return 'repository', repo_commit.strip().decode('ascii')
|
|
|
|
|
else:
|
|
|
|
|
|