Skip to content

Commit

Permalink
Merge branch 'nd/upload-pack-shallow-must-be-commit'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Jan 14, 2013
2 parents 0a9a787 + 6293ded commit e43171a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions upload-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,8 @@ static void receive_needs(void)
object = parse_object(sha1);
if (!object)
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;
add_object_array(object, NULL, &shallows);
continue;
Expand Down

0 comments on commit e43171a

Please sign in to comment.