-
Notifications
You must be signed in to change notification settings - Fork 323
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 switch from a detached head to a branch not working #1218
Conversation
…ng the fake branch name (HEAD detached at #####) to #####
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great 🚀
I'm actually wondering if we should rather clean the current branch name for consistency and to avoid other troubles.
The branch is set at
Line 1045 in c7e7363
this._currentBranch = data.current_branch; |
Would you mind trying applying your fix there to see if it works?
Yes I'll try moving the fix there instead 👍 I think that's a good call, I believe this will be more clear to the user on what tag they are checking out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @basokant
Do you need help to fix the Jest tests?
…d case can occur when the git repository is checked out at a specific commit that is not a branch head
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing the tests.
Are you ok with expanding this to add a new flag detached
in Git.IBranch
at
https://github.com/jupyterlab/jupyterlab-git/blob/master/src/tokens.ts#L816
And use that flag to tune the branch display at
https://github.com/jupyterlab/jupyterlab-git/blob/master/src/components/Toolbar.tsx#L267
Relocated the translate of the branch toolbar title. Should be ready for a final review @fcollonval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @basokant
Provides fix for #995
If the repository is in detached head (for example after switching to a tag), then switching to a branch will no longer fail. Behaviour after changes:
955-fix.mov
Transforms the fake branch name (HEAD detached at #####) to ##### using Regex.