Skip to content

Commit 494a089

Browse files
committed
Fix deleting another branch whan main branch is checked out
1 parent 97d29f8 commit 494a089

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

app/src/lib/stores/app-store.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5281,10 +5281,9 @@ export class AppStore extends TypedBaseStore<IAppState> {
52815281
// we need to switch to a different branch (default or recent).
52825282
const branchToCheckout =
52835283
toCheckout ?? this.getBranchToCheckoutAfterDelete(branch, repository)
5284-
const deletingMainBranch =
5285-
branchToCheckout === null || branchToCheckout.ref === branch.ref
5286-
5287-
if (deletingMainBranch) {
5284+
if (branchToCheckout === null) {
5285+
// No checkout needed
5286+
} else if (branchToCheckout.ref === branch.ref) {
52885287
this._showPopup({
52895288
type: PopupType.CantDeleteMainBranch,
52905289
repository,

0 commit comments

Comments
 (0)