mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-10 08:22:54 -05:00
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 8d1a744820 (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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
68aa4c7a65
commit
ca053477d9
@@ -57,11 +57,13 @@ test_expect_success 'Order should not matter: "--git-dir=a.git -C c" is equivale
|
||||
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"' '
|
||||
rm c/a/a.txt &&
|
||||
git --git-dir=c/a.git --work-tree=c/a status >expected &&
|
||||
test_config_global safe.bareRepository all &&
|
||||
git -C c/a.git --work-tree=../a status >actual &&
|
||||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_expect_success 'Order should not matter: "--work-tree=../a -C c/a.git" is equivalent to "-C c/a.git --work-tree=../a"' '
|
||||
test_config_global safe.bareRepository all &&
|
||||
git -C c/a.git --work-tree=../a status >expected &&
|
||||
git --work-tree=../a -C c/a.git status >actual &&
|
||||
test_cmp expected actual
|
||||
|
||||
Reference in New Issue
Block a user