[PATCH v5 7/7] trace.c: print new cwd in trace_run_command()
- From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
- Date
- Jan 15, 2018, 10:59 UTC
- Message-ID
- <20180115105949.18328-8-pclouds@gmail.com>
- In-Reply-To
- <20180115105949.18328-1-pclouds@gmail.com>
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> --- trace.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/trace.c b/trace.c index 8db5bbf3c9..ad75d683bf 100644 --- a/trace.c +++ b/trace.c @@ -342,6 +342,12 @@ void trace_run_command(const struct child_process *cp) 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.
-- 2.15.1.600.g899a5f85c6