Skip to content

Commit 8721042

Browse files
committed
Fixes working/branch toggle incorrectly showing
Adds working/branch toggle before a comparision is selected
1 parent 2c4bbae commit 8721042

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7673,22 +7673,22 @@
76737673
},
76747674
{
76757675
"command": "gitlens.views.setBranchComparisonToWorking",
7676-
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+comparing\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+branch\\b)/",
7676+
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+root\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+branch\\b)/",
76777677
"group": "inline@2"
76787678
},
76797679
{
76807680
"command": "gitlens.views.setBranchComparisonToBranch",
7681-
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+comparing\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+working\\b)/",
7681+
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+root\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+working\\b)/",
76827682
"group": "inline@2"
76837683
},
76847684
{
76857685
"command": "gitlens.views.setBranchComparisonToWorking",
7686-
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+comparing\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+branch\\b)/",
7686+
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+root\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+branch\\b)/",
76877687
"group": "1_gitlens@2"
76887688
},
76897689
{
76907690
"command": "gitlens.views.setBranchComparisonToBranch",
7691-
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+comparing\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+working\\b)/",
7691+
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+root\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+working\\b)/",
76927692
"group": "1_gitlens@2"
76937693
},
76947694
{

src/views/nodes/compareBranchNode.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class CompareBranchNode extends ViewNode<BranchesView | CommitsView | Rep
2929
view: BranchesView | CommitsView | RepositoriesView,
3030
parent: ViewNode,
3131
public readonly branch: GitBranch,
32-
private readonly showComparison: ViewShowBranchComparison,
32+
private showComparison: ViewShowBranchComparison,
3333
// Specifies that the node is shown as a root
3434
public readonly root: boolean = false,
3535
) {
@@ -198,6 +198,8 @@ export class CompareBranchNode extends ViewNode<BranchesView | CommitsView | Rep
198198
async setComparisonType(comparisonType: Exclude<ViewShowBranchComparison, false>) {
199199
if (this._compareWith != null) {
200200
await this.updateCompareWith({ ...this._compareWith, type: comparisonType });
201+
} else {
202+
this.showComparison = comparisonType;
201203
}
202204

203205
this._children = undefined;

0 commit comments

Comments
 (0)