mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-21 09:06:46 +09:00
enhance!: raise minimum git version to 2.34 (#39565)
Raise the minimum git version to 2.34, the version in Ubuntu 22.04, Debian 12 and RHEL 8 ship newer, and remove the fallbacks it makes obsolete. - Always enable AGit - Use `diff --skip-to` and `apply -3` unconditionally - Set the default branch of new repos and wikis via `git init --initial-branch` - Detect rebase conflicts via `REBASE_HEAD`
This commit is contained in:
1 parent
4bebd86285
commit
eb4468ff4e
38 files changed
+177
-404
No files matched your search
@@ -41,12 +41,10 @@ func InitWiki(ctx context.Context, repo *repo_model.Repository) error {
|
||||
}
|
||||
|
||||
// wiki's object format should be the same as repository's
|
||||
if err := git.InitRepository(ctx, repo.WikiStorageRepo(), repo.ObjectFormatName); err != nil {
|
||||
if err := git.InitRepository(ctx, repo.WikiStorageRepo(), repo.ObjectFormatName, repo.DefaultWikiBranch); err != nil {
|
||||
return fmt.Errorf("InitRepository: %w", err)
|
||||
} else if err = git.CreateDelegateHooks(ctx, repo.WikiStorageRepo()); err != nil {
|
||||
return fmt.Errorf("createDelegateHooks: %w", err)
|
||||
} else if err = git.SetDefaultBranch(ctx, repo.WikiStorageRepo(), repo.DefaultWikiBranch); err != nil {
|
||||
return fmt.Errorf("unable to set default wiki branch to %q: %w", repo.DefaultWikiBranch, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -148,8 +148,12 @@ func TestRepository_InitWiki(t *testing.T) {
|
||||
|
||||
// repo2 does not already have a wiki
|
||||
repo2 := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 2})
|
||||
repo2.DefaultWikiBranch = "wiki-main"
|
||||
assert.NoError(t, InitWiki(t.Context(), repo2))
|
||||
assert.True(t, repo_service.HasWiki(t.Context(), repo2))
|
||||
branch, err := git.GetDefaultBranch(t.Context(), repo2.WikiStorageRepo())
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "wiki-main", branch)
|
||||
}
|
||||
|
||||
func TestRepository_AddWikiPage(t *testing.T) {
|
||||
@@ -301,7 +305,7 @@ func TestPrepareWikiFileName_FirstPage(t *testing.T) {
|
||||
// Now create a temporaryDirectory
|
||||
tmpDir := t.TempDir()
|
||||
|
||||
err := git.InitRepositoryLocal(t.Context(), tmpDir, true, git.Sha1ObjectFormat.Name())
|
||||
err := git.InitRepositoryLocal(t.Context(), tmpDir, true, git.Sha1ObjectFormat.Name(), "")
|
||||
assert.NoError(t, err)
|
||||
|
||||
gitRepo, err := git.OpenRepositoryLocal(t.Context(), tmpDir)
|
||||
|
||||
Reference in new issue
Block a user