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