3 # Copyright (c) 2007 Nguyễn Thái Ngọc Duy
6 test_description='Test repository version check'
10 test_expect_success 'setup' '
11 cat >test.patch <<-\EOF &&
12 diff --git a/test.txt b/test.txt
20 test_create_repo "test" &&
21 test_create_repo "test2" &&
22 git config --file=test2/.git/config core.repositoryformatversion 99
25 test_expect_success 'gitdir selection on normal repos' '
27 git config core.repositoryformatversion >actual &&
30 git config core.repositoryformatversion >../actual2
32 test_cmp expect actual &&
33 test_cmp expect actual2
36 test_expect_success 'gitdir selection on unsupported repo' '
37 # Make sure it would stop at test2, not trash
41 git config core.repositoryformatversion >../actual
43 test_cmp expect actual
46 test_expect_success 'gitdir not required mode' '
47 git apply --stat test.patch &&
50 git apply --stat ../test.patch
54 git apply --stat ../test.patch
58 test_expect_success 'gitdir required mode' '
59 git apply --check --index test.patch &&
62 git apply --check --index ../test.patch
66 test_must_fail git apply --check --index ../test.patch