diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-04-22 16:11:10 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-05-13 09:46:36 +0200 |
commit | 3eff2a57289ec19b1a805dd938299d1dcae47097 (patch) | |
tree | 3bd01239ee483c5a8d60768228d9968f2ff90611 /src/clone.c | |
parent | 058b753ceb8f6b25b77e57106b3a87997bc6362a (diff) | |
download | libgit2-3eff2a57289ec19b1a805dd938299d1dcae47097.tar.gz |
remote: move the update_fetchhead setting to the options
While this will rarely be different from the default, having it in the
remote adds yet another setting it has to keep around and can affect its
behaviour. Move it to the options.
Diffstat (limited to 'src/clone.c')
-rw-r--r-- | src/clone.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/clone.c b/src/clone.c index 53cdae673..7dcbb8a1d 100644 --- a/src/clone.c +++ b/src/clone.c @@ -328,6 +328,7 @@ static int clone_into(git_repository *repo, git_remote *_remote, const git_fetch { int error; git_buf reflog_message = GIT_BUF_INIT; + git_fetch_options fetch_opts; git_remote *remote; assert(repo && _remote); @@ -343,10 +344,11 @@ static int clone_into(git_repository *repo, git_remote *_remote, const git_fetch if ((error = git_remote_add_fetch(remote, "refs/tags/*:refs/tags/*")) < 0) goto cleanup; - git_remote_set_update_fetchhead(remote, 0); + memcpy(&fetch_opts, opts, sizeof(git_fetch_options)); + fetch_opts.update_fetchhead = 0; git_buf_printf(&reflog_message, "clone: from %s", git_remote_url(remote)); - if ((error = git_remote_fetch(remote, NULL, opts, git_buf_cstr(&reflog_message))) != 0) + if ((error = git_remote_fetch(remote, NULL, &fetch_opts, git_buf_cstr(&reflog_message))) != 0) goto cleanup; error = checkout_branch(repo, remote, co_opts, branch, git_buf_cstr(&reflog_message)); |