Skip to content

Commit 5e27c48

Browse files
committed
t5615: wrap bare alternate test in subshell with GIT_DIR
Preparing for `safe.bareRepository` defaulting to `explicit` (see 8d1a744), wrap the `check_obj` call in a subshell that exports `GIT_DIR=.`. This call uses a relative alternate path resolved from `$GIT_DIR` and therefore needs the working directory inside the bare repo. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 75a3c67 commit 5e27c48

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

t/t5615-alternate-env.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ test_expect_success 'access multiple alternates' '
4848
# bare paths are relative from $GIT_DIR
4949
test_expect_success 'access alternate via relative path (bare)' '
5050
git init --bare bare.git &&
51-
check_obj "../one.git/objects" -C bare.git <<-EOF
52-
$one blob
53-
EOF
51+
(
52+
cd bare.git && GIT_DIR=. && export GIT_DIR &&
53+
check_obj "../one.git/objects" <<-EOF
54+
$one blob
55+
EOF
56+
)
5457
'
5558

5659
# non-bare paths are relative to top of worktree

0 commit comments

Comments
 (0)