3 test_description='--ancestry-path'
7 # B---C---G---H---I---J
9 # A-------K---------------L--M
11 # D..M == E F G H I J K L M
12 # --ancestry-path D..M == E F H I J L M
15 # --ancestry-path D..M -- M.t == M
18 # --ancestry-path F...I == F H I
24 git merge -s ours -m "$2" "$1" &&
28 test_expect_success setup '
46 test_expect_success 'rev-list D..M' '
47 for c in E F G H I J K L M; do echo $c; done >expect &&
48 git rev-list --format=%s D..M |
49 sed -e "/^commit /d" |
51 test_cmp expect actual
54 test_expect_success 'rev-list --ancestry-path D..M' '
55 for c in E F H I J L M; do echo $c; done >expect &&
56 git rev-list --ancestry-path --format=%s D..M |
57 sed -e "/^commit /d" |
59 test_cmp expect actual
62 test_expect_success 'rev-list D..M -- M.t' '
64 git rev-list --format=%s D..M -- M.t |
65 sed -e "/^commit /d" >actual &&
66 test_cmp expect actual
69 test_expect_success 'rev-list --ancestry-path D..M -- M.t' '
71 git rev-list --ancestry-path --format=%s D..M -- M.t |
72 sed -e "/^commit /d" >actual &&
73 test_cmp expect actual
76 test_expect_success 'rev-list F...I' '
77 for c in F G H I; do echo $c; done >expect &&
78 git rev-list --format=%s F...I |
79 sed -e "/^commit /d" |
81 test_cmp expect actual
84 test_expect_success 'rev-list --ancestry-path F...I' '
85 for c in F H I; do echo $c; done >expect &&
86 git rev-list --ancestry-path --format=%s F...I |
87 sed -e "/^commit /d" |
89 test_cmp expect actual
98 # All refnames prefixed with 'x' to avoid confusion with the tags
99 # generated by test_commit on case-insensitive systems.
100 test_expect_success 'setup criss-cross' '
105 git checkout -b xb master &&
107 git checkout -b xc master &&
109 git checkout -b xbc xb -- &&
111 git checkout -b xcb xc -- &&
116 # no commits in bc descend from cb
117 test_expect_success 'criss-cross: rev-list --ancestry-path cb..bc' '
119 git rev-list --ancestry-path xcb..xbc > actual &&
120 test -z "$(cat actual)")
123 # no commits in repository descend from cb
124 test_expect_success 'criss-cross: rev-list --ancestry-path --all ^cb' '
126 git rev-list --ancestry-path --all ^xcb > actual &&
127 test -z "$(cat actual)")