Skip to content

Port to gix 0.86 - #648

Open
tsimonq2 wants to merge 1 commit into
stacked-git:masterfrom
tsimonq2:gix-0.86
Open

Port to gix 0.86#648
tsimonq2 wants to merge 1 commit into
stacked-git:masterfrom
tsimonq2:gix-0.86

Conversation

@tsimonq2

Copy link
Copy Markdown

Bump the gix crate from 0.84 to 0.86 and update call sites for the gix-config 0.59 API that gix 0.86 re-exports. A version-only bump does not compile.

gix::config::File no longer takes a lifetime, so File<'static> and CommitOptions<'_> lose that parameter. Snapshot::string() now returns Option rather than Option<Cow>, so CommitOptions stores BString and for_label() takes s.as_ref().

Snapshot::string_by and boolean_by are gone. Look up dotted keys with string() / boolean() / try_boolean(), which stgit already uses for keys such as branch.{name}.remote. try_boolean() is Result<Option> rather than Option<Result>, so drop the extra transpose() on the autostash lookups.

SectionRef::num_values() moved to BodyRef (section.body().num_values()). value_names() yields String rather than BStr, so skip to_str() and pass the name through to value(). File::rename_section's new subsection is IntoBStringOpt (Option), not Option<Cow>.

Snapshot::trusted_path returns Result<Option, _> instead of an Option that needs transpose(). Hook path construction can use PathBuf directly; editor lookup maps PathBuf with into_os_string().

Bump the gix crate from 0.84 to 0.86 and update call sites for the
gix-config 0.59 API that gix 0.86 re-exports. A version-only bump does
not compile.

gix::config::File no longer takes a lifetime, so File<'static> and
CommitOptions<'_> lose that parameter. Snapshot::string() now returns
Option<BString> rather than Option<Cow<BStr>>, so CommitOptions stores
BString and for_label() takes s.as_ref().

Snapshot::string_by and boolean_by are gone. Look up dotted keys with
string() / boolean() / try_boolean(), which stgit already uses for
keys such as branch.{name}.remote. try_boolean() is Result<Option<bool>>
rather than Option<Result<bool>>, so drop the extra transpose() on the
autostash lookups.

SectionRef::num_values() moved to BodyRef (section.body().num_values()).
value_names() yields String rather than BStr, so skip to_str() and pass
the name through to value(). File::rename_section's new subsection is
IntoBStringOpt (Option<BString>), not Option<Cow<BStr>>.

Snapshot::trusted_path returns Result<Option<PathBuf>, _> instead of an
Option that needs transpose(). Hook path construction can use PathBuf
directly; editor lookup maps PathBuf with into_os_string().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant