diff options
| author | shejialuo <shejialuo@gmail.com> | 2025-02-28 00:05:55 +0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-02-27 14:03:07 -0800 |
| commit | 320f2061b63b0157ea8b21362ed12e4ce90258e2 (patch) | |
| tree | 129648ffbf28577adc6851c77b3a599e869d7a01 /builtin/commit-tree.c | |
| parent | Merge branch 'master' of https://github.com/j6t/gitk (diff) | |
| download | git-320f2061b63b0157ea8b21362ed12e4ce90258e2.tar.gz git-320f2061b63b0157ea8b21362ed12e4ce90258e2.zip | |
t0602: use subshell to ensure working directory unchanged
For every test, we would execute the command "cd repo" in the first but
we never execute the command "cd .." to restore the working directory.
However, it's either not a good idea use above way. Because if any test
fails between "cd repo" and "cd ..", the "cd .." will never be reached.
And we cannot correctly restore the working directory.
Let's use subshell to ensure that the current working directory could be
restored to the correct path.
Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit-tree.c')
0 files changed, 0 insertions, 0 deletions
