From 44053532bb7c5b7fcd65fd5246780db8cf446f7e Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Sun, 7 Jan 2018 14:10:20 +0100 Subject: Serve .patch for pull requests (#3305) * Serve .patch for pull requests Closes #3259 Updates "git" module, for GetFormatPatch * Handle io.Copy error --- vendor/code.gitea.io/git/command.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vendor/code.gitea.io/git/command.go') 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 { -- cgit v1.2.3