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(git): use branch --show-current to get current branch #1597

Conversation

EstebanBorai
Copy link
Member

Description

Updates the git command used to get the current branch from:

git rev-parse --abbrev-ref HEAD

To be:

git branch --show-current

git branch --show-current is available since Git 2.22 which was released Mid 2019
(official release notes https://public-inbox.org/git/xmqq36klozfu.fsf@gitster-ct.c.googlers.com/).

macOS Ventura uses git version 2.39.3 so this should be safe for users from Ventura and up.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Screenshot 2024-03-02 at 1 12 55 PM

Copy link
Member

@activcoding activcoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Just a quick heads-up, we should prioritise adding tests for Git to catch bugs earlier. But for now, let's stay focused on the editor

Copy link
Collaborator

@thecoolwinter thecoolwinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thecoolwinter thecoolwinter merged commit 7c36e56 into CodeEditApp:main Mar 2, 2024
2 checks passed
@EstebanBorai EstebanBorai deleted the 1594-git-ambiguous-argument-head branch March 2, 2024 17:48
FastestMolasses pushed a commit to Angelk90/CodeEdit that referenced this pull request Apr 11, 2024
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: "ambiguous argument HEAD"
3 participants