Skip to content

Commit 3adcb4b

Browse files
author
Stephan Dilly
committed
turning time slow sorted revlog off again
1 parent 869e4b7 commit 3adcb4b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

asyncgit/src/sync/logwalker.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::CommitId;
22
use crate::error::Result;
3-
use git2::{Repository, Revwalk, Sort};
3+
use git2::{Repository, Revwalk};
44

55
///
66
pub enum Mode {
@@ -43,14 +43,14 @@ impl<'a> LogWalker<'a> {
4343
if self.revwalk.is_none() {
4444
let mut walk = self.repo.revwalk()?;
4545

46+
// note: setting a sorting sifnificantly slows down big revwalks
47+
4648
if matches!(self.mode, Mode::HeadOnly) {
4749
walk.push_head()?;
4850
} else {
4951
walk.push_glob("*")?;
5052
}
5153

52-
walk.set_sorting(Sort::TIME)?;
53-
5454
self.revwalk = Some(walk);
5555
}
5656

@@ -185,11 +185,11 @@ mod tests {
185185
);
186186

187187
let items = walk_all_commits(&repo);
188-
assert_eq!(items, vec![c3, c2, c1]);
188+
assert_eq!(items, vec![c2, c3, c1]);
189189

190190
checkout_branch(&repo_path, &b1).unwrap();
191191

192192
let items = walk_all_commits(&repo);
193-
assert_eq!(items, vec![c3, c2, c1]);
193+
assert_eq!(items, vec![c2, c3, c1]);
194194
}
195195
}

0 commit comments

Comments
 (0)