commit: add repository argument to lookup_commit_reference
[gitweb.git] / builtin / reset.c
index 7f1c3f02a302128d6c00c35b8783c1a62353b37a..d9871e5b6c6f3f417baa7daa4d84d3b9bc9142a9 100644 (file)
@@ -39,7 +39,7 @@ static const char *reset_type_names[] = {
 
 static inline int is_merge(void)
 {
-       return !access(git_path_merge_head(), F_OK);
+       return !access(git_path_merge_head(the_repository), F_OK);
 }
 
 static int reset_index(const struct object_id *oid, int reset_type, int quiet)
@@ -314,12 +314,12 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
        unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid);
        if (unborn) {
                /* reset on unborn branch: treat as reset to empty tree */
-               hashcpy(oid.hash, EMPTY_TREE_SHA1_BIN);
+               oidcpy(&oid, the_hash_algo->empty_tree);
        } else if (!pathspec.nr) {
                struct commit *commit;
                if (get_oid_committish(rev, &oid))
                        die(_("Failed to resolve '%s' as a valid revision."), rev);
-               commit = lookup_commit_reference(&oid);
+               commit = lookup_commit_reference(the_repository, &oid);
                if (!commit)
                        die(_("Could not parse object '%s'."), rev);
                oidcpy(&oid, &commit->object.oid);
@@ -396,7 +396,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
                update_ref_status = reset_refs(rev, &oid);
 
                if (reset_type == HARD && !update_ref_status && !quiet)
-                       print_new_head_line(lookup_commit_reference(&oid));
+                       print_new_head_line(lookup_commit_reference(the_repository, &oid));
        }
        if (!pathspec.nr)
                remove_branch_state();