Commit e098b5f5071ca3eeee138785de1b8db3c1152f8d

Edward Thomson 2017-09-12T20:21:27

Merge pull request #4344 from slavikus/fix-dirty-buffer-in-git-push-update-tips Clear the remote_ref_name buffer in git_push_update_tips()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/push.c b/src/push.c
index c2abbb9..41b66df 100644
--- a/src/push.c
+++ b/src/push.c
@@ -178,6 +178,9 @@ int git_push_update_tips(git_push *push, const git_remote_callbacks *callbacks)
 		if (!fetch_spec)
 			continue;
 
+		/* Clear the buffer which can be dirty from previous iteration */
+		git_buf_clear(&remote_ref_name);
+
 		if ((error = git_refspec_transform(&remote_ref_name, fetch_spec, status->ref)) < 0)
 			goto on_error;