diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 4eb62a7fd..ecbd702c1 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -280,9 +280,9 @@ func (c *GitCommand) AbortMerge() error { // 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 { - gpgsign, _ := c.getGlobalGitConfig("commit.gpgsign") + gpgsign, _ := c.getLocalGitConfig("commit.gpgsign") if gpgsign == "" { - gpgsign, _ = c.getLocalGitConfig("commit.gpgsign") + gpgsign, _ = c.getGlobalGitConfig("commit.gpgsign") } value := strings.ToLower(gpgsign) diff --git a/pkg/commands/git_test.go b/pkg/commands/git_test.go index 18d90b765..bda3ea225 100644 --- a/pkg/commands/git_test.go +++ b/pkg/commands/git_test.go @@ -735,8 +735,8 @@ func TestGitCommandMerge(t *testing.T) { func TestGitCommandUsingGpg(t *testing.T) { type scenario struct { testName string - getGlobalGitConfig func(string) (string, error) getLocalGitConfig func(string) (string, error) + getGlobalGitConfig func(string) (string, error) test func(bool) }