Skip to content

Commit b510f0b

Browse files
Denton-Lgitster
authored andcommitted
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>
1 parent d74f3e5 commit b510f0b

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

t/t7600-merge.sh

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -233,17 +233,16 @@ test_expect_success 'merge --squash c3 with c7' '
233233
cat result.9z >file &&
234234
git commit --no-edit -a &&
235235
236-
{
237-
cat <<-EOF
238-
Squashed commit of the following:
236+
cat >expect <<-EOF &&
237+
Squashed commit of the following:
239238
240-
$(git show -s c7)
239+
$(git show -s c7)
241240
242-
# Conflicts:
243-
# file
244-
EOF
245-
} >expect &&
246-
git cat-file commit HEAD | sed -e '1,/^$/d' >actual &&
241+
# Conflicts:
242+
# file
243+
EOF
244+
git cat-file commit HEAD >raw &&
245+
sed -e '1,/^$/d' raw >actual &&
247246
test_cmp expect actual
248247
'
249248

@@ -680,10 +679,10 @@ cat >editor <<\EOF
680679
(
681680
echo "Merge work done on the side branch c1"
682681
echo
683-
cat <"$1"
682+
cat "$1"
684683
) >"$1.tmp" && mv "$1.tmp" "$1"
685684
# strip comments and blank lines from end of message
686-
sed -e '/^#/d' < "$1" | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' > expected
685+
sed -e '/^#/d' "$1" | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' >expected
687686
EOF
688687
chmod 755 editor
689688

@@ -768,14 +767,14 @@ test_expect_success 'set up mod-256 conflict scenario' '
768767
git commit -m base &&
769768
770769
# one side changes the first line of each to "master"
771-
sed s/-1/-master/ <file >tmp &&
770+
sed s/-1/-master/ file >tmp &&
772771
mv tmp file &&
773772
git commit -am master &&
774773
775774
# and the other to "side"; merging the two will
776775
# yield 256 separate conflicts
777776
git checkout -b side HEAD^ &&
778-
sed s/-1/-side/ <file >tmp &&
777+
sed s/-1/-side/ file >tmp &&
779778
mv tmp file &&
780779
git commit -am side
781780
'
@@ -814,7 +813,7 @@ EOF
814813
test_expect_success EXECKEEPSPID 'killed merge can be completed with --continue' '
815814
git reset --hard c0 &&
816815
! "$SHELL_PATH" -c '\''
817-
echo kill -TERM $$ >> .git/FAKE_EDITOR
816+
echo kill -TERM $$ >>.git/FAKE_EDITOR
818817
GIT_EDITOR=.git/FAKE_EDITOR
819818
export GIT_EDITOR
820819
exec git merge --no-ff --edit c1'\'' &&

0 commit comments

Comments
 (0)