mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 23:42:37 +03:00
common.get_head_commit_id() to get string commit ID from HEAD
This commit is contained in:
parent
fafaa8f81f
commit
5459a461db
2 changed files with 9 additions and 4 deletions
|
@ -670,6 +670,14 @@ def get_build_dir(app):
|
|||
return os.path.join('build', app.id)
|
||||
|
||||
|
||||
def get_head_commit_id(git_repo):
|
||||
"""Get git commit ID for HEAD as a str
|
||||
|
||||
repo.head.commit.binsha is a bytearray stored in a str
|
||||
"""
|
||||
return hexlify(bytearray(git_repo.head.commit.binsha)).decode()
|
||||
|
||||
|
||||
def setup_vcs(app):
|
||||
'''checkout code from VCS and return instance of vcs and the build dir'''
|
||||
build_dir = get_build_dir(app)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue