Fix Bitbucket branch and commit URLs - #237
Open
uvw wants to merge 1 commit into
Open
Conversation
uvw
marked this pull request as ready for review
September 4, 2026 01:59
Bitbucket Cloud needs different paths than the shared defaults: - Commits live at /commits/<sha>, not /commit/<sha> (the singular 404s). - /src/<ref> 404s when the branch name contains a slash (e.g. release/9.12.x), because Bitbucket reads the first path segment as the ref. Browse via /src/HEAD/?at=<ref> with the slash percent-encoded; plain refs keep the simpler /src/<ref>. Both changes are scoped to bitbucket.org, so GitHub, CodeCommit, and Bitbucket Server are unaffected. Adds bats coverage for the commit URL and the slash-branch source view.
uvw
force-pushed
the
fix/bitbucket-branch-and-commit-urls
branch
from
September 4, 2026 02:14
6819324 to
7b34795
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On bitbucket.org,
git openproduced wrong URLs for commits and for branches whose name contains a slash./commit/<sha>(404)/commits/<sha>/src/release/9.12.x(404)/src/HEAD/?at=release%2F9.12.x/src/<ref>/src/<ref>(unchanged)Why the slash-branch fix looks the way it does
/src/<ref>404s when the branch name has a slash, because Bitbucket reads the first path segment (release) as the ref and9.12.xas a file path. Bitbucket disambiguates via the?at=<ref>query param with a valid commit-ish in the path.HEADworks as a repo-agnostic placeholder, so no commit SHA lookup is needed.Verified live against
atlassian/aui(the page header readssource:release/9.12.x). Plain refs keep the simpler/src/<ref>.Examples
Commit:
https://bitbucket.org/atlassian/aui/commits/c0635692ee698f24bd909427a2ae3575915f466ehttps://bitbucket.org/atlassian/aui/commit/c0635692ee698f24bd909427a2ae3575915f466eSlash branch:
https://bitbucket.org/atlassian/aui/src/HEAD/?at=release%2F9.12.xhttps://bitbucket.org/atlassian/aui/src/release/9.12.xScope
Both changes are gated on
$domain == 'bitbucket.org', so GitHub, AWS CodeCommit,Bitbucket Server (
/scm/,/browse?at=), and every other forge are unaffected.Tests
bats test/passes. Adds coverage for the Bitbucket commit URL and theslash-branch source view; the existing plain-branch and tag cases are unchanged.