Skip to content

Commit 2ae9c05

Browse files
committed
t5540/t5541: avoid accessing a bare repository via -C <dir>
In the `test_http_push_nonff` function both of these test scripts call, there were two Git invocations that assume that bare repositories will always be discovered when the current working directory is inside one. This is unlikely to be true forever because at some stage, the `safe.bareRepository` config is prone to be modified to be safe by default. So let's be safe and specify the bare repository explicitly. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 755be63 commit 2ae9c05

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

t/lib-httpd.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ test_http_push_nonff () {
258258

259259
test_expect_success 'non-fast-forward push fails' '
260260
cd "$REMOTE_REPO" &&
261-
HEAD=$(git rev-parse --verify HEAD) &&
261+
HEAD=$(git --git-dir=. rev-parse --verify HEAD) &&
262262
263263
cd "$LOCAL_REPO" &&
264264
git checkout $BRANCH &&
@@ -269,7 +269,7 @@ test_http_push_nonff () {
269269
(
270270
cd "$REMOTE_REPO" &&
271271
echo "$HEAD" >expect &&
272-
git rev-parse --verify HEAD >actual &&
272+
git --git-dir=. rev-parse --verify HEAD >actual &&
273273
test_cmp expect actual
274274
)
275275
'

0 commit comments

Comments
 (0)