]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5318: avoid unnecessary command substitutions
authorSZEDER Gábor <szeder.dev@gmail.com>
Mon, 13 Aug 2018 00:30:10 +0000 (02:30 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Aug 2018 19:09:02 +0000 (12:09 -0700)
Two tests added in dade47c06c (commit-graph: add repo arg to graph
readers, 2018-07-11) prepare the contents of 'expect' files by
'echo'ing the results of command substitutions.  That's unncessary,
avoid them by directly saving the output of the commands executed in
those command substitutions.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5318-commit-graph.sh

index 4f17d7701e456bbb0992efdba2861e1dac8f7c23..d5baf635632f3d7b43b70e655cfd3bbe3e646573 100755 (executable)
@@ -444,25 +444,27 @@ test_expect_success 'setup non-the_repository tests' '
 test_expect_success 'parse_commit_in_graph works for non-the_repository' '
        test-tool repository parse_commit_in_graph \
                repo/.git repo "$(git -C repo rev-parse two)" >actual &&
-       echo $(git -C repo log --pretty="%ct" -1) \
-               $(git -C repo rev-parse one) >expect &&
+       {
+               git -C repo log --pretty=format:"%ct " -1 &&
+               git -C repo rev-parse one
+       } >expect &&
        test_cmp expect actual &&
 
        test-tool repository parse_commit_in_graph \
                repo/.git repo "$(git -C repo rev-parse one)" >actual &&
-       echo $(git -C repo log --pretty="%ct" -1 one) >expect &&
+       git -C repo log --pretty="%ct" -1 one >expect &&
        test_cmp expect actual
 '
 
 test_expect_success 'get_commit_tree_in_graph works for non-the_repository' '
        test-tool repository get_commit_tree_in_graph \
                repo/.git repo "$(git -C repo rev-parse two)" >actual &&
-       echo $(git -C repo rev-parse two^{tree}) >expect &&
+       git -C repo rev-parse two^{tree} >expect &&
        test_cmp expect actual &&
 
        test-tool repository get_commit_tree_in_graph \
                repo/.git repo "$(git -C repo rev-parse one)" >actual &&
-       echo $(git -C repo rev-parse one^{tree}) >expect &&
+       git -C repo rev-parse one^{tree} >expect &&
        test_cmp expect actual
 '