Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pushRemote.branch string extraction #1659

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fsestini
Copy link

The current use of unpack and vim.split to extract the branch name of an upstream ref fails to properly handle branch names containing forward slash (/) symbols. In particular, it discards the branch name's portion including and following the first occurrence of a / symbol.

For example:

  • pushRemote.ref == "origin/branch/name"
  • pushRemote.branch (expected) == "branch/name"
  • pushRemote.branch (actual) == "branch"

UI example:
Screenshot 2025-02-16 at 23 04 38
Screenshot 2025-02-16 at 23 04 28

This PR replaces this usage of unpack and vim.split with a regex match that properly handles branch names containing / symbols.

@fsestini
Copy link
Author

Hopefully the linter is happy now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant