3 test_description
='tg -C used multiple times works properly'
9 GIT_CEILING_DIRECTORIES
="$PWD" && export GIT_CEILING_DIRECTORIES
13 test_expect_success
'test setup' '
14 test_create_repo refs &&
15 test_create_repo heads &&
16 git -C refs config topgit.top-bases refs &&
17 git -C heads config topgit.top-bases heads &&
18 test "$(cd refs && git config topgit.top-bases)" = "refs" &&
19 test "$(cd heads && git config topgit.top-bases)" = "heads" &&
28 test_expect_success
'tg -C gets to refs' '
29 match_str "refs/top-bases" "$(tg -C refs --top-bases)" &&
31 match_str "refs/top-bases" "$(tg -C dir -C .. -C ../refs --top-bases)"
34 test_expect_success
'tg -C gets to heads' '
35 match_str "refs/heads/{top-bases}" "$(tg -C heads --top-bases)" &&
37 match_str "refs/heads/{top-bases}" "$(tg -C dir -C .. -C ../heads --top-bases)"