]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9151-svn-mergeinfo.sh
hashmap: use *_entry APIs for iteration
[thirdparty/git.git] / t / t9151-svn-mergeinfo.sh
CommitLineData
dff589ef
SV
1#!/bin/sh
2#
3# Copyright (c) 2007, 2009 Sam Vilain
4#
5
6test_description='git-svn svn mergeinfo properties'
7
8. ./lib-git-svn.sh
9
10test_expect_success 'load svn dump' "
15c6bf0d
JK
11 svnadmin load -q '$rawsvnrepo' \
12 < '$TEST_DIRECTORY/t9151/svn-mergeinfo.dump' &&
dff589ef 13 git svn init --minimize-url -R svnmerge \
95109f29 14 --rewrite-root=http://svn.example.org \
dff589ef
SV
15 -T trunk -b branches '$svnrepo' &&
16 git svn fetch --all
17 "
18
7a955a53 19test_expect_success 'all svn merges became git merge commits' '
1d144aa2 20 unmarked=$(git rev-list --parents --all --grep=Merge |
a48fcd83 21 grep -v " .* " | cut -f1 -d" ") &&
1d144aa2
SV
22 [ -z "$unmarked" ]
23 '
753dc384 24
7a955a53 25test_expect_success 'cherry picks did not become git merge commits' '
1d144aa2 26 bad_cherries=$(git rev-list --parents --all --grep=Cherry |
a48fcd83 27 grep " .* " | cut -f1 -d" ") &&
1d144aa2
SV
28 [ -z "$bad_cherries" ]
29 '
30
31test_expect_success 'svn non-merge merge commits did not become git merge commits' '
32 bad_non_merges=$(git rev-list --parents --all --grep=non-merge |
a48fcd83 33 grep " .* " | cut -f1 -d" ") &&
1d144aa2
SV
34 [ -z "$bad_non_merges" ]
35 '
36
6a2009e7 37test_expect_success 'commit made to merged branch is reachable from the merge' '
a48fcd83
JN
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 not_reachable=$(git rev-list -1 $before_commit --not $merge_commit) &&
9560808f
TS
41 [ -z "$not_reachable" ]
42 '
43
44test_expect_success 'merging two branches in one commit is detected correctly' '
a48fcd83
JN
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 not_reachable=$(git rev-list -1 $f1_commit $f2_commit --not $merge_commit) &&
9560808f
TS
49 [ -z "$not_reachable" ]
50 '
51
c79f1189 52test_expect_failure 'everything got merged in the end' '
a48fcd83 53 unmerged=$(git rev-list --all --not master) &&
1d144aa2
SV
54 [ -z "$unmerged" ]
55 '
dff589ef
SV
56
57test_done