Skip to content

Commit 17850ef

Browse files
committed
Merge branch 'jx/do-not-crash-receive-pack-wo-head' into maint
An attempt to delete a ref by pushing into a repositorywhose HEAD symbolic reference points at an unborn branch that cannot be created due to ref D/F conflict (e.g. refs/heads/a/b exists, HEAD points at refs/heads/a) failed. * jx/do-not-crash-receive-pack-wo-head: receive-pack: crash when checking with non-exist HEAD
2 parents 5a30374 + b112b14 commit 17850ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/receive-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ static const char *update(struct command *cmd, struct shallow_info *si)
911911
return "deletion prohibited";
912912
}
913913

914-
if (!strcmp(namespaced_name, head_name)) {
914+
if (head_name && !strcmp(namespaced_name, head_name)) {
915915
switch (deny_delete_current) {
916916
case DENY_IGNORE:
917917
break;

0 commit comments

Comments
 (0)