Skip to content

Commit 5b44b90

Browse files
Remove arbitrary iteration limit (#745)
The limit of 10000 could be reached for very long histories and produce false failure conditions. Given that all git DAGs contain a finite number of commits the loop should always terminate anyway. Change-Id: for2loop
1 parent 20b2447 commit 5b44b90

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/filter/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ pub fn apply_to_commit(
228228
transaction: &cache::Transaction,
229229
) -> JoshResult<git2::Oid> {
230230
let filter = opt::optimize(filter);
231-
for _ in 0..10000 {
231+
loop {
232232
let filtered = apply_to_commit2(&to_op(filter), commit, transaction)?;
233233

234234
if let Some(id) = filtered {
@@ -239,8 +239,6 @@ pub fn apply_to_commit(
239239
history::walk2(f, i, transaction)?;
240240
}
241241
}
242-
243-
Err(josh_error("apply_to_commit did not finish"))
244242
}
245243

246244
pub fn apply_to_commit3(

0 commit comments

Comments
 (0)