summaryrefslogtreecommitdiffstats
path: root/run-command.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-01-18 16:45:12 +0700
committerJunio C Hamano <gitster@pobox.com>2018-01-19 10:49:20 -0800
commit090a09272ac3bead828519b66eb62d53b53ecf7d (patch)
tree4d8f04e5408424c71ac132e06c32240d8dcb97ba /run-command.c
parentc61a975df1d3d5e448622f951e6dd584ee21ebf3 (diff)
downloadgit-090a09272ac3bead828519b66eb62d53b53ecf7d.tar.gz
git-090a09272ac3bead828519b66eb62d53b53ecf7d.tar.xz
run-command.c: print new cwd in trace_run_command()
If a command sets a new env variable GIT_DIR=.git, we need more context to know where that '.git' is related to. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/run-command.c b/run-command.c
index 1301b878c..a483d5904 100644
--- a/run-command.c
+++ b/run-command.c
@@ -622,6 +622,11 @@ static void trace_run_command(const struct child_process *cp)
return;
strbuf_addf(&buf, "trace: run_command:");
+ if (cp->dir) {
+ strbuf_addstr(&buf, " cd ");
+ sq_quote_buf_pretty(&buf, cp->dir);
+ strbuf_addch(&buf, ';');
+ }
/*
* The caller is responsible for initializing cp->env from
* cp->env_array if needed. We only check one place.