Skip to content

Commit 5b6bb18

Browse files
committed
t0056: allow implicit bare repo discovery for -C work-tree tests
The `git -C c/a.git --work-tree=../a` invocations in t0056-git-C.sh enter what is technically the `.git` directory of a repository to test `-C` combined with `--work-tree`. In doing so, the code relies on implicit discovery of bare repositories, which 8d1a744 (setup.c: create `safe.bareRepository`, 2022-07-14) prepared to be prevented by default. These tests verify the interaction between those flags, so changing them to use `--git-dir` would defeat their purpose. So let's just temporarily force-enable implicit discovery of bare repositories, no matter what `safe.bareRepository` defaults to. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent a4f7a6d commit 5b6bb18

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

t/t0056-git-C.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ test_expect_success 'Order should not matter: "--git-dir=a.git -C c" is equivale
5757
test_expect_success 'Effect on --work-tree option: "-C c/a.git --work-tree=../a" is equivalent to "--work-tree=c/a --git-dir=c/a.git"' '
5858
rm c/a/a.txt &&
5959
git --git-dir=c/a.git --work-tree=c/a status >expected &&
60+
test_config_global safe.bareRepository all &&
6061
git -C c/a.git --work-tree=../a status >actual &&
6162
test_cmp expected actual
6263
'
6364

6465
test_expect_success 'Order should not matter: "--work-tree=../a -C c/a.git" is equivalent to "-C c/a.git --work-tree=../a"' '
66+
test_config_global safe.bareRepository all &&
6567
git -C c/a.git --work-tree=../a status >expected &&
6668
git --work-tree=../a -C c/a.git status >actual &&
6769
test_cmp expected actual

0 commit comments

Comments
 (0)