From 3eff2a57289ec19b1a805dd938299d1dcae47097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 22 Apr 2015 16:11:10 +0200 Subject: 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. --- src/clone.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/clone.c') 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)); -- cgit v1.2.1