lib-submodule-update.sh: reduce use of subshell by using "git -C"
We write
(cd <dir> && git <cmd>)
to avoid
cd <dir> && git <cmd> && cd ..
that allows a breakage in one part of the test script to leave the
entire test process in an unexpected place. Modern version of Git
allows us to do this more concisely with "git -C <dir> <cmd>".
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
parent
d7dffce1ce
commit
3290fe6dd2
|
|
@ -69,10 +69,7 @@ create_lib_submodule_repo () {
|
||||||
|
|
||||||
git checkout -b "replace_sub1_with_directory" "add_sub1" &&
|
git checkout -b "replace_sub1_with_directory" "add_sub1" &&
|
||||||
git submodule update &&
|
git submodule update &&
|
||||||
(
|
git -C sub1 checkout modifications &&
|
||||||
cd sub1 &&
|
|
||||||
git checkout modifications
|
|
||||||
) &&
|
|
||||||
git rm --cached sub1 &&
|
git rm --cached sub1 &&
|
||||||
rm sub1/.git* &&
|
rm sub1/.git* &&
|
||||||
git config -f .gitmodules --remove-section "submodule.sub1" &&
|
git config -f .gitmodules --remove-section "submodule.sub1" &&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue