Skip to content

Commit 5871fb1

Browse files
committed
Merge branch 'ag/jiff'
2 parents ca5de4a + 9fd1090 commit 5871fb1

File tree

30 files changed

+576
-494
lines changed

30 files changed

+576
-494
lines changed

.github/workflows/msrv.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ jobs:
1919
- ubuntu-latest
2020
runs-on: ${{ matrix.os }}
2121
env:
22-
# dictated by `firefox` to support the `helix` editor, but now driven by the `time` crate. IMPORTANT: adjust etc/msrv-badge.svg as well
23-
rust_version: 1.67.0
22+
# dictated by `firefox` to support the `helix` editor, but now probably effectively be controlled by `jiff`, which also aligns with `regex`.
23+
# IMPORTANT: adjust etc/msrv-badge.svg as well
24+
rust_version: 1.70.0
2425
steps:
2526
- uses: actions/checkout@v4
2627
- uses: extractions/setup-just@v2

Cargo.lock

+45-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,12 @@ http-client-reqwest = ["gix/blocking-http-transport-reqwest-rust-tls"]
164164
## Use async client networking.
165165
gitoxide-core-async-client = ["gitoxide-core/async-client", "futures-lite"]
166166

167-
168167
[dependencies]
169168
anyhow = "1.0.42"
170169

171170
gitoxide-core = { version = "^0.39.1", path = "gitoxide-core" }
172171
gix-features = { version = "^0.38.2", path = "gix-features" }
173172
gix = { version = "^0.64.0", path = "gix", default-features = false }
174-
time = "0.3.23"
175173

176174
clap = { version = "4.1.1", features = ["derive", "cargo"] }
177175
clap_complete = "4.4.3"

etc/msrv-badge.svg

+21-1
Loading

gix-actor/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ doctest = false
1818
serde = ["dep:serde", "bstr/serde", "gix-date/serde"]
1919

2020
[dependencies]
21-
gix-date = { version = "^0.8.7", path = "../gix-date" }
21+
gix-date = { version = "^0.9.0", path = "../gix-date" }
2222
gix-utils = { version = "^0.1.11", path = "../gix-utils" }
2323

2424
thiserror = "1.0.38"

gix-archive/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ tar = ["dep:tar", "dep:gix-path"]
2121
tar_gz = ["tar", "dep:flate2"]
2222

2323
## Enable the `zip` archive format.
24-
zip = ["dep:zip", "dep:time"]
24+
zip = ["dep:zip"]
2525

2626

2727
[dependencies]
2828
gix-worktree-stream = { version = "^0.13.1", path = "../gix-worktree-stream" }
2929
gix-object = { version = "^0.42.3", path = "../gix-object" }
3030
gix-path = { version = "^0.10.9", path = "../gix-path", optional = true }
31-
gix-date = { version = "^0.8.7", path = "../gix-date" }
31+
gix-date = { version = "^0.9.0", path = "../gix-date" }
3232

3333
flate2 = { version = "1.0.26", optional = true }
34-
zip = { version = "2.1.0", optional = true, default-features = false, features = ["deflate", "time"] }
35-
time = { version = "0.3.23", optional = true, default-features = false, features = ["std"] }
34+
zip = { version = "2.1.0", optional = true, default-features = false, features = ["deflate"] }
35+
jiff = { version = "0.1.2", default-features = false, features = ["std"] }
3636

3737
thiserror = "1.0.26"
3838
bstr = { version = "1.5.0", default-features = false }

gix-archive/src/write.rs

+15-3
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,22 @@ where
134134
{
135135
let mut ar = zip::write::ZipWriter::new(out);
136136
let mut buf = Vec::new();
137-
let mtime = time::OffsetDateTime::from_unix_timestamp(opts.modification_time)
137+
let zdt = jiff::Timestamp::from_second(opts.modification_time)
138138
.map_err(|err| Error::InvalidModificationTime(Box::new(err)))?
139-
.try_into()
140-
.map_err(|err| Error::InvalidModificationTime(Box::new(err)))?;
139+
.to_zoned(jiff::tz::TimeZone::UTC);
140+
let mtime = zip::DateTime::from_date_and_time(
141+
zdt.year()
142+
.try_into()
143+
.map_err(|err| Error::InvalidModificationTime(Box::new(err)))?,
144+
// These are all OK because month, day, hour, minute and second
145+
// are always positive.
146+
zdt.month().try_into().expect("non-negative"),
147+
zdt.day().try_into().expect("non-negative"),
148+
zdt.hour().try_into().expect("non-negative"),
149+
zdt.minute().try_into().expect("non-negative"),
150+
zdt.second().try_into().expect("non-negative"),
151+
)
152+
.map_err(|err| Error::InvalidModificationTime(Box::new(err)))?;
141153
while let Some(entry) = next_entry(stream)? {
142154
append_zip_entry(
143155
&mut ar,

0 commit comments

Comments
 (0)