Fix branch names with slashes truncated in GetRemoteBranches#3717
Merged
Fix branch names with slashes truncated in GetRemoteBranches#3717
Conversation
Copilot
AI
changed the title
[WIP] Fix repository branches API parsing for branches with /
Fix branch names with slashes truncated in GetRemoteBranches
Mar 23, 2026
fiftin
approved these changes
Mar 24, 2026
fiftin
added a commit
that referenced
this pull request
Mar 24, 2026
* Initial plan * Fix branch name parsing for branches containing slashes Co-authored-by: fiftin <[email protected]> Agent-Logs-Url: https://github.com/semaphoreui/semaphore/sessions/0eca8209-542b-47bb-8f3f-443080c78d6e --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: fiftin <[email protected]>
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.
getRepositoryBranchNameswas extracting branch names by splitting on the last/, causing branches likeenv/testto be returned astest. The fix strips therefs/heads/prefix instead, preserving embedded slashes.Changes
db_lib/CmdGitClient.go: Replacestrings.LastIndex(refPath, "/")withstrings.HasPrefix+strings.TrimPrefix("refs/heads/"). Also addsstrings.TrimSpaceon the ref path to handle trailing whitespace.db_lib/CmdGitClient_test.go: New test file covering simple branches, branches with slashes, non-heads refs, and edge cases.Original prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.