@@ -39,7 +39,7 @@ func alphabeticSortCommits(commits []*object.Commit) {
39
39
40
40
The following tests consider this history having two root commits: V and W
41
41
42
- V---o---M----AB----A---CD1--R ---C--------S-------------------Q < master
42
+ V---o---M----AB----A---CD1--P ---C--------S-------------------Q < master
43
43
\ \ / / /
44
44
\ X GQ1---G < feature /
45
45
\ / \ / / /
@@ -57,14 +57,16 @@ passed merge-base
57
57
58
58
Independents
59
59
----------------------------
60
- candidates result
61
- A A Only one commit returns it
62
- A, A, A A Repeated commits are ignored
63
- A, A, M, M, N A, N M is reachable from A, no it is not independent
64
- CD1, CD2, M, N CD1, CD2 M and N are reachable from CD2, so they're not
65
- C, G, dev, M, N C, G, dev M and N are reachable from G, so they're not
66
- A, A^, A, N, N^ A, N A^ and N^ are rechable from A and N
67
-
60
+ candidates result
61
+ A A Only one commit returns it
62
+ A, A, A A Repeated commits are ignored
63
+ A, A, M, M, N A, N M is reachable from A, so it is not independent
64
+ S, G, P S, G P is reachable from S, so it is not independent
65
+ CD1, CD2, M, N CD1, CD2 M and N are reachable from CD2, so they're not
66
+ C, G, dev, M, N C, G, dev M and N are reachable from G, so they're not
67
+ C, D, M, N C, D M and N are reachable from C, so they're not
68
+ A, A^, A, N, N^ A, N A^ and N^ are rechable from A and N
69
+ A^^^, A^, A^^, A, N A, N A^^^, A^^ and A^ are rechable from A, so they're not
68
70
69
71
IsAncestor
70
72
----------------------------
@@ -246,14 +248,22 @@ func (s *orphansSuite) TestIndependentAcrossCrossMerges(c *C) {
246
248
s .AssertIndependents (c , revs , expectedRevs )
247
249
}
248
250
249
- // TestIndependentChangingOrder validates that Independents works well
251
+ // TestIndependentChangingOrderRepetition validates that Independents works well
250
252
// when the order and repetition is tricky (A, A^, A, N, N^ -> A, N)
251
- func (s * orphansSuite ) TestIndependentChangingOrder (c * C ) {
253
+ func (s * orphansSuite ) TestIndependentChangingOrderRepetition (c * C ) {
252
254
revs := []string {"A" , "A^" , "A" , "N" , "N^" }
253
255
expectedRevs := []string {"A" , "N" }
254
256
s .AssertIndependents (c , revs , expectedRevs )
255
257
}
256
258
259
+ // TestIndependentChangingOrder validates that Independents works well
260
+ // when the order is tricky (A^^^, A^, A^^, A, N -> A, N)
261
+ func (s * orphansSuite ) TestIndependentChangingOrder (c * C ) {
262
+ revs := []string {"A^^^" , "A^" , "A^^" , "A" , "N" }
263
+ expectedRevs := []string {"A" , "N" }
264
+ s .AssertIndependents (c , revs , expectedRevs )
265
+ }
266
+
257
267
// TestAncestor validates that IsAncestor returns true if walking from first
258
268
// commit, through its parents, it can be reached the second ( A^^, A -> true )
259
269
func (s * orphansSuite ) TestAncestor (c * C ) {
0 commit comments