mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 03:18:24 +00:00 
			
		
		
		
	Move git command to git/gitcmd (#35483)
The name cmd is already used in many places and may cause conflicts, so I chose `gitcmd` instead to minimize potential naming conflicts.
This commit is contained in:
		| @@ -11,6 +11,7 @@ import ( | ||||
| 	"strings" | ||||
|  | ||||
| 	"code.gitea.io/gitea/modules/git" | ||||
| 	"code.gitea.io/gitea/modules/git/gitcmd" | ||||
| 	"code.gitea.io/gitea/modules/setting" | ||||
| ) | ||||
|  | ||||
| @@ -22,7 +23,7 @@ func GetCommitGraph(r *git.Repository, page, maxAllowedColors int, hidePRRefs bo | ||||
| 		page = 1 | ||||
| 	} | ||||
|  | ||||
| 	graphCmd := git.NewCommand("log", "--graph", "--date-order", "--decorate=full") | ||||
| 	graphCmd := gitcmd.NewCommand("log", "--graph", "--date-order", "--decorate=full") | ||||
|  | ||||
| 	if hidePRRefs { | ||||
| 		graphCmd.AddArguments("--exclude=" + git.PullPrefix + "*") | ||||
| @@ -53,7 +54,7 @@ func GetCommitGraph(r *git.Repository, page, maxAllowedColors int, hidePRRefs bo | ||||
|  | ||||
| 	scanner := bufio.NewScanner(stdoutReader) | ||||
|  | ||||
| 	if err := graphCmd.Run(r.Ctx, &git.RunOpts{ | ||||
| 	if err := graphCmd.Run(r.Ctx, &gitcmd.RunOpts{ | ||||
| 		Dir:    r.Path, | ||||
| 		Stdout: stdoutWriter, | ||||
| 		Stderr: stderr, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user