Merge branch 'pw/rebase-i-regression-fix'
[gitweb.git] / builtin / replace.c
index 065515bababe99ad04249065822584a3f2a0af69..c921bc976f2299adc39277a21a74abbcc0c100f7 100644 (file)
@@ -120,6 +120,7 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn)
                if (fn(full_hex, ref.buf, &oid))
                        had_error = 1;
        }
+       strbuf_release(&ref);
        return had_error;
 }
 
@@ -327,7 +328,7 @@ static void replace_parents(struct strbuf *buf, int argc, const char **argv)
                struct object_id oid;
                if (get_oid(argv[i], &oid) < 0)
                        die(_("Not a valid object name: '%s'"), argv[i]);
-               lookup_commit_or_die(oid.hash, argv[i]);
+               lookup_commit_or_die(&oid, argv[i]);
                strbuf_addf(&new_parents, "parent %s\n", oid_to_hex(&oid));
        }
 
@@ -354,7 +355,7 @@ static void check_one_mergetag(struct commit *commit,
        int i;
 
        hash_sha1_file(extra->value, extra->len, typename(OBJ_TAG), tag_oid.hash);
-       tag = lookup_tag(tag_oid.hash);
+       tag = lookup_tag(&tag_oid);
        if (!tag)
                die(_("bad mergetag in commit '%s'"), ref);
        if (parse_tag_buffer(tag, extra->value, extra->len))
@@ -393,7 +394,7 @@ static int create_graft(int argc, const char **argv, int force)
 
        if (get_oid(old_ref, &old) < 0)
                die(_("Not a valid object name: '%s'"), old_ref);
-       commit = lookup_commit_or_die(old.hash, old_ref);
+       commit = lookup_commit_or_die(&old, old_ref);
 
        buffer = get_commit_buffer(commit, &size);
        strbuf_add(&buf, buffer, size);