diff options
author | Carl Worth <cworth@cworth.org> | 2006-02-17 16:14:52 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-02-17 16:20:51 -0800 |
commit | b5b16990f8b074bd0481ced047b8f8bf66eee6dc (patch) | |
tree | 9cc8cdea7f77cfbf98f72e7e46e22e33e578f510 /upload-pack.c | |
parent | Abstract test_create_repo out for use in tests. (diff) | |
download | tgif-b5b16990f8b074bd0481ced047b8f8bf66eee6dc.tar.xz |
Prevent git-upload-pack segfault if object cannot be found
Signed-off-by: Carl Worth <cworth@cworth.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'upload-pack.c')
-rw-r--r-- | upload-pack.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/upload-pack.c b/upload-pack.c index d1980556ca..3606529f61 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -216,6 +216,9 @@ static int send_ref(const char *refname, const unsigned char *sha1) static char *capabilities = "multi_ack"; struct object *o = parse_object(sha1); + if (!o) + die("git-upload-pack: cannot find object %s:", sha1_to_hex(sha1)); + if (capabilities) packet_write(1, "%s %s%c%s\n", sha1_to_hex(sha1), refname, 0, capabilities); |