Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update the reset --quiet path codepath to pass the correct flags to the post-indexchanged hook #93

Merged
merged 1 commit into from
Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion builtin/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,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 @@ -470,7 +471,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