setup: merge configuration of repository formats
[git/gitster.git] / t / t9601-cvsimport-vendor-branch.sh
blobe00766949573cf2f3e11b8b0e62378a14733aef2
1 #!/bin/sh
3 # Description of the files in the repository:
5 # imported-once.txt:
7 # Imported once. 1.1 and 1.1.1.1 should be identical.
9 # imported-twice.txt:
11 # Imported twice. HEAD should reflect the contents of the
12 # second import (i.e., have the same contents as 1.1.1.2).
14 # imported-modified.txt:
16 # Imported, then modified on HEAD. HEAD should reflect the
17 # modification.
19 # imported-modified-imported.txt:
21 # Imported, then modified on HEAD, then imported again.
23 # added-imported.txt,v:
25 # Added with 'cvs add' to create 1.1, then imported with
26 # completely different contents to create 1.1.1.1, therefore the
27 # vendor branch was never the default branch.
29 # imported-anonymously.txt:
31 # Like imported-twice.txt, but with a vendor branch whose branch
32 # tag has been removed.
34 test_description='git cvsimport handling of vendor branches'
35 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
36 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
38 TEST_PASSES_SANITIZE_LEAK=true
39 . ./lib-cvs.sh
41 setup_cvs_test_repository t9601
43 test_expect_success PERL 'import a module with a vendor branch' '
45 git cvsimport -C module-git module
49 test_expect_success PERL 'check HEAD out of cvs repository' 'test_cvs_co main'
51 test_expect_success PERL 'check main out of git repository' 'test_git_co main'
53 test_expect_success PERL 'check a file that was imported once' '
55 test_cmp_branch_file main imported-once.txt
59 test_expect_failure PERL 'check a file that was imported twice' '
61 test_cmp_branch_file main imported-twice.txt
65 test_expect_success PERL 'check a file that was imported then modified on HEAD' '
67 test_cmp_branch_file main imported-modified.txt
71 test_expect_success PERL 'check a file that was imported, modified, then imported again' '
73 test_cmp_branch_file main imported-modified-imported.txt
77 test_expect_success PERL 'check a file that was added to HEAD then imported' '
79 test_cmp_branch_file main added-imported.txt
83 test_expect_success PERL 'a vendor branch whose tag has been removed' '
85 test_cmp_branch_file main imported-anonymously.txt
89 test_done