Skip to content

Commit e36fa10

Browse files
committed
feat: use jiff
Introduce jiff and use it to replace time in one simple case. This is preparation for updating to gix 0.66, where time has been replaced by jiff.
1 parent f826271 commit e36fa10

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stgit"
33
version = "2.4.10"
44
description = "Stack-based patch management for Git"
55
edition = "2021"
6-
rust-version = "1.67.1"
6+
rust-version = "1.70"
77
authors = [
88
"Catalin Marinas <[email protected]>",
99
"Peter Grayson <[email protected]>",
@@ -40,6 +40,7 @@ flate2 = "1"
4040
gix = { version = "0.64", default-features = false, features = ["command", "revision"] }
4141
indexmap = "2.1"
4242
is-terminal = "0.4"
43+
jiff = "0.1.10"
4344
serde = { version = "1.0", features = ["derive"] }
4445
serde_json = "1.0"
4546
strsim = "0.11"

src/cmd/branch/clone.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ pub(super) fn dispatch(repo: &gix::Repository, matches: &ArgMatches) -> Result<(
4545
let new_branchname = if let Some(name) = matches.get_one::<PartialRefName>("new-branch") {
4646
name
4747
} else {
48-
let suffix = gix::date::Time::now_local_or_utc().format(time::macros::format_description!(
49-
"[year][month][day]-[hour][minute][second]"
50-
));
48+
let suffix = jiff::Zoned::now().strftime("%Y%m%d-%H%M%S");
5149
generated_branchname = PartialRefName::from_str(&format!("{current_branchname}-{suffix}"))
5250
.expect("valid partial reference name");
5351
&generated_branchname

0 commit comments

Comments
 (0)