mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 11:28:24 +00:00 
			
		
		
		
	Move some functions to gitrepo package (#35543)
Refactor Git command functions to use WithXXX methods instead of exposing RunOpts. This change simplifies reuse across gitrepo and improves consistency, encapsulation, and maintainability of command options. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		| @@ -20,6 +20,7 @@ import ( | ||||
| 	"code.gitea.io/gitea/models/unittest" | ||||
| 	user_model "code.gitea.io/gitea/models/user" | ||||
| 	"code.gitea.io/gitea/modules/git" | ||||
| 	"code.gitea.io/gitea/modules/gitrepo" | ||||
| 	"code.gitea.io/gitea/modules/test" | ||||
| 	"code.gitea.io/gitea/modules/translation" | ||||
| 	"code.gitea.io/gitea/modules/util" | ||||
| @@ -187,7 +188,7 @@ func testEditorWebGitCommitEmail(t *testing.T) { | ||||
| 	require.True(t, user.KeepEmailPrivate) | ||||
|  | ||||
| 	repo1 := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}) | ||||
| 	gitRepo, _ := git.OpenRepository(t.Context(), repo1.RepoPath()) | ||||
| 	gitRepo, _ := gitrepo.OpenRepository(t.Context(), repo1) | ||||
| 	defer gitRepo.Close() | ||||
| 	getLastCommit := func(t *testing.T) *git.Commit { | ||||
| 		c, err := gitRepo.GetBranchCommit("master") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user