mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-08-15 10:50:09 +02:00
common.get_head_commit_id() to get string commit ID from HEAD
This commit is contained in:
parent
fafaa8f81f
commit
5459a461db
@ -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)
|
||||
|
@ -17,7 +17,6 @@
|
||||
# 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/>.
|
||||
|
||||
import binascii
|
||||
import git
|
||||
import glob
|
||||
import json
|
||||
@ -266,9 +265,7 @@ def main():
|
||||
raise FDroidException("Specify project url.")
|
||||
|
||||
app.UpdateCheckMode = 'Tags'
|
||||
|
||||
# repo.head.commit.binsha is a bytearray stored in a str
|
||||
build.commit = binascii.hexlify(bytearray(git_repo.head.commit.binsha)).decode()
|
||||
build.commit = common.get_head_commit_id(git_repo)
|
||||
|
||||
# Extract some information...
|
||||
paths = get_all_gradle_and_manifests(tmp_importer_dir)
|
||||
|
Loading…
Reference in New Issue
Block a user