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>

Nguyễn Thái Ngọc Duy committed Jan 18, 2018 at 16:45 UTC 090a09272ac3bead828519b66eb62d53b53ecf7d
1 file changed +5
run-command.c
+5
@@ -622,6 +622,11 @@ static void trace_run_command(const struct child_process *cp)
622 return;
623
624 strbuf_addf(&buf, "trace: run_command:");
625 + if (cp->dir) {
626 + strbuf_addstr(&buf, " cd ");
627 + sq_quote_buf_pretty(&buf, cp->dir);
628 + strbuf_addch(&buf, ';');
629 + }
630 /*
631 * The caller is responsible for initializing cp->env from
632 * cp->env_array if needed. We only check one place.