Skip to content

fix: use rev-parse instead of branch --show-current for older git compat#303

Merged
saschabratton merged 2 commits into
masterfrom
git-compat
Apr 10, 2026
Merged

fix: use rev-parse instead of branch --show-current for older git compat#303
saschabratton merged 2 commits into
masterfrom
git-compat

Conversation

@saschabratton
Copy link
Copy Markdown
Collaborator

@saschabratton saschabratton commented Mar 15, 2026

Current use of git branch --show-current requires git 2.22+.
Using git rev-parse --abbrev-ref HEAD works on much older git versions.

Added a !== 'HEAD' guard to preserve the existing fallback behavior on detached HEAD.

Fixes #88

@saschabratton saschabratton merged commit f3ceefd into master Apr 10, 2026
7 checks passed
@saschabratton saschabratton deleted the git-compat branch April 10, 2026 21:44
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.

git branch error: unknown option show-current

1 participant