mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +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:
1 parent
fe5afcb022
commit
9332ff291b
107 files changed
+690
-558
No files matched your search
@@ -8,6 +8,8 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/modules/git/gitcmd"
|
||||
)
|
||||
|
||||
// ObjectType git object type
|
||||
@@ -66,15 +68,15 @@ func (repo *Repository) HashObject(reader io.Reader) (ObjectID, error) {
|
||||
}
|
||||
|
||||
func (repo *Repository) hashObject(reader io.Reader, save bool) (string, error) {
|
||||
var cmd *Command
|
||||
var cmd *gitcmd.Command
|
||||
if save {
|
||||
cmd = NewCommand("hash-object", "-w", "--stdin")
|
||||
cmd = gitcmd.NewCommand("hash-object", "-w", "--stdin")
|
||||
} else {
|
||||
cmd = NewCommand("hash-object", "--stdin")
|
||||
cmd = gitcmd.NewCommand("hash-object", "--stdin")
|
||||
}
|
||||
stdout := new(bytes.Buffer)
|
||||
stderr := new(bytes.Buffer)
|
||||
err := cmd.Run(repo.Ctx, &RunOpts{
|
||||
err := cmd.Run(repo.Ctx, &gitcmd.RunOpts{
|
||||
Dir: repo.Path,
|
||||
Stdin: reader,
|
||||
Stdout: stdout,
|
||||
|
||||
Reference in new issue
Block a user