提交 2934975f 编写于 作者: R Ramkumar Ramachandra 提交者: Junio C Hamano

t4041 (diff-submodule-option): rewrite add_file() routine

Instead of "cd there and then come back", use the "cd there in a
subshell" pattern.  Also fix '&&' chaining in one place.
Suggested-by: NJunio C Hamano <gitster@pobox.com>
Signed-off-by: NRamkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 20fa5385
......@@ -11,18 +11,18 @@ This test tries to verify the sanity of the --submodule option of git diff.
. ./test-lib.sh
add_file () {
sm=$1
shift
owd=$(pwd)
cd "$sm"
for name; do
echo "$name" > "$name" &&
git add "$name" &&
test_tick &&
git commit -m "Add $name"
done >/dev/null
git rev-parse --short --verify HEAD
cd "$owd"
(
cd "$1" &&
shift &&
for name
do
echo "$name" >"$name" &&
git add "$name" &&
test_tick &&
git commit -m "Add $name" || exit
done >/dev/null &&
git rev-parse --short --verify HEAD
)
}
commit_file () {
test_tick &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册