Skip to content

Commit 58532ed

Browse files
committed
Merge pull request libgit2#2373 from kitbellew/fix-clone-into-mirror
Minor fix for cmn/clone-into-mirror.
2 parents 430866d + 60cdf49 commit 58532ed

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/clone.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static bool should_checkout(
342342

343343
int git_clone_into(git_repository *repo, git_remote *_remote, const git_checkout_options *co_opts, const char *branch, const git_signature *signature)
344344
{
345-
int error = 0, old_fetchhead;
345+
int error;
346346
git_buf reflog_message = GIT_BUF_INIT;
347347
git_remote *remote;
348348
const git_remote_callbacks *callbacks;
@@ -359,13 +359,12 @@ int git_clone_into(git_repository *repo, git_remote *_remote, const git_checkout
359359

360360
callbacks = git_remote_get_callbacks(_remote);
361361
if (!giterr__check_version(callbacks, 1, "git_remote_callbacks") &&
362-
(error = git_remote_set_callbacks(remote, git_remote_get_callbacks(_remote))) < 0)
362+
(error = git_remote_set_callbacks(remote, callbacks)) < 0)
363363
goto cleanup;
364364

365365
if ((error = git_remote_add_fetch(remote, "refs/tags/*:refs/tags/*")) < 0)
366366
goto cleanup;
367367

368-
old_fetchhead = git_remote_update_fetchhead(remote);
369368
git_remote_set_update_fetchhead(remote, 0);
370369
git_buf_printf(&reflog_message, "clone: from %s", git_remote_url(remote));
371370

@@ -383,7 +382,6 @@ int git_clone_into(git_repository *repo, git_remote *_remote, const git_checkout
383382
error = git_checkout_head(repo, co_opts);
384383

385384
cleanup:
386-
git_remote_set_update_fetchhead(remote, old_fetchhead);
387385
git_remote_free(remote);
388386
git_buf_free(&reflog_message);
389387

0 commit comments

Comments
 (0)