Re: [PATCH v7 05/10] fsmonitor: deduplicate IPC path logic for Unix platforms
On Thu, Feb 26, 2026 at 12:27:18AM +0000, Paul Tarjan via GitGitGadget wrote:
> From: Paul Tarjan <github@paulisageek.com>
Nit: we're not exactly deduplicating just yet, but are rather preparing
for that as there is no second implementation using this yet.
Show 24 quoted lines
> diff --git a/compat/fsmonitor/fsm-ipc-darwin.c b/compat/fsmonitor/fsm-ipc-unix.c
> similarity index 96%
> rename from compat/fsmonitor/fsm-ipc-darwin.c
> rename to compat/fsmonitor/fsm-ipc-unix.c
> index fe149a1b37..d34a6419bc 100644
> --- a/compat/fsmonitor/fsm-ipc-darwin.c
> +++ b/compat/fsmonitor/fsm-ipc-unix.c
> @@ -27,13 +27,15 @@ const char *fsmonitor_ipc__get_path(struct repository *r)
> if (ipc_path)
> return ipc_path;
>
> -
> /* By default the socket file is created in the .git directory */
> if (fsmonitor__is_fs_remote(r->gitdir) < 1) {
> ipc_path = fsmonitor_ipc__get_default_path();
> return ipc_path;
> }
>
> + if (!r->worktree)
> + BUG("repository has no worktree");
> +
> git_SHA1_Init(&sha1ctx);
> git_SHA1_Update(&sha1ctx, r->worktree, strlen(r->worktree));
> git_SHA1_Final(hash, &sha1ctx);I think these while-at-it changes should be removed from this commit.
Patrick