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
This commit is contained in:
@ -603,6 +603,8 @@ static void receive_needs(void)
|
|||||||
object = parse_object(sha1);
|
object = parse_object(sha1);
|
||||||
if (!object)
|
if (!object)
|
||||||
die("did not find object for %s", line);
|
die("did not find object for %s", line);
|
||||||
|
if (object->type != OBJ_COMMIT)
|
||||||
|
die("invalid shallow object %s", sha1_to_hex(sha1));
|
||||||
object->flags |= CLIENT_SHALLOW;
|
object->flags |= CLIENT_SHALLOW;
|
||||||
add_object_array(object, NULL, &shallows);
|
add_object_array(object, NULL, &shallows);
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user