Skip to content

Commit e43171a

Browse files
committed
Merge branch 'nd/upload-pack-shallow-must-be-commit'
A minor consistency check patch that does not have much relevance to the real world. * nd/upload-pack-shallow-must-be-commit: upload-pack: only accept commits from "shallow" line
2 parents 0a9a787 + 6293ded commit e43171a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

upload-pack.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,8 @@ static void receive_needs(void)
603603
object = parse_object(sha1);
604604
if (!object)
605605
die("did not find object for %s", line);
606+
if (object->type != OBJ_COMMIT)
607+
die("invalid shallow object %s", sha1_to_hex(sha1));
606608
object->flags |= CLIENT_SHALLOW;
607609
add_object_array(object, NULL, &shallows);
608610
continue;

0 commit comments

Comments
 (0)