1
0
mirror of https://github.com/git/git.git synced 2024-09-28 01:43:24 +02:00

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>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2018-01-18 16:45:12 +07:00 committed by Junio C Hamano
parent c61a975df1
commit 090a09272a

View File

@ -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.