aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/code.gitea.io/git/command.go
diff options
context:
space:
mode:
authorSandro Santilli <strk@kbt.io>2018-01-07 14:10:20 +0100
committerLauris BH <lauris@nix.lv>2018-01-07 15:10:20 +0200
commit44053532bb7c5b7fcd65fd5246780db8cf446f7e (patch)
tree421763fd45a3d50e3a6cd67d07bb563fddf35418 /vendor/code.gitea.io/git/command.go
parent18bb0f8f1344771bbbc44fd37eee772c5c3b44d6 (diff)
downloadgitea-44053532bb7c5b7fcd65fd5246780db8cf446f7e.tar.gz
gitea-44053532bb7c5b7fcd65fd5246780db8cf446f7e.zip
Serve .patch for pull requests (#3305)
* Serve .patch for pull requests Closes #3259 Updates "git" module, for GetFormatPatch * Handle io.Copy error
Diffstat (limited to 'vendor/code.gitea.io/git/command.go')
-rw-r--r--vendor/code.gitea.io/git/command.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/vendor/code.gitea.io/git/command.go b/vendor/code.gitea.io/git/command.go
index 06722c213b..8ca99fd6d3 100644
--- a/vendor/code.gitea.io/git/command.go
+++ b/vendor/code.gitea.io/git/command.go
@@ -17,6 +17,9 @@ import (
var (
// GlobalCommandArgs global command args for external package setting
GlobalCommandArgs []string
+
+ // DefaultCommandExecutionTimeout default command execution timeout duration
+ DefaultCommandExecutionTimeout = 60 * time.Second
)
// Command represents a command with its subcommands or arguments.
@@ -50,7 +53,7 @@ func (c *Command) AddArguments(args ...string) *Command {
// it pipes stdout and stderr to given io.Writer.
func (c *Command) RunInDirTimeoutPipeline(timeout time.Duration, dir string, stdout, stderr io.Writer) error {
if timeout == -1 {
- timeout = 60 * time.Second
+ timeout = DefaultCommandExecutionTimeout
}
if len(dir) == 0 {