summaryrefslogtreecommitdiff
path: root/reset.c
diff options
context:
space:
mode:
Diffstat (limited to 'reset.c')
-rw-r--r--reset.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/reset.c b/reset.c
index e3383a9334..48da0adf85 100644
--- a/reset.c
+++ b/reset.c
@@ -1,6 +1,9 @@
#include "git-compat-util.h"
#include "cache-tree.h"
+#include "gettext.h"
+#include "hex.h"
#include "lockfile.h"
+#include "object-name.h"
#include "refs.h"
#include "reset.h"
#include "run-command.h"
@@ -38,7 +41,7 @@ static int update_refs(const struct reset_head_opts *opts,
prefix_len = msg.len;
if (update_orig_head) {
- if (!get_oid("ORIG_HEAD", &oid_old_orig))
+ if (!repo_get_oid(the_repository, "ORIG_HEAD", &oid_old_orig))
old_orig = &oid_old_orig;
if (head) {
if (!reflog_orig_head) {
@@ -106,7 +109,7 @@ int reset_head(struct repository *r, const struct reset_head_opts *opts)
goto leave_reset_head;
}
- if (!get_oid("HEAD", &head_oid)) {
+ if (!repo_get_oid(r, "HEAD", &head_oid)) {
head = &head_oid;
} else if (!oid || !reset_hard) {
ret = error(_("could not determine HEAD revision"));
@@ -128,6 +131,7 @@ int reset_head(struct repository *r, const struct reset_head_opts *opts)
unpack_tree_opts.update = 1;
unpack_tree_opts.merge = 1;
unpack_tree_opts.preserve_ignored = 0; /* FIXME: !overwrite_ignore */
+ unpack_tree_opts.skip_cache_tree_update = 1;
init_checkout_metadata(&unpack_tree_opts.meta, switch_to_branch, oid, NULL);
if (reset_hard)
unpack_tree_opts.reset = UNPACK_RESET_PROTECT_UNTRACKED;