mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-24 21:44:35 +00:00
tree: break out on write error
If write_tree() returs an error, we used to set the error message and continued looping. Exit the loop so we return the error.
This commit is contained in:
parent
f01fa26690
commit
82ccb87ef6
@ -363,6 +363,7 @@ static int write_tree(
|
||||
written = write_tree(&sub_oid, repo, index, subdir, i);
|
||||
if (written < 0) {
|
||||
error = git__rethrow(written, "Failed to write subtree %s", subdir);
|
||||
goto cleanup;
|
||||
} else {
|
||||
i = written - 1; /* -1 because of the loop increment */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user