summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-12-10 14:38:35 -0800
committerRussell Belfer <rb@github.com>2013-12-11 10:57:50 -0800
commitcbd048969e2d53790472118bf2d337cd1d90ca94 (patch)
treea2f186fa4963a019c0bfdd0803606d61f3db1602 /src
parent19853bdd97e006b6e4519bc352c3e8fd7586e9c3 (diff)
downloadlibgit2-cbd048969e2d53790472118bf2d337cd1d90ca94.tar.gz
Fix checkout notify callback docs and tests
The checkout notify callback behavior on non-zero return values was not being tested. This adds tests, fixes a bug with positive values, and clarifies the documentation to make it clear that the checkout can be canceled via this mechanism.
Diffstat (limited to 'src')
-rw-r--r--src/checkout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/checkout.c b/src/checkout.c
index a292e3d4c..f7dd052c7 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -993,7 +993,7 @@ static int checkout_get_actions(
git_vector_foreach(deltas, i, delta) {
error = checkout_action(&act, data, delta, workdir, &wditem, &pathspec);
- if (error)
+ if (error != 0)
goto fail;
actions[i] = act;
@@ -1957,7 +1957,7 @@ int git_checkout_iterator(
* actions to be taken, plus look for conflicts and send notifications,
* then loop through conflicts.
*/
- if ((error = checkout_get_actions(&actions, &counts, &data, workdir)) < 0)
+ if ((error = checkout_get_actions(&actions, &counts, &data, workdir)) != 0)
goto cleanup;
data.total_steps = counts[CHECKOUT_ACTION__REMOVE] +