diff --git a/Cargo.lock b/Cargo.lock index 192999c021b..0f52b153b89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1835,6 +1835,7 @@ dependencies = [ "futures-lite", "git-commitgraph", "git-config", + "git-date", "git-features", "git-pack", "git-repository", diff --git a/gitoxide-core/Cargo.toml b/gitoxide-core/Cargo.toml index bf37b7446fc..f6e87a0efaa 100644 --- a/gitoxide-core/Cargo.toml +++ b/gitoxide-core/Cargo.toml @@ -42,6 +42,7 @@ git-transport-configuration-only = { package = "git-transport", version = "^0.20 git-commitgraph = { version = "^0.8.2", path = "../git-commitgraph" } git-config = { version = "^0.7.1", path = "../git-config" } git-features = { version = "^0.22.4", path = "../git-features" } +git-date = { version = "^0.1.0", path = "../git-date" } serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] } anyhow = "1.0.42" thiserror = "1.0.34" diff --git a/gitoxide-core/src/repository/revision/explain.rs b/gitoxide-core/src/repository/revision/explain.rs index c9d80f0ca0f..0871b795973 100644 --- a/gitoxide-core/src/repository/revision/explain.rs +++ b/gitoxide-core/src/repository/revision/explain.rs @@ -94,17 +94,13 @@ impl<'a> delegate::Revision for Explain<'a> { ReflogLookup::Entry(no) => { writeln!(self.out, "Find entry {} in reflog of '{}' reference", no, ref_name).ok() } - ReflogLookup::Date(time) => { - let mut buf = Vec::new(); - time.write_to(&mut buf).ok()?; - writeln!( - self.out, - "Find entry closest to time {} in reflog of '{}' reference", - buf.as_bstr(), - ref_name - ) - .ok() - } + ReflogLookup::Date(time) => writeln!( + self.out, + "Find entry closest to time {} in reflog of '{}' reference", + time.format(git_date::time::format::ISO8601), + ref_name + ) + .ok(), } }