@@ -17,7 +17,6 @@ pub fn is_continuous(
17
17
let repo = repo ( repo_path) ?;
18
18
let mut revwalk = repo. revwalk ( ) ?;
19
19
revwalk. set_sorting ( git2:: Sort :: TOPOLOGICAL ) ?;
20
- revwalk. simplify_first_parent ( ) ?;
21
20
revwalk. push ( commits[ 0 ] . get_oid ( ) ) ?;
22
21
let revwalked: Vec < Oid > =
23
22
revwalk
@@ -90,7 +89,7 @@ mod tests_is_continuous {
90
89
let repo_path: & RepoPath =
91
90
& root. as_os_str ( ) . to_str ( ) . unwrap ( ) . into ( ) ;
92
91
93
- let _c0 = commit ( repo_path, "commit 0" ) . unwrap ( ) ;
92
+ let c0 = commit ( repo_path, "commit 0" ) . unwrap ( ) ;
94
93
let c1 = commit ( repo_path, "commit 1" ) . unwrap ( ) ;
95
94
let c2 = commit ( repo_path, "commit 2" ) . unwrap ( ) ;
96
95
@@ -106,7 +105,13 @@ mod tests_is_continuous {
106
105
"range including merge should not be continuous"
107
106
) ;
108
107
109
- let result = is_continuous ( repo_path, & [ c2, c1] ) . unwrap ( ) ;
108
+ let result = is_continuous ( repo_path, & [ c4, c3, c1] ) . unwrap ( ) ;
109
+ assert ! (
110
+ !result,
111
+ "range including merge should not be continuous (following second parent commit)"
112
+ ) ;
113
+
114
+ let result = is_continuous ( repo_path, & [ c2, c1, c0] ) . unwrap ( ) ;
110
115
assert ! (
111
116
result,
112
117
"linear range before merge should be continuous"
0 commit comments