Skip to content

Commit 5b0daaa

Browse files
committed
Prevent commit from being logged more than once
1 parent 236f567 commit 5b0daaa

File tree

1 file changed

+6
-1
lines changed
  • gitoxide-core/src/repository

1 file changed

+6
-1
lines changed

gitoxide-core/src/repository/log.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn log_file(repo: gix::Repository, out: &mut dyn std::io::Write, path: BString)
3131
let topo = gix::traverse::commit::topo::Builder::from_iters(&repo.objects, [head.id], None::<Vec<gix::ObjectId>>)
3232
.build()?;
3333

34-
for info in topo {
34+
'outer: for info in topo {
3535
let info = info?;
3636
let commit = repo.find_commit(info.id).unwrap();
3737

@@ -88,6 +88,11 @@ fn log_file(repo: gix::Repository, out: &mut dyn std::io::Write, path: BString)
8888

8989
if !modifications.is_empty() {
9090
write_info(&repo, &mut *out, &info)?;
91+
92+
// We continue because we’ve already determined that this commit is part of the
93+
// file’s history, so there’s no need to compare it to its other parents.
94+
95+
continue 'outer;
9196
}
9297
}
9398
}

0 commit comments

Comments
 (0)