diff options
author | Alexander Ovchinnikov <Alexander.Ovchinnikov@mendix.com> | 2021-08-05 14:02:54 +0200 |
---|---|---|
committer | Alexander Ovchinnikov <Alexander.Ovchinnikov@mendix.com> | 2021-08-26 12:13:01 +0200 |
commit | cb078d5194e67e093cdd53b235bc1bd837490ca3 (patch) | |
tree | 12d8e953a7e3f00e2c7799ffc66cf6e5508b5e6f | |
parent | 6bb35878629d77e002e5f744aaf2e62f5bb4cb42 (diff) | |
download | libgit2-cb078d5194e67e093cdd53b235bc1bd837490ca3.tar.gz |
Check if default branch matches refspec
-rw-r--r-- | src/clone.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/clone.c b/src/clone.c index 962cf1263..e29a4aab3 100644 --- a/src/clone.c +++ b/src/clone.c @@ -285,6 +285,9 @@ static int update_head_to_branch( if ((retcode = git_remote_default_branch(&default_branch, remote)) < 0) goto cleanup; + if (!git_remote__matching_refspec(remote, git_buf_cstr(&default_branch))) + goto cleanup; + retcode = update_remote_head(repo, remote, &default_branch, reflog_message); cleanup: |