Skip to content

Commit 5e834a4

Browse files
peffgitster
authored andcommitted
t5500: prettify non-commit tag tests
We don't need to use backslash continuation, as the "&&" already provides continuation (and happily soaks up empty lines between commands). We can also expand the multi-line printf into a here-document, which lets us use line breaks more naturally (and avoids another continuation that required us to break the natural indentation). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c12c9df commit 5e834a4

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

t/t5500-fetch-pack.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -533,19 +533,26 @@ test_expect_success 'test --all wrt tag to non-commits' '
533533
# are reachable only via created tag references.
534534
blob=$(echo "hello blob" | git hash-object -t blob -w --stdin) &&
535535
git tag -a -m "tag -> blob" tag-to-blob $blob &&
536-
\
536+
537537
tree=$(printf "100644 blob $blob\tfile" | git mktree) &&
538538
git tag -a -m "tag -> tree" tag-to-tree $tree &&
539-
\
539+
540540
tree2=$(printf "100644 blob $blob\tfile2" | git mktree) &&
541541
commit=$(git commit-tree -m "hello commit" $tree) &&
542542
git tag -a -m "tag -> commit" tag-to-commit $commit &&
543-
\
543+
544544
blob2=$(echo "hello blob2" | git hash-object -t blob -w --stdin) &&
545-
tag=$(printf "object $blob2\ntype blob\ntag tag-to-blob2\n\
546-
tagger author A U Thor <[email protected]> 0 +0000\n\nhello tag" | git mktag) &&
545+
tag=$(git mktag <<-EOF
546+
object $blob2
547+
type blob
548+
tag tag-to-blob2
549+
tagger author A U Thor <[email protected]> 0 +0000
550+
551+
hello tag
552+
EOF
553+
) &&
547554
git tag -a -m "tag -> tag" tag-to-tag $tag &&
548-
\
555+
549556
# `fetch-pack --all` should succeed fetching all those objects.
550557
mkdir fetchall &&
551558
(

0 commit comments

Comments
 (0)