Skip to content

Commit 1772f88

Browse files
committed
fix: avoid as_ref() call as bstr could break downstream with new impls (#1466)
As `bstr` adds a new implementation of `AsRef`, the `as_ref()` call becomes ambiguous which will then break `gitoxide`. Now `as_ref()` is avoided in favor of a method that can't fail.
1 parent 37c2852 commit 1772f88

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gitoxide-core/src/repository/status.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use anyhow::bail;
2-
use gix::bstr::{BStr, BString};
2+
use gix::bstr::{BStr, BString, ByteSlice};
33
use gix::status::index_worktree::iter::Item;
44
use gix_status::index_as_worktree::{Change, Conflict, EntryStatus};
55
use std::path::Path;
@@ -152,7 +152,7 @@ pub fn show(
152152
source_rela_path =
153153
gix::path::relativize_with_prefix(&gix::path::from_bstr(source.rela_path()), prefix).display(),
154154
dest_rela_path = gix::path::relativize_with_prefix(
155-
&gix::path::from_bstr(dirwalk_entry.rela_path.as_ref()),
155+
&gix::path::from_bstr(dirwalk_entry.rela_path.as_bstr()),
156156
prefix
157157
)
158158
.display(),

gix-credentials/src/program/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl Program {
8080
args.insert_str(0, "credential-");
8181
args.insert_str(0, " ");
8282
args.insert_str(0, git_program.to_string_lossy().as_ref());
83-
gix_command::prepare(gix_path::from_bstr(args.as_ref()).into_owned())
83+
gix_command::prepare(gix_path::from_bstr(args.as_bstr()).into_owned())
8484
.arg(action.as_arg(true))
8585
.with_shell_allow_argument_splitting()
8686
.into()

0 commit comments

Comments
 (0)