Commit 43bfa124c844288a9e2e361e1122cc1cc51f1e8f

Carlos Martín Nieto 2022-02-21T10:03:06

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
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/remote.c b/src/remote.c
index 038afc6..f6421b9 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -1852,7 +1852,7 @@ static int update_one_tip(
 	}
 
 	if (callbacks && callbacks->update_tips != NULL &&
-	    callbacks->update_tips(refname.ptr, &old, &head->oid, callbacks->payload) < 0)
+	    (error = callbacks->update_tips(refname.ptr, &old, &head->oid, callbacks->payload)) < 0)
 		git_error_set_after_callback_function(error, "git_remote_fetch");
 
 done: