Skip to content

Commit 97d1058

Browse files
committed
+disableBranchWithChanges setting to reenable old branch ops behavior
1 parent 445e890 commit 97d1058

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

schema/plugin.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
"title": "History count",
1111
"description": "Number of (most recent) commits shown in the history log",
1212
"default": 25
13+
},
14+
"disableBranchWithChanges": {
15+
"type": "boolean",
16+
"title": "Disable branch with changes",
17+
"description": "Disable all branch operations (new, switch) when there are changed/staged files",
18+
"default": false
1319
}
1420
}
1521
}

src/components/GitPanel.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,12 @@ export class GitPanel extends React.Component<
210210
upstreamBranch={this.state.upstreamBranch}
211211
stagedFiles={this.state.stagedFiles}
212212
data={this.state.branches}
213-
disabled={this.state.pastCommits.length === 0}
213+
disabled={
214+
this.state.pastCommits.length === 0 ||
215+
(this.props.settings.composite[
216+
'disableBranchWithChanges'
217+
] as boolean)
218+
}
214219
toggleSidebar={this.toggleSidebar}
215220
sideBarExpanded={this.state.isHistoryVisible}
216221
/>

0 commit comments

Comments
 (0)