diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-06-16 23:47:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-16 23:47:44 +0800 |
commit | 157b4057531b99b2d3b5c086f385c830aa38354f (patch) | |
tree | 5a7f066be290cefe174b7f5ab5f48f478921a226 /modules/repository | |
parent | 70ce051f1a7e266dccdd7cfd42f88a2570448770 (diff) | |
download | gitea-157b4057531b99b2d3b5c086f385c830aa38354f.tar.gz gitea-157b4057531b99b2d3b5c086f385c830aa38354f.zip |
Remove legacy git code (ver < 2.0), fine tune markup tests (#19930)
* clean git support for ver < 2.0
* fine tune tests for markup (which requires git module)
* remove unnecessary comments
* try to fix tests
* try test again
* use const for GitVersionRequired instead of var
* try to fix integration test
* Refactor CheckAttributeReader to make a *git.Repository version
* update document for commit signing with Gitea's internal gitconfig
* update document for commit signing with Gitea's internal gitconfig
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/repository')
-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 f5cef3301d..e984697cda 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, |