From a4b55b9924f9d45fd9012d0f2d408cd7c6e8addd Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 29 Mar 2024 13:17:48 -0400 Subject: [PATCH] Fix GitHub commit permalinks (#9961) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR fixes an issue where GitHub commit permalinks were being constructed with the wrong URL segment. This would result in clicking on a commit from the Git blame view taking you to the wrong page on GitHub. ### Before ``` https://github.com/zed-industries/zed/commits/a3d985028ccce085e4f5a06694835cd9b3296dba ``` Screenshot 2024-03-29 at 12 59 51 PM ### After ``` https://github.com/zed-industries/zed/commit/a3d985028ccce085e4f5a06694835cd9b3296dba ``` Screenshot 2024-03-29 at 12 59 56 PM Release Notes: - N/A --- crates/git/src/permalink.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/git/src/permalink.rs b/crates/git/src/permalink.rs index 87603e5773..c69ce2f893 100644 --- a/crates/git/src/permalink.rs +++ b/crates/git/src/permalink.rs @@ -111,7 +111,7 @@ pub(crate) fn build_commit_permalink(params: BuildCommitPermalinkParams) -> Url } = remote; let path = match provider { - GitHostingProvider::Github => format!("{owner}/{repo}/commits/{sha}"), + GitHostingProvider::Github => format!("{owner}/{repo}/commit/{sha}"), GitHostingProvider::Gitlab => format!("{owner}/{repo}/-/commit/{sha}"), GitHostingProvider::Gitee => format!("{owner}/{repo}/commit/{sha}"), GitHostingProvider::Bitbucket => format!("{owner}/{repo}/commits/{sha}"),