Merge branch 'ph/builtin-srcs-are-in-subdir-these-days'
[gitweb.git] / builtin / diff.c
index 84243d99568c57c03b1179f7282d9883a04d35cb..9fc273d8cd78d53a55047e17d44eb89291741167 100644 (file)
@@ -350,22 +350,21 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
                        die(_("invalid object '%s' given."), name);
                if (obj->type == OBJ_COMMIT)
                        obj = &((struct commit *)obj)->tree->object;
+
                if (obj->type == OBJ_TREE) {
                        obj->flags |= flags;
                        add_object_array(obj, name, &ent);
-                       continue;
-               }
-               if (obj->type == OBJ_BLOB) {
+               } else if (obj->type == OBJ_BLOB) {
                        if (2 <= blobs)
                                die(_("more than two blobs given: '%s'"), name);
                        hashcpy(blob[blobs].sha1, obj->sha1);
                        blob[blobs].name = name;
                        blob[blobs].mode = entry->mode;
                        blobs++;
-                       continue;
 
+               } else {
+                       die(_("unhandled object '%s' given."), name);
                }
-               die(_("unhandled object '%s' given."), name);
        }
        if (rev.prune_data.nr) {
                if (!path)