55package git
66
77import (
8+ "context"
89 "fmt"
910 "strings"
1011
@@ -24,7 +25,7 @@ func (gpgSettings *GPGSettings) LoadPublicKeyContent() error {
2425}
2526
2627// GetDefaultPublicGPGKey will return and cache the default public GPG settings for this repository
27- func (repo * Repository ) GetDefaultPublicGPGKey (forceUpdate bool ) (* GPGSettings , error ) {
28+ func (repo * Repository ) GetDefaultPublicGPGKey (ctx context. Context , forceUpdate bool ) (* GPGSettings , error ) {
2829 if repo .gpgSettings != nil && ! forceUpdate {
2930 return repo .gpgSettings , nil
3031 }
@@ -33,21 +34,21 @@ func (repo *Repository) GetDefaultPublicGPGKey(forceUpdate bool) (*GPGSettings,
3334 Sign : true ,
3435 }
3536
36- value , _ , _ := NewCommand ("config" , "--get" , "commit.gpgsign" ).RunStdString (repo . Ctx , & RunOpts {Dir : repo .Path })
37+ value , _ , _ := NewCommand ("config" , "--get" , "commit.gpgsign" ).RunStdString (ctx , & RunOpts {Dir : repo .Path })
3738 sign , valid := ParseBool (strings .TrimSpace (value ))
3839 if ! sign || ! valid {
3940 gpgSettings .Sign = false
4041 repo .gpgSettings = gpgSettings
4142 return gpgSettings , nil
4243 }
4344
44- signingKey , _ , _ := NewCommand ("config" , "--get" , "user.signingkey" ).RunStdString (repo . Ctx , & RunOpts {Dir : repo .Path })
45+ signingKey , _ , _ := NewCommand ("config" , "--get" , "user.signingkey" ).RunStdString (ctx , & RunOpts {Dir : repo .Path })
4546 gpgSettings .KeyID = strings .TrimSpace (signingKey )
4647
47- defaultEmail , _ , _ := NewCommand ("config" , "--get" , "user.email" ).RunStdString (repo . Ctx , & RunOpts {Dir : repo .Path })
48+ defaultEmail , _ , _ := NewCommand ("config" , "--get" , "user.email" ).RunStdString (ctx , & RunOpts {Dir : repo .Path })
4849 gpgSettings .Email = strings .TrimSpace (defaultEmail )
4950
50- defaultName , _ , _ := NewCommand ("config" , "--get" , "user.name" ).RunStdString (repo . Ctx , & RunOpts {Dir : repo .Path })
51+ defaultName , _ , _ := NewCommand ("config" , "--get" , "user.name" ).RunStdString (ctx , & RunOpts {Dir : repo .Path })
5152 gpgSettings .Name = strings .TrimSpace (defaultName )
5253
5354 if err := gpgSettings .LoadPublicKeyContent (); err != nil {
0 commit comments