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)
|
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):
|
def setup_vcs(app):
|
||||||
'''checkout code from VCS and return instance of vcs and the build dir'''
|
'''checkout code from VCS and return instance of vcs and the build dir'''
|
||||||
build_dir = get_build_dir(app)
|
build_dir = get_build_dir(app)
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import binascii
|
|
||||||
import git
|
import git
|
||||||
import glob
|
import glob
|
||||||
import json
|
import json
|
||||||
|
@ -266,9 +265,7 @@ def main():
|
||||||
raise FDroidException("Specify project url.")
|
raise FDroidException("Specify project url.")
|
||||||
|
|
||||||
app.UpdateCheckMode = 'Tags'
|
app.UpdateCheckMode = 'Tags'
|
||||||
|
build.commit = common.get_head_commit_id(git_repo)
|
||||||
# repo.head.commit.binsha is a bytearray stored in a str
|
|
||||||
build.commit = binascii.hexlify(bytearray(git_repo.head.commit.binsha)).decode()
|
|
||||||
|
|
||||||
# Extract some information...
|
# Extract some information...
|
||||||
paths = get_all_gradle_and_manifests(tmp_importer_dir)
|
paths = get_all_gradle_and_manifests(tmp_importer_dir)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue