diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-10 11:40:42 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-10 11:54:38 +1000 |
commit | e42e7e5cbd9d075ee24ae8f91ba9e12bdd42fafc (patch) | |
tree | 61d65a544c056b3bf0384cf6954b81b292eb4b07 /pkg/commands/config.go | |
parent | 93fac1f3124f87009091230f61cc13b5e5473cb5 (diff) |
fix commit amend
Diffstat (limited to 'pkg/commands/config.go')
-rw-r--r-- | pkg/commands/config.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/commands/config.go b/pkg/commands/config.go index 0bb310e6d..9600c3403 100644 --- a/pkg/commands/config.go +++ b/pkg/commands/config.go @@ -46,3 +46,17 @@ func (c *GitCommand) GetConfigValue(key string) string { output, _ := c.getGitConfigValue(key) return output } + +// UsingGpg tells us whether the user has gpg enabled so that we can know +// whether we need to run a subprocess to allow them to enter their password +func (c *GitCommand) UsingGpg() bool { + overrideGpg := c.Config.GetUserConfig().Git.OverrideGpg + if overrideGpg { + return false + } + + gpgsign := c.GetConfigValue("commit.gpgsign") + value := strings.ToLower(gpgsign) + + return value == "true" || value == "1" || value == "yes" || value == "on" +} |