Commit 52ee0e8e6d187960dfc417f0f506f658caecede9

Carlos Martín Nieto 2014-11-23T21:26:53

remote: verify there is a push foreach callback set

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/remote.c b/src/remote.c
index 0b00733..531912c 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -2166,7 +2166,8 @@ int git_remote_push(git_remote *remote, git_strarray *refspecs, const git_push_o
 		goto cleanup;
 	}
 
-	if ((error = git_push_status_foreach(push, cbs->push_update_reference, cbs->payload)) < 0)
+	if (cbs->push_update_reference &&
+	    (error = git_push_status_foreach(push, cbs->push_update_reference, cbs->payload)) < 0)
 		goto cleanup;
 
 	error = git_push_update_tips(push, signature, reflog_message);