3 # Copyright (c) 2007 Nguyễn Thái Ngọc Duy
6 test_description='Test repository version check'
11 diff --git a/test.txt b/test.txt
19 test_create_repo "test"
20 test_create_repo "test2"
22 GIT_CONFIG=test2/.git/config git config core.repositoryformatversion 99 || exit 1
24 test_expect_success 'gitdir selection on normal repos' '
25 (test "$(git config core.repositoryformatversion)" = 0 &&
27 test "$(git config core.repositoryformatversion)" = 0)'
29 # Make sure it would stop at test2, not trash
30 test_expect_success 'gitdir selection on unsupported repo' '
32 test "$(git config core.repositoryformatversion)" = 99)'
34 test_expect_success 'gitdir not required mode' '
35 (git apply --stat test.patch &&
36 cd test && git apply --stat ../test.patch &&
37 cd ../test2 && git apply --stat ../test.patch)'
39 test_expect_success 'gitdir required mode on normal repos' '
40 (git apply --check --index test.patch &&
41 cd test && git apply --check --index ../test.patch)'
43 test_expect_failure 'gitdir required mode on unsupported repo' '
44 (cd test2 && git apply --check --index ../test.patch)'