Skip to content

Commit 5433b2d

Browse files
committed
fix: Limit commits to 20 when offset and limit are provided
1 parent e66a62b commit 5433b2d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/jz-module/src/repo/file/commit.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ impl AppModule {
2424
let mut commits = git.list_commit(branch)?;
2525
if offset.is_some() && limit.is_some() {
2626
commits.drain(0..offset.unwrap() as usize * limit.unwrap() as usize);
27-
commits.truncate(limit.unwrap_or(100) as usize);
27+
commits.truncate(limit.unwrap_or(20) as usize);
28+
}else {
29+
commits.truncate(20);
2830
}
2931
Ok(commits)
3032
}

0 commit comments

Comments
 (0)