Skip to content

Commit efefac4

Browse files
committed
gix rev parse uses ISO8601 time format.
1 parent 535e967 commit efefac4

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gitoxide-core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ git-transport-configuration-only = { package = "git-transport", version = "^0.20
4242
git-commitgraph = { version = "^0.8.2", path = "../git-commitgraph" }
4343
git-config = { version = "^0.7.1", path = "../git-config" }
4444
git-features = { version = "^0.22.4", path = "../git-features" }
45+
git-date = { version = "^0.1.0", path = "../git-date" }
4546
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] }
4647
anyhow = "1.0.42"
4748
thiserror = "1.0.34"

gitoxide-core/src/repository/revision/explain.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,13 @@ impl<'a> delegate::Revision for Explain<'a> {
9494
ReflogLookup::Entry(no) => {
9595
writeln!(self.out, "Find entry {} in reflog of '{}' reference", no, ref_name).ok()
9696
}
97-
ReflogLookup::Date(time) => {
98-
let mut buf = Vec::new();
99-
time.write_to(&mut buf).ok()?;
100-
writeln!(
101-
self.out,
102-
"Find entry closest to time {} in reflog of '{}' reference",
103-
buf.as_bstr(),
104-
ref_name
105-
)
106-
.ok()
107-
}
97+
ReflogLookup::Date(time) => writeln!(
98+
self.out,
99+
"Find entry closest to time {} in reflog of '{}' reference",
100+
time.format(git_date::time::format::ISO8601),
101+
ref_name
102+
)
103+
.ok(),
108104
}
109105
}
110106

0 commit comments

Comments
 (0)