Commit 55d9c29aa0c69cdd766c5100fc012d8e0b486e23

Carlos Martín Nieto 2015-01-04T16:44:33

Merge pull request #2792 from swisspol/fix_remote_download Fixed internal push state not being cleared when calling git_remote_download()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/remote.c b/src/remote.c
index 03b6f2b..bc6f10b 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -885,6 +885,11 @@ int git_remote_download(git_remote *remote, const git_strarray *refspecs)
 	if (error < 0)
 		return error;
 
+	if (remote->push) {
+		git_push_free(remote->push);
+		remote->push = NULL;
+	}
+
 	if ((error = git_fetch_negotiate(remote)) < 0)
 		return error;