]> git.ipfire.org Git - thirdparty/git.git/commit
fsmonitor: remove custom loop from non-directory path handler
authorJeff Hostetler <jeffhostetler@github.com>
Mon, 26 Feb 2024 21:39:21 +0000 (21:39 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Feb 2024 23:34:03 +0000 (15:34 -0800)
commit558d146d13e2632aa9cd580cbfb81fbf635c3566
tree3a05531fdb1c8cc7518215b70fa055cd007ab242
parenta52482036cde8d2cd779039a70162fda9bd1c29a
fsmonitor: remove custom loop from non-directory path handler

Refactor the code that handles refresh events for pathnames that do
not contain a trailing slash.  Instead of using a custom loop to try
to scan the index and detect if the FSEvent named a file or might be a
directory prefix, use the recently created helper function to do that.

Also update the comments to describe what and why we are doing this.

On platforms that DO NOT annotate FS events with a trailing
slash, if we fail to find an exact match for the pathname
in the index, we do not know if the pathname represents a
directory or simply an untracked file.  Pretend that the pathname
is a directory and try again before assuming it is an untracked
file.

Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fsmonitor.c