diff options
author | Eric DeCosta <edecosta@mathworks.com> | 2022-10-04 17:32:30 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-10-05 11:05:23 -0700 |
commit | 25c2cab08f90b6251b1ace91e37f05d4cb8fcd0c (patch) | |
tree | 50aa0599d99b5c23931aceff95763e4b087464a3 /fsmonitor.c | |
parent | 12fd27df79ac5f2589b54c8f36761d066dc9a97e (diff) | |
download | git-25c2cab08f90b6251b1ace91e37f05d4cb8fcd0c.tar.gz |
fsmonitor: check for compatability before communicating with fsmonitor
If fsmonitor is not in a compatible state, warn with an appropriate message.
Signed-off-by: Eric DeCosta <edecosta@mathworks.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsmonitor.c')
-rw-r--r-- | fsmonitor.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fsmonitor.c b/fsmonitor.c index 57d6a483be..540736b39f 100644 --- a/fsmonitor.c +++ b/fsmonitor.c @@ -295,6 +295,7 @@ static int fsmonitor_force_update_threshold = 100; void refresh_fsmonitor(struct index_state *istate) { + static int warn_once = 0; struct strbuf query_result = STRBUF_INIT; int query_success = 0, hook_version = -1; size_t bol = 0; /* beginning of line */ @@ -305,6 +306,12 @@ void refresh_fsmonitor(struct index_state *istate) int is_trivial = 0; struct repository *r = istate->repo ? istate->repo : the_repository; enum fsmonitor_mode fsm_mode = fsm_settings__get_mode(r); + enum fsmonitor_reason reason = fsm_settings__get_reason(r); + + if (!warn_once && reason > FSMONITOR_REASON_OK) { + warn_once = 1; + warning("%s", fsm_settings__get_incompatible_msg(r, reason)); + } if (fsm_mode <= FSMONITOR_MODE_DISABLED || istate->fsmonitor_has_run_once) |