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:
		| @@ -234,7 +234,8 @@ func GetMergedBaseCommitID(ctx *context.Context, issue *issues_model.Issue) stri | ||||
| 		} | ||||
| 		if commitSHA != "" { | ||||
| 			// Get immediate parent of the first commit in the patch, grab history back | ||||
| 			parentCommit, _, err = gitcmd.NewCommand("rev-list", "-1", "--skip=1").AddDynamicArguments(commitSHA).RunStdString(ctx, &gitcmd.RunOpts{Dir: ctx.Repo.GitRepo.Path}) | ||||
| 			parentCommit, err = gitrepo.RunCmdString(ctx, ctx.Repo.Repository, | ||||
| 				gitcmd.NewCommand("rev-list", "-1", "--skip=1").AddDynamicArguments(commitSHA)) | ||||
| 			if err == nil { | ||||
| 				parentCommit = strings.TrimSpace(parentCommit) | ||||
| 			} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user