Skip to content

Commit f1b9ceb

Browse files
ttaylorrgitster
authored andcommitted
t/lib-commit-graph.sh: avoid sub-shell in graph_git_behavior()
In a previous commit, we introduced a sub-shell in the implementation of `graph_git_behavior()`, in order to allow us to pass `-C "$DIR"` directly to the git processes spawned by `graph_git_two_modes()`. Now that its callers are always operating from the "$TRASH_DIRECTORY" instead of one of its sub-directories, we can drop the inner sub-shell, as it is no longer required. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 749f126 commit f1b9ceb

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

t/lib-commit-graph.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,11 @@ graph_git_behavior() {
2727
BRANCH=$3
2828
COMPARE=$4
2929
test_expect_success "check normal git operations: $MSG" '
30-
(
31-
cd "$TRASH_DIRECTORY" &&
32-
graph_git_two_modes "${DIR:+-C $DIR} log --oneline $BRANCH" &&
33-
graph_git_two_modes "${DIR:+-C $DIR} log --topo-order $BRANCH" &&
34-
graph_git_two_modes "${DIR:+-C $DIR} log --graph $COMPARE..$BRANCH" &&
35-
graph_git_two_modes "${DIR:+-C $DIR} branch -vv" &&
36-
graph_git_two_modes "${DIR:+-C $DIR} merge-base -a $BRANCH $COMPARE"
37-
)
30+
graph_git_two_modes "${DIR:+-C $DIR} log --oneline $BRANCH" &&
31+
graph_git_two_modes "${DIR:+-C $DIR} log --topo-order $BRANCH" &&
32+
graph_git_two_modes "${DIR:+-C $DIR} log --graph $COMPARE..$BRANCH" &&
33+
graph_git_two_modes "${DIR:+-C $DIR} branch -vv" &&
34+
graph_git_two_modes "${DIR:+-C $DIR} merge-base -a $BRANCH $COMPARE"
3835
'
3936
}
4037

0 commit comments

Comments
 (0)