commit-graph: not compatible with grafts
[gitweb.git] / builtin / replace.c
index deabda210127087188117e394e453373fa48991f..b5861a0ee91f82f6e7bc7641bec140e0ee3ed06c 100644 (file)
@@ -39,7 +39,8 @@ struct show_data {
        enum replace_format format;
 };
 
-static int show_reference(const char *refname, const struct object_id *oid,
+static int show_reference(struct repository *r, const char *refname,
+                         const struct object_id *oid,
                          int flag, void *cb_data)
 {
        struct show_data *data = cb_data;
@@ -56,9 +57,8 @@ static int show_reference(const char *refname, const struct object_id *oid,
                        if (get_oid(refname, &object))
                                return error("Failed to resolve '%s' as a valid ref.", refname);
 
-                       obj_type = oid_object_info(the_repository, &object,
-                                                  NULL);
-                       repl_type = oid_object_info(the_repository, oid, NULL);
+                       obj_type = oid_object_info(r, &object, NULL);
+                       repl_type = oid_object_info(r, oid, NULL);
 
                        printf("%s (%s) -> %s (%s)\n", refname, type_name(obj_type),
                               oid_to_hex(oid), type_name(repl_type));
@@ -371,7 +371,7 @@ static int replace_parents(struct strbuf *buf, int argc, const char **argv)
                        return error(_("Not a valid object name: '%s'"),
                                     argv[i]);
                }
-               if (!lookup_commit_reference(&oid)) {
+               if (!lookup_commit_reference(the_repository, &oid)) {
                        strbuf_release(&new_parents);
                        return error(_("could not parse %s"), argv[i]);
                }
@@ -402,10 +402,10 @@ static int check_one_mergetag(struct commit *commit,
        int i;
 
        hash_object_file(extra->value, extra->len, type_name(OBJ_TAG), &tag_oid);
-       tag = lookup_tag(&tag_oid);
+       tag = lookup_tag(the_repository, &tag_oid);
        if (!tag)
                return error(_("bad mergetag in commit '%s'"), ref);
-       if (parse_tag_buffer(tag, extra->value, extra->len))
+       if (parse_tag_buffer(the_repository, tag, extra->value, extra->len))
                return error(_("malformed mergetag in commit '%s'"), ref);
 
        /* iterate over new parents */
@@ -443,7 +443,7 @@ static int create_graft(int argc, const char **argv, int force, int gentle)
 
        if (get_oid(old_ref, &old_oid) < 0)
                return error(_("Not a valid object name: '%s'"), old_ref);
-       commit = lookup_commit_reference(&old_oid);
+       commit = lookup_commit_reference(the_repository, &old_oid);
        if (!commit)
                return error(_("could not parse %s"), old_ref);
 
@@ -544,7 +544,7 @@ int cmd_replace(int argc, const char **argv, const char *prefix)
                OPT_END()
        };
 
-       check_replace_refs = 0;
+       read_replace_refs = 0;
        git_config(git_default_config, NULL);
 
        argc = parse_options(argc, argv, prefix, options, git_replace_usage, 0);