@@ -342,7 +342,7 @@ static bool should_checkout(
342
342
343
343
int git_clone_into (git_repository * repo , git_remote * _remote , const git_checkout_options * co_opts , const char * branch , const git_signature * signature )
344
344
{
345
- int error = 0 , old_fetchhead ;
345
+ int error ;
346
346
git_buf reflog_message = GIT_BUF_INIT ;
347
347
git_remote * remote ;
348
348
const git_remote_callbacks * callbacks ;
@@ -359,13 +359,12 @@ int git_clone_into(git_repository *repo, git_remote *_remote, const git_checkout
359
359
360
360
callbacks = git_remote_get_callbacks (_remote );
361
361
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 )
363
363
goto cleanup ;
364
364
365
365
if ((error = git_remote_add_fetch (remote , "refs/tags/*:refs/tags/*" )) < 0 )
366
366
goto cleanup ;
367
367
368
- old_fetchhead = git_remote_update_fetchhead (remote );
369
368
git_remote_set_update_fetchhead (remote , 0 );
370
369
git_buf_printf (& reflog_message , "clone: from %s" , git_remote_url (remote ));
371
370
@@ -383,7 +382,6 @@ int git_clone_into(git_repository *repo, git_remote *_remote, const git_checkout
383
382
error = git_checkout_head (repo , co_opts );
384
383
385
384
cleanup :
386
- git_remote_set_update_fetchhead (remote , old_fetchhead );
387
385
git_remote_free (remote );
388
386
git_buf_free (& reflog_message );
389
387
0 commit comments