Skip to content

Commit 66fef15

Browse files
benpeartdscho
authored andcommitted
Merge pull request #93 from benpeart/reset-quiet-post-indexchanged
update the reset --quiet path codepath to pass the correct flags to the post-indexchanged hook
2 parents 690d317 + 20bc4be commit 66fef15

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin/reset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
459459
int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
460460
if (read_from_tree(&pathspec, &oid, intent_to_add))
461461
return 1;
462+
the_index.updated_skipworktree = 1;
462463
if (!quiet && get_git_work_tree()) {
463464
uint64_t t_begin, t_delta_in_ms;
464465

@@ -471,7 +472,6 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
471472
"use '--quiet' to avoid this. Set the config setting reset.quiet to true\n"
472473
"to make this the default.\n"), t_delta_in_ms / 1000.0);
473474
}
474-
the_index.updated_skipworktree = 1;
475475
}
476476
} else {
477477
int err = reset_index(&oid, reset_type, quiet);

t/t7113-post-index-changed-hook.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ test_expect_success 'test reset --mixed and update-index triggers the hook' '
128128
EOF
129129
: force index to be dirty &&
130130
test-tool chmtime +60 dir1/file1.txt &&
131-
git reset --mixed HEAD~1 &&
131+
git reset --mixed --quiet HEAD~1 &&
132132
test_path_is_file testsuccess && rm -f testsuccess &&
133133
test_path_is_missing testfailure &&
134134
git hash-object -w --stdin <dir1/file2.txt >expect &&

0 commit comments

Comments
 (0)