mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
Account for the working dir below the root in git invocation
Signed-off-by: Daniil Baturin <daniil@vyos.io>
This commit is contained in:
parent
a896176ad8
commit
7fa66c77f1
@ -331,7 +331,7 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
# Initialize Git object from our repository
|
# Initialize Git object from our repository
|
||||||
try:
|
try:
|
||||||
repo = git.Repo('.')
|
repo = git.Repo('.', search_parent_directories=True)
|
||||||
|
|
||||||
# Retrieve the Git commit ID of the repository, 14 charaters will be sufficient
|
# Retrieve the Git commit ID of the repository, 14 charaters will be sufficient
|
||||||
build_git = repo.head.object.hexsha[:14]
|
build_git = repo.head.object.hexsha[:14]
|
||||||
@ -346,7 +346,7 @@ if __name__ == "__main__":
|
|||||||
if git_branch is None:
|
if git_branch is None:
|
||||||
git_branch = repo.active_branch.name
|
git_branch = repo.active_branch.name
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
exit(f'Could not retrieve information from git: {e}')
|
exit(f'Could not retrieve information from git: {repr(e)}')
|
||||||
build_git = ""
|
build_git = ""
|
||||||
git_branch = ""
|
git_branch = ""
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user