get_sha1_oneline: check return value of parse_object
authorMartin Koegler <mkoegler@auto.tuwien.ac.at>
Mon, 18 Feb 2008 20:47:53 +0000 (21:47 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Feb 2008 03:20:18 +0000 (19:20 -0800)
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c

index 13e11645e1fd6b61812cc3e88d2ad6cd42cad9ce..4c0bc9c5b5d5257195ee676fe46d1d9129daf7e8 100644 (file)
@@ -617,7 +617,8 @@ static int get_sha1_oneline(const char *prefix, unsigned char *sha1)
                unsigned long size;
 
                commit = pop_most_recent_commit(&list, ONELINE_SEEN);
-               parse_object(commit->object.sha1);
+               if (!parse_object(commit->object.sha1))
+                       continue;
                if (temp_commit_buffer)
                        free(temp_commit_buffer);
                if (commit->buffer)