Skip to content

Commit 3c45863

Browse files
szedergitster
authored andcommitted
t5318: avoid unnecessary command substitutions
Two tests added in dade47c (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dade47c commit 3c45863

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

t/t5318-commit-graph.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,25 +444,27 @@ test_expect_success 'setup non-the_repository tests' '
444444
test_expect_success 'parse_commit_in_graph works for non-the_repository' '
445445
test-tool repository parse_commit_in_graph \
446446
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 &&
449451
test_cmp expect actual &&
450452
451453
test-tool repository parse_commit_in_graph \
452454
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 &&
454456
test_cmp expect actual
455457
'
456458

457459
test_expect_success 'get_commit_tree_in_graph works for non-the_repository' '
458460
test-tool repository get_commit_tree_in_graph \
459461
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 &&
461463
test_cmp expect actual &&
462464
463465
test-tool repository get_commit_tree_in_graph \
464466
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 &&
466468
test_cmp expect actual
467469
'
468470

0 commit comments

Comments
 (0)