t7600: clean up style

Clean up the 'merge --squash c3 with c7' test by removing some
unnecessary braces and removing a pipe.

Also, generally cleanup style by unindenting a here-doc, removing stray
spaces after a redirection operator and allowing sed to open its own
input instead of redirecting input from the shell.

Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Denton Liu 2019-04-17 11:23:21 +01:00 committed by Junio C Hamano
parent d74f3e5811
commit b510f0beab

View file

@ -233,17 +233,16 @@ test_expect_success 'merge --squash c3 with c7' '
cat result.9z >file &&
git commit --no-edit -a &&
{
cat <<-EOF
Squashed commit of the following:
cat >expect <<-EOF &&
Squashed commit of the following:
$(git show -s c7)
$(git show -s c7)
# Conflicts:
# file
EOF
} >expect &&
git cat-file commit HEAD | sed -e '1,/^$/d' >actual &&
# Conflicts:
# file
EOF
git cat-file commit HEAD >raw &&
sed -e '1,/^$/d' raw >actual &&
test_cmp expect actual
'
@ -680,10 +679,10 @@ cat >editor <<\EOF
(
echo "Merge work done on the side branch c1"
echo
cat <"$1"
cat "$1"
) >"$1.tmp" && mv "$1.tmp" "$1"
# strip comments and blank lines from end of message
sed -e '/^#/d' < "$1" | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' > expected
sed -e '/^#/d' "$1" | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' >expected
EOF
chmod 755 editor
@ -768,14 +767,14 @@ test_expect_success 'set up mod-256 conflict scenario' '
git commit -m base &&
# one side changes the first line of each to "master"
sed s/-1/-master/ <file >tmp &&
sed s/-1/-master/ file >tmp &&
mv tmp file &&
git commit -am master &&
# and the other to "side"; merging the two will
# yield 256 separate conflicts
git checkout -b side HEAD^ &&
sed s/-1/-side/ <file >tmp &&
sed s/-1/-side/ file >tmp &&
mv tmp file &&
git commit -am side
'
@ -814,7 +813,7 @@ EOF
test_expect_success EXECKEEPSPID 'killed merge can be completed with --continue' '
git reset --hard c0 &&
! "$SHELL_PATH" -c '\''
echo kill -TERM $$ >> .git/FAKE_EDITOR
echo kill -TERM $$ >>.git/FAKE_EDITOR
GIT_EDITOR=.git/FAKE_EDITOR
export GIT_EDITOR
exec git merge --no-ff --edit c1'\'' &&