mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-16 14:47:48 +02:00
Replace WithStdin to WithStdinCopy in hook_pre_receive.go
This commit is contained in:
parent
fee277fc41
commit
303cb6f930
@ -405,11 +405,11 @@ func scanLFSPointersFromObjectIDs(ctx *gitea_context.PrivateContext, repoPath st
|
||||
input.WriteByte('\n')
|
||||
}
|
||||
|
||||
// Feed stdin via WithStdin, RunStdBytes takes only context.Context in your version
|
||||
// Use batch-check to get object type and size for each object ID
|
||||
checkCmd := gitcmd.NewCommand("cat-file", "--batch-check=%(objectname) %(objecttype) %(objectsize)").
|
||||
WithDir(repoPath).
|
||||
WithEnv(env).
|
||||
WithStdin(bytes.NewReader(input.Bytes()))
|
||||
WithStdinCopy(bytes.NewReader(input.Bytes()))
|
||||
|
||||
checkBytes, _, err := checkCmd.RunStdBytes(ctx)
|
||||
if err != nil {
|
||||
@ -449,7 +449,7 @@ func scanLFSPointersFromObjectIDs(ctx *gitea_context.PrivateContext, repoPath st
|
||||
catCmd := gitcmd.NewCommand("cat-file", "--batch").
|
||||
WithDir(repoPath).
|
||||
WithEnv(env).
|
||||
WithStdin(bytes.NewReader(input2.Bytes()))
|
||||
WithStdinCopy(bytes.NewReader(input2.Bytes()))
|
||||
|
||||
catBytes, _, err := catCmd.RunStdBytes(ctx)
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user