fsmonitor--daemon: allow --super-prefix argument
commit53fcfbc84f68d11c9635fe58f72ce5a83200e051
authorJeff Hostetler <jeffhost@microsoft.com>
Thu, 26 May 2022 21:47:23 +0000 (26 21:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 May 2022 22:59:28 +0000 (26 15:59 -0700)
tree9810932d8b201a5a8b1486866193a11668d5f515
parenteb299010eee63b5a069d82836efb38969ffd4109
fsmonitor--daemon: allow --super-prefix argument

Create a test in t7527 to verify that we get a stray warning from
`git fsmonitor--daemon start` when indirectly called from
`git submodule absorbgitdirs`.

Update `git fsmonitor--daemon` to take (and ignore) the `--super-prefix`
argument to suppress the warning.

When we have:

1. a submodule with a `sub/.git/` directory (rather than a `sub/.git`
file).

2. `core.fsmonitor` is turned on in the submodule, but the daemon is
not yet started in the submodule.

3. and someone does a `git submodule absorbgitdirs` in the super.

Git will recursively invoke `git submodule--helper absorb-git-dirs`
in the submodule.  This will read the index and may attempt to start
the fsmonitor--daemon with the `--super-prefix` argument.

`git fsmonitor--daemon start` does not accept the `--super-prefix`
argument and causes a warning to be issued.

This does not cause a problem because the `refresh_index()` code
assumes a trivial response if the daemon does not start.

The net-net is a harmelss, but stray warning.  Lets eliminate the
warning.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git.c
t/t7527-builtin-fsmonitor.sh