mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09: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,12 +11,13 @@ import ( | ||||
| 	"os" | ||||
|  | ||||
| 	"code.gitea.io/gitea/modules/git" | ||||
| 	"code.gitea.io/gitea/modules/git/gitcmd" | ||||
| ) | ||||
|  | ||||
| func checkAttrCommand(gitRepo *git.Repository, treeish string, filenames, attributes []string) (*git.Command, []string, func(), error) { | ||||
| func checkAttrCommand(gitRepo *git.Repository, treeish string, filenames, attributes []string) (*gitcmd.Command, []string, func(), error) { | ||||
| 	cancel := func() {} | ||||
| 	envs := []string{"GIT_FLUSH=1"} | ||||
| 	cmd := git.NewCommand("check-attr", "-z") | ||||
| 	cmd := gitcmd.NewCommand("check-attr", "-z") | ||||
| 	if len(attributes) == 0 { | ||||
| 		cmd.AddArguments("--all") | ||||
| 	} | ||||
| @@ -70,7 +71,7 @@ func CheckAttributes(ctx context.Context, gitRepo *git.Repository, treeish strin | ||||
| 	stdOut := new(bytes.Buffer) | ||||
| 	stdErr := new(bytes.Buffer) | ||||
|  | ||||
| 	if err := cmd.Run(ctx, &git.RunOpts{ | ||||
| 	if err := cmd.Run(ctx, &gitcmd.RunOpts{ | ||||
| 		Env:    append(os.Environ(), envs...), | ||||
| 		Dir:    gitRepo.Path, | ||||
| 		Stdout: stdOut, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user