forked from GitoxideLabs/gitoxide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request GitoxideLabs#1645 from dvtkrlbs/refloglookup-date
feat: handle ReflogLookup::Date
- Loading branch information
Showing
15 changed files
with
1,305 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+107 KB
(260%)
gix-ref/tests/fixtures/generated-archives/make_repo_for_reflog.tar
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,7 +81,7 @@ mod iter { | |
.source() | ||
.expect("source") | ||
.to_string(), | ||
"buffer too small for line size" | ||
"buffer too small for line size, got until \"0000000000000000 134385f6d781b7e97062102c6a483440bfda2a03 committer <[email protected]> 946771200 +0000\\tcommit (initial): c1\"" | ||
); | ||
assert!(iter.next().is_none(), "iterator depleted"); | ||
} | ||
|
@@ -90,9 +90,9 @@ mod iter { | |
} | ||
|
||
mod with_buffer_big_enough_for_largest_line { | ||
use gix_ref::log::Line; | ||
|
||
use crate::file::log::iter::reflog; | ||
use crate::hex_to_id; | ||
use gix_ref::log::Line; | ||
|
||
#[test] | ||
fn single_line() -> crate::Result { | ||
|
@@ -157,6 +157,24 @@ mod iter { | |
} | ||
Ok(()) | ||
} | ||
|
||
#[test] | ||
fn realistic_logs_can_be_read_completely() -> crate::Result { | ||
let log = reflog("refs/heads/old")?; | ||
let mut buf = Vec::with_capacity(16 * 1024); | ||
for size in [2048, 3000, 4096, 8192, 16384] { | ||
buf.resize(size, 0); | ||
let read = std::io::Cursor::new(&*log); | ||
let count = gix_ref::file::log::iter::reverse(read, &mut buf)? | ||
.filter_map(Result::ok) | ||
.count(); | ||
assert_eq!( | ||
count, 581, | ||
"All entries must be readable as long as the buffer can fit a whole line" | ||
); | ||
} | ||
Ok(()) | ||
} | ||
} | ||
} | ||
mod forward { | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.