summaryrefslogtreecommitdiff
path: root/builtin/reset.c
diff options
context:
space:
mode:
authorLibravatar Ben Peart <benpeart@microsoft.com>2019-02-15 12:59:21 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-02-15 11:00:33 -0800
commit1956ecd0ab26dea9c3ed6b9afe334101d9d12f60 (patch)
tree730cebe0459631dfcfebc1203300cd5d6c7ae468 /builtin/reset.c
parentGit 2.21-rc1 (diff)
downloadtgif-1956ecd0ab26dea9c3ed6b9afe334101d9d12f60.tar.xz
read-cache: add post-index-change hook
Add a post-index-change hook that is invoked after the index is written in do_write_locked_index(). This hook is meant primarily for notification, and cannot affect the outcome of git commands that trigger the index write. The hook is passed a flag to indicate whether the working directory was updated or not and a flag indicating if a skip-worktree bit could have changed. These flags enable the hook to optimize its response to the index change notification. Signed-off-by: Ben Peart <benpeart@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/reset.c')
-rw-r--r--builtin/reset.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/reset.c b/builtin/reset.c
index 4d18a461fa..e173afcaac 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -380,6 +380,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;