Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Vandiver <alexmv@dropbox.com>2017-10-28 02:26:34 +0300
committerJunio C Hamano <gitster@pobox.com>2017-10-30 05:45:51 +0300
commit11cf33bec62512f2c3f0bdcfdaa41e31e9b0c3e8 (patch)
treecdac40433e00089d77b763dec26033b82348d0cb /fsmonitor.c
parent614a718a797e04fb037b25371896f910e464b671 (diff)
fsmonitor: set the PWD to the top of the working tree
The fsmonitor command inherits the PWD of its caller, which may be anywhere in the working copy. This makes is difficult for the fsmonitor command to operate on the whole repository. Specifically, for the watchman integration, this causes each subdirectory to get its own watch entry. Set the CWD to the top of the working directory, for consistency. Signed-off-by: Alex Vandiver <alexmv@dropbox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsmonitor.c')
-rw-r--r--fsmonitor.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fsmonitor.c b/fsmonitor.c
index 7c1540c054..4ea44dcc6a 100644
--- a/fsmonitor.c
+++ b/fsmonitor.c
@@ -121,6 +121,7 @@ static int query_fsmonitor(int version, uint64_t last_update, struct strbuf *que
argv[3] = NULL;
cp.argv = argv;
cp.use_shell = 1;
+ cp.dir = get_git_work_tree();
return capture_command(&cp, query_result, 1024);
}