Git 2.7.6
[gitweb.git] / builtin / rev-list.c
index 491d298fa25cebb1afd9b33cbbd099efe72629bc..275da0d647ebe147386c69683cc75f2d06105d23 100644 (file)
@@ -81,14 +81,14 @@ static void show_commit(struct commit *commit, void *data)
        if (!revs->graph)
                fputs(get_revision_mark(revs, commit), stdout);
        if (revs->abbrev_commit && revs->abbrev)
-               fputs(find_unique_abbrev(commit->object.sha1, revs->abbrev),
+               fputs(find_unique_abbrev(commit->object.oid.hash, revs->abbrev),
                      stdout);
        else
-               fputs(sha1_to_hex(commit->object.sha1), stdout);
+               fputs(oid_to_hex(&commit->object.oid), stdout);
        if (revs->print_parents) {
                struct commit_list *parents = commit->parents;
                while (parents) {
-                       printf(" %s", sha1_to_hex(parents->item->object.sha1));
+                       printf(" %s", oid_to_hex(&parents->item->object.oid));
                        parents = parents->next;
                }
        }
@@ -97,7 +97,7 @@ static void show_commit(struct commit *commit, void *data)
 
                children = lookup_decoration(&revs->children, &commit->object);
                while (children) {
-                       printf(" %s", sha1_to_hex(children->item->object.sha1));
+                       printf(" %s", oid_to_hex(&children->item->object.oid));
                        children = children->next;
                }
        }
@@ -177,31 +177,27 @@ static void finish_commit(struct commit *commit, void *data)
        free_commit_buffer(commit);
 }
 
-static void finish_object(struct object *obj,
-                         const struct name_path *path, const char *name,
-                         void *cb_data)
+static void finish_object(struct object *obj, const char *name, void *cb_data)
 {
        struct rev_list_info *info = cb_data;
-       if (obj->type == OBJ_BLOB && !has_sha1_file(obj->sha1))
-               die("missing blob object '%s'", sha1_to_hex(obj->sha1));
+       if (obj->type == OBJ_BLOB && !has_object_file(&obj->oid))
+               die("missing blob object '%s'", oid_to_hex(&obj->oid));
        if (info->revs->verify_objects && !obj->parsed && obj->type != OBJ_COMMIT)
-               parse_object(obj->sha1);
+               parse_object(obj->oid.hash);
 }
 
-static void show_object(struct object *obj,
-                       const struct name_path *path, const char *component,
-                       void *cb_data)
+static void show_object(struct object *obj, const char *name, void *cb_data)
 {
        struct rev_list_info *info = cb_data;
-       finish_object(obj, path, component, cb_data);
+       finish_object(obj, name, cb_data);
        if (info->flags & REV_LIST_QUIET)
                return;
-       show_object_with_name(stdout, obj, path, component);
+       show_object_with_name(stdout, obj, name);
 }
 
 static void show_edge(struct commit *commit)
 {
-       printf("-%s\n", sha1_to_hex(commit->object.sha1));
+       printf("-%s\n", oid_to_hex(&commit->object.oid));
 }
 
 static void print_var_str(const char *var, const char *val)
@@ -242,7 +238,7 @@ static int show_bisect_vars(struct rev_list_info *info, int reaches, int all)
                cnt = reaches;
 
        if (revs->commits)
-               sha1_to_hex_r(hex, revs->commits->item->object.sha1);
+               sha1_to_hex_r(hex, revs->commits->item->object.oid.hash);
 
        if (flags & BISECT_SHOW_ALL) {
                traverse_commit_list(revs, show_commit, show_object, info);