summaryrefslogtreecommitdiff
path: root/builtin/update-index.c
diff options
context:
space:
mode:
authorBen Peart <benpeart@microsoft.com>2019-02-15 17:59:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-02-15 19:00:33 (GMT)
commit1956ecd0ab26dea9c3ed6b9afe334101d9d12f60 (patch)
tree730cebe0459631dfcfebc1203300cd5d6c7ae468 /builtin/update-index.c
parent8989e1950a845ceeb186d490321a4f917ca4de47 (diff)
downloadgit-1956ecd0ab26dea9c3ed6b9afe334101d9d12f60.zip
git-1956ecd0ab26dea9c3ed6b9afe334101d9d12f60.tar.gz
git-1956ecd0ab26dea9c3ed6b9afe334101d9d12f60.tar.bz2
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/update-index.c')
-rw-r--r--builtin/update-index.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 02ace60..cf73164 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -1071,6 +1071,8 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
if (entries < 0)
die("cache corrupted");
+ the_index.updated_skipworktree = 1;
+
/*
* Custom copy of parse_options() because we want to handle
* filename arguments as they come.