mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Merge branch 'ed/fsmonitor-on-networked-macos'
By default, use of fsmonitor on a repository on networked filesystem is disabled. Add knobs to make it workable on macOS. * ed/fsmonitor-on-networked-macos: fsmonitor: fix leak of warning message fsmonitor: add documentation for allowRemote and socketDir options fsmonitor: check for compatability before communicating with fsmonitor fsmonitor: deal with synthetic firmlinks on macOS fsmonitor: avoid socket location check if using hook fsmonitor: relocate socket file if .git directory is remote fsmonitor: refactor filesystem checks to common interface
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "parse-options.h"
|
||||
#include "fsmonitor.h"
|
||||
#include "fsmonitor-ipc.h"
|
||||
#include "fsmonitor-path-utils.h"
|
||||
#include "compat/fsmonitor/fsm-health.h"
|
||||
#include "compat/fsmonitor/fsm-listen.h"
|
||||
#include "fsmonitor--daemon.h"
|
||||
@@ -1282,6 +1283,11 @@ static int fsmonitor_run_daemon(void)
|
||||
strbuf_addstr(&state.path_worktree_watch, absolute_path(get_git_work_tree()));
|
||||
state.nr_paths_watching = 1;
|
||||
|
||||
strbuf_init(&state.alias.alias, 0);
|
||||
strbuf_init(&state.alias.points_to, 0);
|
||||
if ((err = fsmonitor__get_alias(state.path_worktree_watch.buf, &state.alias)))
|
||||
goto done;
|
||||
|
||||
/*
|
||||
* We create and delete cookie files somewhere inside the .git
|
||||
* directory to help us keep sync with the file system. If
|
||||
@@ -1343,7 +1349,8 @@ static int fsmonitor_run_daemon(void)
|
||||
* directory.)
|
||||
*/
|
||||
strbuf_init(&state.path_ipc, 0);
|
||||
strbuf_addstr(&state.path_ipc, absolute_path(fsmonitor_ipc__get_path()));
|
||||
strbuf_addstr(&state.path_ipc,
|
||||
absolute_path(fsmonitor_ipc__get_path(the_repository)));
|
||||
|
||||
/*
|
||||
* Confirm that we can create platform-specific resources for the
|
||||
@@ -1390,6 +1397,8 @@ done:
|
||||
strbuf_release(&state.path_gitdir_watch);
|
||||
strbuf_release(&state.path_cookie_prefix);
|
||||
strbuf_release(&state.path_ipc);
|
||||
strbuf_release(&state.alias.alias);
|
||||
strbuf_release(&state.alias.points_to);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user