From: Patrick Steinhardt Date: Wed, 04 Mar 2026 07:42:57 GMT Subject: Re: [PATCH v7 05/10] fsmonitor: deduplicate IPC path logic for Unix platforms Message-ID: In-Reply-To: <037ae2a03f8576a73feb889cd61220ba69d97fea.1772065643.git.gitgitgadget@gmail.com> On Thu, Feb 26, 2026 at 12:27:18AM +0000, Paul Tarjan via GitGitGadget wrote: > From: Paul Tarjan Nit: we're not exactly deduplicating just yet, but are rather preparing for that as there is no second implementation using this yet. > 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