diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2025-01-24 13:15:01 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2025-01-29 16:05:35 +0100 |
commit | 4bf2140589c9ffedc46b9e36366afc16a6de43ed (patch) | |
tree | 37a1fa82d61711f9e3cc3914175c1fb6ef7ceb05 /bin/just-lock.py | |
parent | c03b4097c7fadd4366db816732bd69f7ee2433fe (diff) | |
download | justbuild-4bf2140589c9ffedc46b9e36366afc16a6de43ed.tar.gz |
just-lock: Improve error handling for importing to Git
Diffstat (limited to 'bin/just-lock.py')
-rwxr-xr-x | bin/just-lock.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/just-lock.py b/bin/just-lock.py index a3650d0a..0d21bd26 100755 --- a/bin/just-lock.py +++ b/bin/just-lock.py @@ -416,7 +416,11 @@ def import_to_git(target: str, *, repo_type: str, content_id: str, fail_context=fail_context) # Get tree id of added directory - tree_id: str = get_tree_raw_id(target, repo_tmp_dir).hex() + try: + tree_id: str = get_tree_raw_id(target, repo_tmp_dir).hex() + except Exception as ex: + fail(fail_context + + "Writing tree to temporary repository failed with:\n%r" % (ex, )) # Commit the tree git_env = {**os.environ, **GIT_NOBODY_ENV} |