3 test_description
='selecting remote repo in ambiguous cases'
5 TEST_PASSES_SANITIZE_LEAK
=true
9 rm -rf foo foo.git fetch clone
14 (cd "$1" && test_commit
"$1")
18 git init
--bare "$1" &&
20 tree
=$
(git hash-object
-w -t tree
/dev
/null
) &&
21 commit
=$
(echo "$1" | git commit-tree
$tree) &&
22 git update-ref HEAD
$commit
27 git init
--bare fetch
&&
28 (cd fetch
&& git fetch
"../$1") &&
34 (cd fetch
&& git log
-1 --format=%s FETCH_HEAD
) >actual.fetch
&&
35 (cd clone
&& git log
-1 --format=%s HEAD
) >actual.clone
&&
36 test_cmp expect actual.fetch
&&
37 test_cmp expect actual.clone
40 test_expect_success
'find .git dir in worktree' '
47 test_expect_success
'automagically add .git suffix' '
54 test_expect_success
'automagically add .git suffix to worktree' '
61 test_expect_success
'prefer worktree foo over bare foo.git' '
69 test_expect_success
'prefer bare foo over bare foo.git' '
77 test_expect_success
'disambiguate with full foo.git' '
85 test_expect_success
'we are not fooled by non-git foo directory' '
93 test_expect_success
'prefer inner .git over outer bare' '
97 mv foo/.git foo.git &&