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>
Denton Liu committed
Apr 17, 2019 at 11:23 UTC
b510f0beab2e251175ea3d021129b6029c370aa4
1 file changed
+13
-14
t/t7600-merge.sh
+13
-14
@@ -233,17 +233,16 @@ test_expect_success 'merge --squash c3 with c7' '
233
cat result.9z >file &&
234
git commit --no-edit -a &&
235
236
- {
237
- cat <<-EOF
238
- Squashed commit of the following:
236
+ cat >expect <<-EOF &&
237
+ Squashed commit of the following:
238
240
- $(git show -s c7)
239
+ $(git show -s c7)
240
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 &&
246
test_cmp expect actual
247
'
248
@@ -680,10 +679,10 @@ cat >editor <<\EOF
679
(
680
echo "Merge work done on the side branch c1"
681
echo
683
- cat <"$1"
682
+ cat "$1"
683
) >"$1.tmp" && mv "$1.tmp" "$1"
684
# 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
686
EOF
687
chmod 755 editor
688
@@ -768,14 +767,14 @@ test_expect_success 'set up mod-256 conflict scenario' '
767
git commit -m base &&
768
769
# one side changes the first line of each to "master"
771
- sed s/-1/-master/ <file >tmp &&
770
+ sed s/-1/-master/ file >tmp &&
771
mv tmp file &&
772
git commit -am master &&
773
774
# and the other to "side"; merging the two will
775
# yield 256 separate conflicts
776
git checkout -b side HEAD^ &&
778
- sed s/-1/-side/ <file >tmp &&
777
+ sed s/-1/-side/ file >tmp &&
778
mv tmp file &&
779
git commit -am side
780
'
@@ -814,7 +813,7 @@ EOF
813
test_expect_success EXECKEEPSPID 'killed merge can be completed with --continue' '
814
git reset --hard c0 &&
815
! "$SHELL_PATH" -c '\''
817
- echo kill -TERM $$ >> .git/FAKE_EDITOR
816
+ echo kill -TERM $$ >>.git/FAKE_EDITOR
817
GIT_EDITOR=.git/FAKE_EDITOR
818
export GIT_EDITOR
819
exec git merge --no-ff --edit c1'\'' &&