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 <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau committed
Jul 24, 2023 at 12:39 UTC
f1b9cebc8bdc01c5b8643fac9f78f2962df82cf3
1 file changed
+5
-8
t/lib-commit-graph.sh
+5
-8
@@ -27,14 +27,11 @@ graph_git_behavior() {
27
BRANCH=$3
28
COMPARE=$4
29
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"
35
'
36
}
37