From d7e733cd5603b2e1d93680c72b7960a133235edf Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 15 Nov 2025 14:48:04 +0100 Subject: [PATCH] Remove now unnecessary check for empty string As of the previous commit, branchName can no longer be empty, so no need to handle this. --- pkg/gui/controllers/helpers/worktree_helper.go | 4 ---- pkg/i18n/english.go | 2 -- 2 files changed, 6 deletions(-) diff --git a/pkg/gui/controllers/helpers/worktree_helper.go b/pkg/gui/controllers/helpers/worktree_helper.go index 39ffadbdc..671743fe6 100644 --- a/pkg/gui/controllers/helpers/worktree_helper.go +++ b/pkg/gui/controllers/helpers/worktree_helper.go @@ -140,10 +140,6 @@ func (self *WorktreeHelper) NewWorktreeCheckout(base string, canCheckoutBase boo self.c.Prompt(types.PromptOpts{ Title: self.c.Tr.NewBranchName, HandleConfirm: func(branchName string) error { - if branchName == "" { - return errors.New(self.c.Tr.BranchNameCannotBeBlank) - } - opts.Branch = branchName return f() diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index 794f58570..c9ca03275 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -862,7 +862,6 @@ type TranslationSet struct { NewWorktreePath string NewWorktreeBase string RemoveWorktreeTooltip string - BranchNameCannotBeBlank string NewBranchName string NewBranchNameLeaveBlank string ViewWorktreeOptions string @@ -1956,7 +1955,6 @@ func EnglishTranslationSet() *TranslationSet { NewWorktreePath: "New worktree path", NewWorktreeBase: "New worktree base ref", RemoveWorktreeTooltip: "Remove the selected worktree. This will both delete the worktree's directory, as well as metadata about the worktree in the .git directory.", - BranchNameCannotBeBlank: "Branch name cannot be blank", NewBranchName: "New branch name", NewBranchNameLeaveBlank: "New branch name (leave blank to checkout {{.default}})", ViewWorktreeOptions: "View worktree options",