Skip to content

Commit 15860aa

Browse files
committed
remote: do store the update_tips callback error value
We use `git_error_set_after_callback_function` to determine whether `update_tips` returned an error but do not store its return value making us think it always returns 0. Fix it by adding the common patter of storing it inside the `if` when calling it.
1 parent 83f2a20 commit 15860aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,7 @@ static int update_one_tip(
18521852
}
18531853

18541854
if (callbacks && callbacks->update_tips != NULL &&
1855-
callbacks->update_tips(refname.ptr, &old, &head->oid, callbacks->payload) < 0)
1855+
(error = callbacks->update_tips(refname.ptr, &old, &head->oid, callbacks->payload)) < 0)
18561856
git_error_set_after_callback_function(error, "git_remote_fetch");
18571857

18581858
done:

0 commit comments

Comments
 (0)