Skip to content

Commit 090a092

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c61a975 commit 090a092

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

run-command.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,11 @@ static void trace_run_command(const struct child_process *cp)
622622
return;
623623

624624
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+
}
625630
/*
626631
* The caller is responsible for initializing cp->env from
627632
* cp->env_array if needed. We only check one place.

0 commit comments

Comments
 (0)