We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What is the rugged equivalent to listing the current branch (e.g. git rev-parse --abbrev-ref -q HEAD)?
git rev-parse --abbrev-ref -q HEAD
I tried this implementation and it returns a short name repo.head.name.split('/')[-1]. But not sure it is the desired way to do this.
repo.head.name.split('/')[-1]
The text was updated successfully, but these errors were encountered:
A better way would be:
repo.head.name.sub(/^refs\/heads\//, '')
Your version won't work correctly when the ref name has a / in it.
/
Sorry, something went wrong.
@arthurschreiber thank you for the work on rugged and the proper regex.
rugged
No branches or pull requests
What is the rugged equivalent to listing the current branch (e.g.
git rev-parse --abbrev-ref -q HEAD
)?I tried this implementation and it returns a short name
repo.head.name.split('/')[-1]
. But not sure it is the desired way to do this.The text was updated successfully, but these errors were encountered: