summaryrefslogtreecommitdiffstats
path: root/services/asymkey
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-04-01 10:55:30 +0800
committerGitHub <noreply@github.com>2022-04-01 10:55:30 +0800
commit124b072f0b69650baff086b9688d198f5a6761af (patch)
treefa18f7930053a8408e124875b5dec20e0309332b /services/asymkey
parent3a73645502392110369b5d78fa2c9136e77e4aa2 (diff)
downloadgitea-124b072f0b69650baff086b9688d198f5a6761af.tar.gz
gitea-124b072f0b69650baff086b9688d198f5a6761af.zip
Remove `git.Command.Run` and `git.Command.RunInDir*` (#19280)
Follows #19266, #8553, Close #18553, now there are only three `Run..(&RunOpts{})` functions. * before: `stdout, err := RunInDir(path)` * now: `stdout, _, err := RunStdString(&git.RunOpts{Dir:path})`
Diffstat (limited to 'services/asymkey')
-rw-r--r--services/asymkey/sign.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/services/asymkey/sign.go b/services/asymkey/sign.go
index 59f96352de..c3f093a808 100644
--- a/services/asymkey/sign.go
+++ b/services/asymkey/sign.go
@@ -90,15 +90,15 @@ func SigningKey(ctx context.Context, repoPath string) (string, *git.Signature) {
if setting.Repository.Signing.SigningKey == "default" || setting.Repository.Signing.SigningKey == "" {
// Can ignore the error here as it means that commit.gpgsign is not set
- value, _ := git.NewCommand(ctx, "config", "--get", "commit.gpgsign").RunInDir(repoPath)
+ value, _, _ := git.NewCommand(ctx, "config", "--get", "commit.gpgsign").RunStdString(&git.RunOpts{Dir: repoPath})
sign, valid := git.ParseBool(strings.TrimSpace(value))
if !sign || !valid {
return "", nil
}
- signingKey, _ := git.NewCommand(ctx, "config", "--get", "user.signingkey").RunInDir(repoPath)
- signingName, _ := git.NewCommand(ctx, "config", "--get", "user.name").RunInDir(repoPath)
- signingEmail, _ := git.NewCommand(ctx, "config", "--get", "user.email").RunInDir(repoPath)
+ signingKey, _, _ := git.NewCommand(ctx, "config", "--get", "user.signingkey").RunStdString(&git.RunOpts{Dir: repoPath})
+ signingName, _, _ := git.NewCommand(ctx, "config", "--get", "user.name").RunStdString(&git.RunOpts{Dir: repoPath})
+ signingEmail, _, _ := git.NewCommand(ctx, "config", "--get", "user.email").RunStdString(&git.RunOpts{Dir: repoPath})
return strings.TrimSpace(signingKey), &git.Signature{
Name: strings.TrimSpace(signingName),
Email: strings.TrimSpace(signingEmail),