diff options
| author | Pierre-Olivier Latour <pol@mac.com> | 2014-10-28 20:56:18 -0700 |
|---|---|---|
| committer | Pierre-Olivier Latour <pol@mac.com> | 2014-11-17 22:46:22 +0900 |
| commit | d3cd7da51fc47d4dd864b398b6987472780aec43 (patch) | |
| tree | 4159ae7d2d4e424cae8ee6f647e682220ae60e06 /src/remote.c | |
| parent | 5915d7001b0084356ece3f23c5e7c3f2be17e39c (diff) | |
| download | libgit2-d3cd7da51fc47d4dd864b398b6987472780aec43.tar.gz | |
Fixed active_refspecs field not initialized on new git_remote objects
When creating a new remote, contrary to loading one from disk,
active_refspecs was not populated. This means that if using the new
remote to push, git_push_update_tips() will be a no-op since it
checks the refspecs passed during the push against the base ones
i.e. active_refspecs. And therefore the local refs won't be created
or updated after the push operation.
Diffstat (limited to 'src/remote.c')
| -rw-r--r-- | src/remote.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/remote.c b/src/remote.c index cc9f85cd1..2897b456d 100644 --- a/src/remote.c +++ b/src/remote.c @@ -163,6 +163,10 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n if (fetch != NULL) { if (add_refspec(remote, fetch, true) < 0) goto on_error; + + /* Move the data over to where the matching functions can find them */ + if (dwim_refspecs(&remote->active_refspecs, &remote->refspecs, &remote->refs) < 0) + goto on_error; } if (!name) |
