summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Olivier Latour <pol@mac.com>2015-01-01 04:14:58 -0800
committerPierre-Olivier Latour <pol@mac.com>2015-01-01 04:19:33 -0800
commitc070ac64fdf799cf57a920583e502ea58fd22b6f (patch)
tree54267c6b5f3c8a43c32a6ca9b79d0175c8e2ef89
parent56065c0954bc7bf6a28cb0a0534b26536b5361ea (diff)
downloadlibgit2-c070ac64fdf799cf57a920583e502ea58fd22b6f.tar.gz
Fixed internal push state not being cleared on download
git_remote_download() must also clear the internal push state resulting from a possible earlier push operation. Otherwise calling git_remote_update_tips() will execute the push version instead of the fetch version and among other things, tags won't be updated.
-rw-r--r--src/remote.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/remote.c b/src/remote.c
index 03b6f2b3e..bc6f10b35 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;