summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-05-21 12:09:52 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-05-21 12:09:52 +0200
commit58532ed07619e3576f4e7982ffc28cead44cb661 (patch)
tree1c1ebaa673c41a417c76af92851bc7a4d65489bd
parent430866d28cca5e1c04ca5e65dc0f66ae00a2f288 (diff)
parent60cdf49583e235fd4441e7104a8b04d206824c7c (diff)
downloadlibgit2-58532ed07619e3576f4e7982ffc28cead44cb661.tar.gz
Merge pull request #2373 from kitbellew/fix-clone-into-mirror
Minor fix for cmn/clone-into-mirror.
-rw-r--r--src/clone.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/clone.c b/src/clone.c
index 24f1cae59..9ac9eb2a1 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -342,7 +342,7 @@ static bool should_checkout(
int git_clone_into(git_repository *repo, git_remote *_remote, const git_checkout_options *co_opts, const char *branch, const git_signature *signature)
{
- int error = 0, old_fetchhead;
+ int error;
git_buf reflog_message = GIT_BUF_INIT;
git_remote *remote;
const git_remote_callbacks *callbacks;
@@ -359,13 +359,12 @@ int git_clone_into(git_repository *repo, git_remote *_remote, const git_checkout
callbacks = git_remote_get_callbacks(_remote);
if (!giterr__check_version(callbacks, 1, "git_remote_callbacks") &&
- (error = git_remote_set_callbacks(remote, git_remote_get_callbacks(_remote))) < 0)
+ (error = git_remote_set_callbacks(remote, callbacks)) < 0)
goto cleanup;
if ((error = git_remote_add_fetch(remote, "refs/tags/*:refs/tags/*")) < 0)
goto cleanup;
- old_fetchhead = git_remote_update_fetchhead(remote);
git_remote_set_update_fetchhead(remote, 0);
git_buf_printf(&reflog_message, "clone: from %s", git_remote_url(remote));
@@ -383,7 +382,6 @@ int git_clone_into(git_repository *repo, git_remote *_remote, const git_checkout
error = git_checkout_head(repo, co_opts);
cleanup:
- git_remote_set_update_fetchhead(remote, old_fetchhead);
git_remote_free(remote);
git_buf_free(&reflog_message);