diff.c: emit_add_line() takes only the rest of the line
[gitweb.git] / builtin-log.c
index 2efe5937346ee7c0a4d85e4087a4ea49a9806005..db71e0da745ee480f8705c81f2899daf1dc6c4f5 100644 (file)
@@ -356,7 +356,13 @@ int cmd_show(int argc, const char **argv, const char *prefix)
                                        t->tag,
                                        diff_get_color_opt(&rev.diffopt, DIFF_RESET));
                        ret = show_object(o->sha1, 1, &rev);
-                       objects[i].item = parse_object(t->tagged->sha1);
+                       if (ret)
+                               break;
+                       o = parse_object(t->tagged->sha1);
+                       if (!o)
+                               ret = error("Could not read object %s",
+                                           sha1_to_hex(t->tagged->sha1));
+                       objects[i].item = o;
                        i--;
                        break;
                }