diff options
author | John Estabrook <jestabro@vyos.io> | 2024-04-10 10:26:24 -0500 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-05-05 15:09:56 +0200 |
commit | 7c88ff5800d63b40187e1368e08c95b8d53a74a4 (patch) | |
tree | 8d0a8677c8d27078a8591930c39973d2154a223b | |
parent | 249a595f1d76e955465dafc1a757483cb75705d5 (diff) | |
download | vyos-build-7c88ff5800d63b40187e1368e08c95b8d53a74a4.tar.gz vyos-build-7c88ff5800d63b40187e1368e08c95b8d53a74a4.zip |
Account for the working dir below the root in git invocation
Signed-off-by: Daniil Baturin <daniil@vyos.io>
(cherry picked from commit 7fa66c77f19694e2cfd275785344f53518b7fb2f)
-rwxr-xr-x | scripts/image-build/build-vyos-image | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/image-build/build-vyos-image b/scripts/image-build/build-vyos-image index aa397843..229bc2bc 100755 --- a/scripts/image-build/build-vyos-image +++ b/scripts/image-build/build-vyos-image @@ -331,7 +331,7 @@ if __name__ == "__main__": # Initialize Git object from our repository try: - repo = git.Repo('.') + repo = git.Repo('.', search_parent_directories=True) # Retrieve the Git commit ID of the repository, 14 charaters will be sufficient build_git = repo.head.object.hexsha[:14] @@ -346,7 +346,7 @@ if __name__ == "__main__": if git_branch is None: git_branch = repo.active_branch.name 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 = "" git_branch = "" |