reflog-walk: apply --since/--until to reflog dates
[gitweb.git] / builtin / replace.c
index ab17668f4330a5e688d423a60c138768b9955e1b..80a15cf35f3fa5a1a7c038924a84e34fdc15aa0b 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include "cache.h"
+#include "config.h"
 #include "builtin.h"
 #include "refs.h"
 #include "parse-options.h"
@@ -328,7 +329,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));
        }
 
@@ -355,7 +356,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))
@@ -394,7 +395,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);