mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-16 01:43:24 +09:00
refactor: remove unnecessary git command wrapper functions (#38531)
Removed `gitrepo.RunCmd*` functions, because gitcmd.Command works with Repository directly. Move some "local filesystem" related function into "localfs.go"
This commit is contained in:
@@ -36,8 +36,8 @@ func checkConflictsMergeTree(ctx context.Context, pr *issues_model.PullRequest,
|
||||
// Detect whether the pull request introduces changes by comparing the merged tree (treeHash)
|
||||
// against the current base commit (baseCommitID) using `git diff-tree`. The command returns exit code 0
|
||||
// if there is no diff between these trees (empty patch) and exit code 1 if there is a diff.
|
||||
gitErr := gitrepo.RunCmd(ctx, pr.BaseRepo, gitcmd.NewCommand("diff-tree", "-r", "--quiet").
|
||||
AddDynamicArguments(treeHash, baseCommitID))
|
||||
gitErr := gitcmd.NewCommand("diff-tree", "-r", "--quiet").
|
||||
AddDynamicArguments(treeHash, baseCommitID).WithRepo(pr.BaseRepo).Run(ctx)
|
||||
switch {
|
||||
case gitErr == nil:
|
||||
log.Debug("PullRequest[%d]: Patch is empty - ignoring", pr.ID)
|
||||
|
||||
Reference in New Issue
Block a user