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

If repo has detached HEAD ges throws an error #3

Closed
espoelstra opened this issue Jul 12, 2018 · 3 comments
Closed

If repo has detached HEAD ges throws an error #3

espoelstra opened this issue Jul 12, 2018 · 3 comments

Comments

@espoelstra
Copy link
Contributor

fatal: HEAD does not point to a branch
/home/espoelstra/projects/foss/git-extra-status/bin/git-status: 13: [: =: argument expected
/home/espoelstra/projects/foss/git-extra-status/bin/git-status: 15: [: =: argument expected
 [jenkins_wrapper] - HEAD
    ▲ Push Needed``` 

This is easy to replicate in any repository by running `git checkout HEAD~` then running `ges`.
@sandeep1995
Copy link
Owner

Hi @espoelstra,

Thanks for reporting. Do you have any fix for this? Please feel free to send a pull request.

@apm963
Copy link
Contributor

apm963 commented Jul 16, 2018

The easiest way to fix the shell script errors is changing things like:

if [ $LOCAL = $REMOTE ]; then

to

if [ "${LOCAL}" = "${REMOTE}" ]; then

But that still doesn't resolve the fatal: HEAD does not point to a branch.

@apm963
Copy link
Contributor

apm963 commented Jul 16, 2018

I found something on stack overflow that seems to do the trick for detecting a detached HEAD state.

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

No branches or pull requests

3 participants