summaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-01-14 08:15:44 -0800
committerJunio C Hamano <gitster@pobox.com>2013-01-14 08:15:44 -0800
commite43171a4a728f627aed7a7b4682e6da2cb378253 (patch)
tree6987f24cc3a74cb05860f245183baf65ebe885d5 /upload-pack.c
parent0a9a787fca09878f993ad37c71a9646277222a6b (diff)
parent6293ded348a918e5644d286dcd8b05044097c27d (diff)
downloadgit-e43171a4a728f627aed7a7b4682e6da2cb378253.tar.gz
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
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 6142421ea1..95d83135ae 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -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;