]> git.proxmox.com Git - libgit2.git/commitdiff
Fixed internal push state not being cleared on download
authorPierre-Olivier Latour <pol@mac.com>
Thu, 1 Jan 2015 12:14:58 +0000 (04:14 -0800)
committerPierre-Olivier Latour <pol@mac.com>
Thu, 1 Jan 2015 12:19:33 +0000 (04:19 -0800)
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.

src/remote.c

index 03b6f2b3ebee80b6e7d6a372a6d0dd37265f2bfd..bc6f10b35298209e47f2c5fa53cb0c9ebc215d9f 100644 (file)
@@ -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;