diff options
Diffstat (limited to 'modules/repository/init.go')
-rw-r--r-- | modules/repository/init.go | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/modules/repository/init.go b/modules/repository/init.go index f5cef3301..e984697cd 100644 --- a/modules/repository/init.go +++ b/modules/repository/init.go @@ -323,19 +323,17 @@ func initRepoCommit(ctx context.Context, tmpPath string, repo *repo_model.Reposi "-m", "Initial commit", } - if git.CheckGitVersionAtLeast("1.7.9") == nil { - sign, keyID, signer, _ := asymkey_service.SignInitialCommit(ctx, tmpPath, u) - if sign { - args = append(args, "-S"+keyID) - - if repo.GetTrustModel() == repo_model.CommitterTrustModel || repo.GetTrustModel() == repo_model.CollaboratorCommitterTrustModel { - // need to set the committer to the KeyID owner - committerName = signer.Name - committerEmail = signer.Email - } - } else if git.CheckGitVersionAtLeast("2.0.0") == nil { - args = append(args, "--no-gpg-sign") + sign, keyID, signer, _ := asymkey_service.SignInitialCommit(ctx, tmpPath, u) + if sign { + args = append(args, "-S"+keyID) + + if repo.GetTrustModel() == repo_model.CommitterTrustModel || repo.GetTrustModel() == repo_model.CollaboratorCommitterTrustModel { + // need to set the committer to the KeyID owner + committerName = signer.Name + committerEmail = signer.Email } + } else { + args = append(args, "--no-gpg-sign") } env = append(env, |