diff options
Diffstat (limited to 'builtin/reset.c')
-rw-r--r-- | builtin/reset.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/reset.c b/builtin/reset.c index fdce6f8c85..376ec95521 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -73,9 +73,11 @@ static int reset_index(const char *ref, const struct object_id *oid, int reset_t case HARD: opts.update = 1; opts.reset = UNPACK_RESET_OVERWRITE_UNTRACKED; + opts.skip_cache_tree_update = 1; break; case MIXED: opts.reset = UNPACK_RESET_PROTECT_UNTRACKED; + opts.skip_cache_tree_update = 1; /* but opts.update=0, so working tree not updated */ break; default: @@ -481,5 +483,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) if (!pathspec.nr) remove_branch_state(the_repository, 0); + discard_index(&the_index); + return update_ref_status; } |