]> git.ipfire.org Git - thirdparty/git.git/blob - t/t9151-svn-mergeinfo.sh
Merge branch 'ab/tests-various-fixup'
[thirdparty/git.git] / t / t9151-svn-mergeinfo.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2007, 2009 Sam Vilain
4 #
5
6 test_description='git-svn svn mergeinfo properties'
7
8 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
9 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10
11 . ./lib-git-svn.sh
12
13 test_expect_success 'load svn dump' "
14 svnadmin load -q '$rawsvnrepo' \
15 <'$TEST_DIRECTORY/t9151/svn-mergeinfo.dump' &&
16 git svn init --minimize-url -R svnmerge \
17 --rewrite-root=http://svn.example.org \
18 -T trunk -b branches '$svnrepo' &&
19 git svn fetch --all
20 "
21
22 test_expect_success 'all svn merges became git merge commits' '
23 git rev-list --all --no-merges --grep=Merge >unmarked &&
24 test_must_be_empty unmarked
25 '
26
27 test_expect_success 'cherry picks did not become git merge commits' '
28 git rev-list --all --merges --grep=Cherry >bad-cherries &&
29 test_must_be_empty bad-cherries
30 '
31
32 test_expect_success 'svn non-merge merge commits did not become git merge commits' '
33 git rev-list --all --merges --grep=non-merge >bad-non-merges &&
34 test_must_be_empty bad-non-merges
35 '
36
37 test_expect_success 'commit made to merged branch is reachable from the merge' '
38 before_commit=$(git rev-list --all --grep="trunk commit before merging trunk to b2") &&
39 merge_commit=$(git rev-list --all --grep="Merge trunk to b2") &&
40 git rev-list -1 $before_commit --not $merge_commit >not-reachable &&
41 test_must_be_empty not-reachable
42 '
43
44 test_expect_success 'merging two branches in one commit is detected correctly' '
45 f1_commit=$(git rev-list --all --grep="make f1 branch from trunk") &&
46 f2_commit=$(git rev-list --all --grep="make f2 branch from trunk") &&
47 merge_commit=$(git rev-list --all --grep="Merge f1 and f2 to trunk") &&
48 git rev-list -1 $f1_commit $f2_commit --not $merge_commit >not-reachable &&
49 test_must_be_empty not-reachable
50 '
51
52 test_expect_failure 'everything got merged in the end' '
53 git rev-list --all --not main >unmerged &&
54 test_must_be_empty unmerged
55 '
56
57 test_done