summaryrefslogtreecommitdiff
path: root/src/remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/remote.c')
-rw-r--r--src/remote.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/remote.c b/src/remote.c
index 5ba7735ae..af5ebdfa6 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -1459,7 +1459,7 @@ int git_remote_update_tips(
const char *reflog_message)
{
git_refspec *spec, tagspec;
- git_vector refs;
+ git_vector refs = GIT_VECTOR_INIT;
int error;
size_t i;
@@ -2330,6 +2330,10 @@ int git_remote_upload(git_remote *remote, const git_strarray *refspecs, const gi
(error = git_remote_connect(remote, GIT_DIRECTION_PUSH)) < 0)
goto cleanup;
+ free_refspecs(&remote->active_refspecs);
+ if (dwim_refspecs(&remote->active_refspecs, &remote->refspecs, &remote->refs) < 0)
+ goto cleanup;
+
if (remote->push) {
git_push_free(remote->push);
remote->push = NULL;