Skip to content

Commit

Permalink
Merge branch 'fix-1177'
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Dec 12, 2023
2 parents 20dce42 + 0bc9568 commit 401b73d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions gitoxide-core/src/repository/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ pub(crate) mod function {
let url: gix::Url = url.as_ref().try_into()?;
let directory = directory.map_or_else(
|| {
gix::path::from_bstr(Cow::Borrowed(url.path.as_ref()))
.as_ref()
.file_stem()
.map(Into::into)
.context("Filename extraction failed - path too short")
let path = gix::path::from_bstr(Cow::Borrowed(url.path.as_ref()));
if !bare && path.extension() == Some(OsStr::new("git")) {
path.file_stem().map(Into::into)
} else {
path.file_name().map(Into::into)
}
.context("Filename extraction failed - path too short")
},
|dir| Ok(dir.into()),
)?;
Expand Down

0 comments on commit 401b73d

Please sign in to comment.