mirror of
https://git.proxmox.com/git/libgit2
synced 2025-10-15 16:59:34 +00:00
Cloning empty repos: only allow missing target for HEAD
This commit is contained in:
parent
28abb187c4
commit
2a2d1ab086
@ -54,9 +54,9 @@ static int add_ref(transport_local *t, const char *name)
|
|||||||
if (error < 0) {
|
if (error < 0) {
|
||||||
git__free(head->name);
|
git__free(head->name);
|
||||||
git__free(head);
|
git__free(head);
|
||||||
if (error == GIT_ENOTFOUND) {
|
if (!strcmp(name, GIT_HEAD_FILE) && error == GIT_ENOTFOUND) {
|
||||||
/* This is actually okay. Empty repos often have a HEAD that points to
|
/* This is actually okay. Empty repos often have a HEAD that points to
|
||||||
* a nonexistant "refs/haeds/master". */
|
* a nonexistent "refs/heads/master". */
|
||||||
giterr_clear();
|
giterr_clear();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user