Skip to content

Commit cb078d5

Browse files
Alexander OvchinnikovAlexander Ovchinnikov
authored andcommitted
Check if default branch matches refspec
1 parent 6bb3587 commit cb078d5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/clone.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ static int update_head_to_branch(
285285
if ((retcode = git_remote_default_branch(&default_branch, remote)) < 0)
286286
goto cleanup;
287287

288+
if (!git_remote__matching_refspec(remote, git_buf_cstr(&default_branch)))
289+
goto cleanup;
290+
288291
retcode = update_remote_head(repo, remote, &default_branch, reflog_message);
289292

290293
cleanup:

0 commit comments

Comments
 (0)