3 test_description='selecting remote repo in ambiguous cases'
7 rm -rf foo foo.git fetch clone
12 (cd "$1" && test_commit "$1")
16 git init --bare "$1" &&
18 tree=`git hash-object -w -t tree /dev/null` &&
19 commit=$(echo "$1" | git commit-tree $tree) &&
20 git update-ref HEAD $commit
25 git init --bare fetch &&
26 (cd fetch && git fetch "../$1") &&
32 (cd fetch && git log -1 --format=%s FETCH_HEAD) >actual.fetch &&
33 (cd clone && git log -1 --format=%s HEAD) >actual.clone &&
34 test_cmp expect actual.fetch &&
35 test_cmp expect actual.clone
38 test_expect_success 'find .git dir in worktree' '
45 test_expect_success 'automagically add .git suffix' '
52 test_expect_success 'automagically add .git suffix to worktree' '
59 test_expect_success 'prefer worktree foo over bare foo.git' '
67 test_expect_success 'prefer bare foo over bare foo.git' '
75 test_expect_success 'disambiguate with full foo.git' '
83 test_expect_success 'we are not fooled by non-git foo directory' '
91 test_expect_success 'prefer inner .git over outer bare' '
95 mv foo/.git foo.git &&