-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Fix #1939 - Show tag name instead of commit in GitStatusbar #12584
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
Conversation
Hi @Krzysztof-Cieslak, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
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 functionality should be done in model.getPS1()
, not outside of it.
@@ -100,14 +100,17 @@ export class GitStatusbarItem implements IStatusbarItem { | |||
|
|||
private onGitServiceChange(): void { | |||
const model = this.gitService.getModel(); | |||
const ps1 = model.getPS1(); | |||
const tags = model.getRefs().filter(iref => iref.commit.substr(0,8) === ps1); |
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.
You should use model.getHEAD().commit
to compare with iref.commit
.
@@ -100,14 +100,17 @@ export class GitStatusbarItem implements IStatusbarItem { | |||
|
|||
private onGitServiceChange(): void { | |||
const model = this.gitService.getModel(); | |||
const ps1 = model.getPS1(); | |||
const tags = model.getRefs().filter(iref => iref.commit.substr(0,8) === ps1); | |||
const name = tags.length > 0 ? tags[0].name : model.getPS1(); |
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 breaks the +*!
symbols in front of branches, since whenever a branch is checked out, model.getPS1
is never called.
@joaomoreno: Fixed. |
@joaomoreno: Any idea about CI errors? Error messages are really ... unhelpful. And it builds fine on My Machine™️ |
Hi @Krzysztof-Cieslak, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
Thanks! |
If there exist tag with same
ps1
as checkout commit show tag name, otherwise useps1
as beforeCC @joaomoreno, issue #1939