Fix Git permalinks not being URL-escaped (#39895)
Closes #39875 Release Notes: - Fixed "open/copy permalink to line" paths not being URL-escaped Co-authored-by: Cole Miller <cole@zed.dev>
This commit is contained in:
co-authored by
Cole Miller
parent
2dfde55367
commit
c24f365b69
@@ -969,8 +969,6 @@ impl GitStore {
|
||||
get_permalink_in_rust_registry_src(provider_registry, file_path, selection)
|
||||
.context("no permalink available")
|
||||
});
|
||||
|
||||
// TODO remote case
|
||||
};
|
||||
|
||||
let buffer_id = buffer.read(cx).remote_id();
|
||||
@@ -999,15 +997,9 @@ impl GitStore {
|
||||
parse_git_remote_url(provider_registry, &origin_url)
|
||||
.context("parsing Git remote URL")?;
|
||||
|
||||
let path = repo_path.as_unix_str();
|
||||
|
||||
Ok(provider.build_permalink(
|
||||
remote,
|
||||
BuildPermalinkParams {
|
||||
sha: &sha,
|
||||
path,
|
||||
selection: Some(selection),
|
||||
},
|
||||
BuildPermalinkParams::new(&sha, &repo_path, Some(selection)),
|
||||
))
|
||||
}
|
||||
RepositoryState::Remote { project_id, client } => {
|
||||
@@ -4913,11 +4905,15 @@ fn get_permalink_in_rust_registry_src(
|
||||
let path = PathBuf::from(cargo_vcs_info.path_in_vcs).join(path.strip_prefix(dir).unwrap());
|
||||
let permalink = provider.build_permalink(
|
||||
remote,
|
||||
BuildPermalinkParams {
|
||||
sha: &cargo_vcs_info.git.sha1,
|
||||
path: &path.to_string_lossy(),
|
||||
selection: Some(selection),
|
||||
},
|
||||
BuildPermalinkParams::new(
|
||||
&cargo_vcs_info.git.sha1,
|
||||
&RepoPath(
|
||||
RelPath::new(&path, PathStyle::local())
|
||||
.context("invalid path")?
|
||||
.into_arc(),
|
||||
),
|
||||
Some(selection),
|
||||
),
|
||||
);
|
||||
Ok(permalink)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user