Skip to content

Commit 52da806

Browse files
Chris McDonnellstefanhaller
authored andcommitted
refactor: Rename UsingGpg to make room for Gpg Tag logic
1 parent 67b0db0 commit 52da806

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

pkg/commands/git_commands/config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ func (self *ConfigCommands) GetPager(width int) string {
5757
return utils.ResolvePlaceholderString(pagerTemplate, templateValues)
5858
}
5959

60-
// UsingGpg tells us whether the user has gpg enabled so that we can know
61-
// whether we need to run a subprocess to allow them to enter their password
62-
func (self *ConfigCommands) UsingGpg() bool {
60+
// NeedsGpgSubprocessForCommit tells us whether the user has gpg enabled for commit actions
61+
// and needs a subprocess because they have a process where they manually
62+
// enter their password every time a GPG action is taken
63+
func (self *ConfigCommands) NeedsGpgSubprocessForCommit() bool {
6364
overrideGpg := self.UserConfig().Git.OverrideGpg
6465
if overrideGpg {
6566
return false

pkg/commands/git_commands/patch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (self *PatchCommands) MovePatchToSelectedCommit(commits []*models.Commit, s
150150
// we can make this GPG thing possible it just means we need to do this in two parts:
151151
// one where we handle the possibility of a credential request, and the other
152152
// where we continue the rebase
153-
if self.config.UsingGpg() {
153+
if self.config.NeedsGpgSubprocessForCommit() {
154154
return errors.New(self.Tr.DisabledForGPG)
155155
}
156156

pkg/commands/git_commands/rebase.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func NewRebaseCommands(
3535
}
3636

3737
func (self *RebaseCommands) RewordCommit(commits []*models.Commit, index int, summary string, description string) error {
38-
if self.config.UsingGpg() {
38+
if self.config.NeedsGpgSubprocessForCommit() {
3939
return errors.New(self.Tr.DisabledForGPG)
4040
}
4141

@@ -413,7 +413,7 @@ func (self *RebaseCommands) BeginInteractiveRebaseForCommitRange(
413413
// we can make this GPG thing possible it just means we need to do this in two parts:
414414
// one where we handle the possibility of a credential request, and the other
415415
// where we continue the rebase
416-
if self.config.UsingGpg() {
416+
if self.config.NeedsGpgSubprocessForCommit() {
417417
return errors.New(self.Tr.DisabledForGPG)
418418
}
419419

pkg/gui/controllers/helpers/gpg_helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func NewGpgHelper(c *HelperCommon) *GpgHelper {
2323
// fix this bug, or just stop running subprocesses from within there, given that
2424
// we don't need to see a loading status if we're in a subprocess.
2525
func (self *GpgHelper) WithGpgHandling(cmdObj oscommands.ICmdObj, waitingStatus string, onSuccess func() error) error {
26-
useSubprocess := self.c.Git().Config.UsingGpg()
26+
useSubprocess := self.c.Git().Config.NeedsGpgSubprocessForCommit()
2727
if useSubprocess {
2828
success, err := self.c.RunSubprocess(cmdObj)
2929
if success && onSuccess != nil {

0 commit comments

Comments
 (0)