@@ -393,7 +393,7 @@ static int checkout_branch(git_repository *repo, git_remote *remote, const git_c
393
393
return error ;
394
394
}
395
395
396
- static int clone_into (git_repository * repo , git_remote * _remote , const git_fetch_options * opts , const git_checkout_options * co_opts , const char * branch )
396
+ static int clone_into (git_repository * repo , git_remote * _remote , const git_fetch_options * opts , const git_checkout_options * co_opts , const char * branch , const git_strarray * refspecs )
397
397
{
398
398
int error ;
399
399
git_str reflog_message = GIT_STR_INIT ;
@@ -416,7 +416,7 @@ static int clone_into(git_repository *repo, git_remote *_remote, const git_fetch
416
416
fetch_opts .download_tags = GIT_REMOTE_DOWNLOAD_TAGS_ALL ;
417
417
git_str_printf (& reflog_message , "clone: from %s" , git_remote_url (remote ));
418
418
419
- if ((error = git_remote_fetch (remote , NULL , & fetch_opts , git_str_cstr (& reflog_message ))) != 0 )
419
+ if ((error = git_remote_fetch (remote , refspecs , & fetch_opts , git_str_cstr (& reflog_message ))) != 0 )
420
420
goto cleanup ;
421
421
422
422
error = checkout_branch (repo , remote , co_opts , branch , git_str_cstr (& reflog_message ));
@@ -507,7 +507,7 @@ static int git__clone(
507
507
else if (clone_local == 0 )
508
508
error = clone_into (
509
509
repo , origin , & options .fetch_opts , & options .checkout_opts ,
510
- options .checkout_branch );
510
+ options .checkout_branch , options . refspecs . count == 0 ? NULL : & options . refspecs );
511
511
else
512
512
error = -1 ;
513
513
0 commit comments