Skip to content

Commit

Permalink
Merge pull request #93 from benpeart/reset-quiet-post-indexchanged
Browse files Browse the repository at this point in the history
update the reset --quiet path codepath to pass the correct flags to the post-indexchanged hook
  • Loading branch information
benpeart authored and dscho committed Feb 27, 2019
2 parents 690d317 + 20bc4be commit 66fef15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion builtin/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
if (read_from_tree(&pathspec, &oid, intent_to_add))
return 1;
the_index.updated_skipworktree = 1;
if (!quiet && get_git_work_tree()) {
uint64_t t_begin, t_delta_in_ms;

Expand All @@ -471,7 +472,6 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
"use '--quiet' to avoid this. Set the config setting reset.quiet to true\n"
"to make this the default.\n"), t_delta_in_ms / 1000.0);
}
the_index.updated_skipworktree = 1;
}
} else {
int err = reset_index(&oid, reset_type, quiet);
Expand Down
2 changes: 1 addition & 1 deletion t/t7113-post-index-changed-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ test_expect_success 'test reset --mixed and update-index triggers the hook' '
EOF
: force index to be dirty &&
test-tool chmtime +60 dir1/file1.txt &&
git reset --mixed HEAD~1 &&
git reset --mixed --quiet HEAD~1 &&
test_path_is_file testsuccess && rm -f testsuccess &&
test_path_is_missing testfailure &&
git hash-object -w --stdin <dir1/file2.txt >expect &&
Expand Down

0 comments on commit 66fef15

Please sign in to comment.