t5318: avoid unnecessary command substitutions
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>
SZEDER Gábor committed
Aug 13, 2018 at 02:30 UTC
3c4586301dca0d25708bfcec00915e4493278403
1 file changed
+7
-5
t/t5318-commit-graph.sh
+7
-5
@@ -444,25 +444,27 @@ test_expect_success 'setup non-the_repository tests' '
444
test_expect_success 'parse_commit_in_graph works for non-the_repository' '
445
test-tool repository parse_commit_in_graph \
446
repo/.git repo "$(git -C repo rev-parse two)" >actual &&
447
- echo $(git -C repo log --pretty="%ct" -1) \
448
- $(git -C repo rev-parse one) >expect &&
447
+ {
448
+ git -C repo log --pretty=format:"%ct " -1 &&
449
+ git -C repo rev-parse one
450
+ } >expect &&
451
test_cmp expect actual &&
452
453
test-tool repository parse_commit_in_graph \
454
repo/.git repo "$(git -C repo rev-parse one)" >actual &&
453
- echo $(git -C repo log --pretty="%ct" -1 one) >expect &&
455
+ git -C repo log --pretty="%ct" -1 one >expect &&
456
test_cmp expect actual
457
'
458
459
test_expect_success 'get_commit_tree_in_graph works for non-the_repository' '
460
test-tool repository get_commit_tree_in_graph \
461
repo/.git repo "$(git -C repo rev-parse two)" >actual &&
460
- echo $(git -C repo rev-parse two^{tree}) >expect &&
462
+ git -C repo rev-parse two^{tree} >expect &&
463
test_cmp expect actual &&
464
465
test-tool repository get_commit_tree_in_graph \
466
repo/.git repo "$(git -C repo rev-parse one)" >actual &&
465
- echo $(git -C repo rev-parse one^{tree}) >expect &&
467
+ git -C repo rev-parse one^{tree} >expect &&
468
test_cmp expect actual
469
'
470