{{ message }}
fix: handle slashes in default branch names for code-mappings#1088
Merged
Conversation
inferDefaultBranch() used split('/').at(-1) which truncated branch
names containing slashes (e.g., 'release/2.0' → '2.0'). Use
prefix-based slicing instead to preserve the full branch name.
Contributor
|
Contributor
Codecov Results 📊❌ Patch coverage is 0.00%. Project has 5022 uncovered lines. Files with missing lines (1)Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 81.13% 81.16% +0.03%
==========================================
Files 383 383 —
Lines 26671 26659 -12
Branches 17340 17338 -2
==========================================
+ Hits 21640 21637 -3
- Misses 5031 5022 -9
- Partials 1797 1799 +2Generated by Codecov Action |
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.

Summary
Follow-up to #1087 — fixes a warden bot finding where
inferDefaultBranch()truncated branch names containing slashes.Bug
inferDefaultBranch()usedoutput.split('/').at(-1)to extract the branch name from a git symbolic-ref output likerefs/remotes/origin/main. This broke for branches with slashes:refs/remotes/origin/mainmainmainrefs/remotes/origin/release/2.0release/2.02.0Fix
Use prefix-based slicing: strip the known
refs/remotes/{remote}/prefix, preserving the full branch name regardless of slashes.