diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-06-06 03:55:28 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-06-06 03:55:28 +0200 |
commit | 8da44047050c16b563575cf973c1f33b6149f1cc (patch) | |
tree | e714d8e1ef4313156cb8d996092abca8d4e1f5de /src/path.c | |
parent | babdc376c7a0ed698ada5f0512789bd99a8b2c4a (diff) | |
download | libgit2-8da44047050c16b563575cf973c1f33b6149f1cc.tar.gz |
path: error out if the callback returns an errorcmn/foreach-cancel-loose
When the callback returns an error, we should stop immediately. This
broke when trying to make sure we pass specific errors up the chain.
This broke cancelling out of the loose backend's foreach.
Diffstat (limited to 'src/path.c')
-rw-r--r-- | src/path.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/path.c b/src/path.c index 81b4d51df..8f861e68e 100644 --- a/src/path.c +++ b/src/path.c @@ -1066,8 +1066,10 @@ int git_path_direach( git_buf_truncate(path, wd_len); /* restore path */ /* Only set our own error if the callback did not set one already */ - if (error != 0 && !giterr_last()) { - giterr_set_after_callback(error); + if (error != 0) { + if (!giterr_last()) + giterr_set_after_callback(error); + break; } } |