summaryrefslogtreecommitdiffstats
path: root/pkg/commands/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/commands/config.go')
-rw-r--r--pkg/commands/config.go14
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"
+}