@@ -16,6 +16,7 @@ pub enum StackEndReason {
1616
1717pub fn working_stack < ' repo > (
1818 repo : & ' repo git2:: Repository ,
19+ no_limit : bool ,
1920 user_provided_base : Option < & str > ,
2021 force_author : bool ,
2122 force_detach : bool ,
@@ -88,7 +89,7 @@ pub fn working_stack<'repo>(
8889 break ;
8990 }
9091
91- if ret. len ( ) == config:: max_stack ( repo) && user_provided_base. is_none ( ) {
92+ if !no_limit && ret. len ( ) == config:: max_stack ( repo) && user_provided_base. is_none ( ) {
9293 debug ! ( logger, "Stopping at stack limit." ;
9394 "limit" => ret. len( ) ) ;
9495 stack_end_reason = Some ( StackEndReason :: ReachedLimit ) ;
@@ -203,7 +204,8 @@ mod tests {
203204 let commits = repo_utils:: empty_commit_chain ( & repo, "HEAD" , & [ ] , 2 ) ;
204205 repo. branch ( "hide" , & commits[ 0 ] , false ) . unwrap ( ) ;
205206
206- let ( stack, reason) = working_stack ( & repo, None , false , false , & empty_slog ( ) ) . unwrap ( ) ;
207+ let ( stack, reason) =
208+ working_stack ( & repo, false , None , false , false , & empty_slog ( ) ) . unwrap ( ) ;
207209 assert_stack_matches_chain ( 1 , & stack, & commits) ;
208210 assert_eq ! ( reason, StackEndReason :: CommitsHiddenByBranches ) ;
209211 }
@@ -216,6 +218,7 @@ mod tests {
216218
217219 let ( stack, reason) = working_stack (
218220 & repo,
221+ false ,
219222 Some ( & commits[ 0 ] . id ( ) . to_string ( ) ) ,
220223 false ,
221224 false ,
@@ -238,7 +241,8 @@ mod tests {
238241 )
239242 . unwrap ( ) ;
240243
241- let ( stack, reason) = working_stack ( & repo, None , false , false , & empty_slog ( ) ) . unwrap ( ) ;
244+ let ( stack, reason) =
245+ working_stack ( & repo, false , None , false , false , & empty_slog ( ) ) . unwrap ( ) ;
242246 assert_stack_matches_chain ( config:: MAX_STACK + 1 , & stack, & commits) ;
243247 assert_eq ! ( reason, StackEndReason :: ReachedLimit ) ;
244248 }
@@ -254,7 +258,8 @@ mod tests {
254258 let new_commits =
255259 repo_utils:: empty_commit_chain ( & repo, "HEAD" , & [ old_commits. last ( ) . unwrap ( ) ] , 2 ) ;
256260
257- let ( stack, reason) = working_stack ( & repo, None , false , false , & empty_slog ( ) ) . unwrap ( ) ;
261+ let ( stack, reason) =
262+ working_stack ( & repo, false , None , false , false , & empty_slog ( ) ) . unwrap ( ) ;
258263 assert_stack_matches_chain ( 2 , & stack, & new_commits) ;
259264 assert_eq ! ( reason, StackEndReason :: ReachedAnotherAuthor ) ;
260265 }
@@ -265,7 +270,8 @@ mod tests {
265270 let merge = repo_utils:: merge_commit ( & repo, & [ ] ) ;
266271 let commits = repo_utils:: empty_commit_chain ( & repo, "HEAD" , & [ & merge] , 2 ) ;
267272
268- let ( stack, reason) = working_stack ( & repo, None , false , false , & empty_slog ( ) ) . unwrap ( ) ;
273+ let ( stack, reason) =
274+ working_stack ( & repo, false , None , false , false , & empty_slog ( ) ) . unwrap ( ) ;
269275 assert_stack_matches_chain ( 2 , & stack, & commits) ;
270276 assert_eq ! ( reason, StackEndReason :: ReachedMergeCommit ) ;
271277 }
0 commit comments