diff options
author | Russell Belfer <rb@github.com> | 2013-12-09 09:44:03 -0800 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-12-11 10:57:50 -0800 |
commit | 26c1cb91beccb44425864bd233ed0e35f5801868 (patch) | |
tree | 378f665d0adebca36a14a590f2103f2e5cd6c9ac /src/index.c | |
parent | f10d7a368fa4af28b1e6f082349ffa4f62b3c00e (diff) | |
download | libgit2-26c1cb91beccb44425864bd233ed0e35f5801868.tar.gz |
One more rename/cleanup for callback err functions
Diffstat (limited to 'src/index.c')
-rw-r--r-- | src/index.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/index.c b/src/index.c index 671bdfa79..bb81f666e 100644 --- a/src/index.c +++ b/src/index.c @@ -2117,7 +2117,7 @@ int git_index_add_all( if (error > 0) /* return > 0 means skip this one */ continue; if (error < 0) { /* return < 0 means abort */ - GITERR_CALLBACK(error); + giterr_set_after_callback(error); break; } } @@ -2204,10 +2204,8 @@ static int index_apply_to_all( error = 0; continue; } - if (error < 0) { /* return < 0 means abort */ - giterr_set_callback(error, "git_index_matched_path"); + if (error < 0) /* return < 0 means abort */ break; - } } /* index manipulation may alter entry, so don't depend on it */ @@ -2252,8 +2250,13 @@ int git_index_remove_all( git_index_matched_path_cb cb, void *payload) { - return index_apply_to_all( + int error = index_apply_to_all( index, INDEX_ACTION_REMOVE, pathspec, cb, payload); + + if (error) /* make sure error is set if callback stopped iteration */ + giterr_set_after_callback(error); + + return error; } int git_index_update_all( @@ -2262,6 +2265,11 @@ int git_index_update_all( git_index_matched_path_cb cb, void *payload) { - return index_apply_to_all( + int error = index_apply_to_all( index, INDEX_ACTION_UPDATE, pathspec, cb, payload); + + if (error) /* make sure error is set if callback stopped iteration */ + giterr_set_after_callback(error); + + return error; } |