Let package git depend on setting but not opposite (#15241)

* Let package git depend on setting but not opposite

* private some package variables
This commit is contained in:
Lunny Xiao 2021-06-26 19:28:55 +08:00 committed by GitHub
parent e673e42f7e
commit e3c626834b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 113 additions and 92 deletions

View file

@ -23,8 +23,8 @@ var (
// GlobalCommandArgs global command args for external package setting
GlobalCommandArgs []string
// DefaultCommandExecutionTimeout default command execution timeout duration
DefaultCommandExecutionTimeout = 360 * time.Second
// defaultCommandExecutionTimeout default command execution timeout duration
defaultCommandExecutionTimeout = 360 * time.Second
)
// DefaultLocale is the default LC_ALL to run git commands in.
@ -111,7 +111,7 @@ func (c *Command) RunInDirTimeoutEnvFullPipeline(env []string, timeout time.Dura
// it pipes stdout and stderr to given io.Writer and passes in an io.Reader as stdin. Between cmd.Start and cmd.Wait the passed in function is run.
func (c *Command) RunInDirTimeoutEnvFullPipelineFunc(env []string, timeout time.Duration, dir string, stdout, stderr io.Writer, stdin io.Reader, fn func(context.Context, context.CancelFunc) error) error {
if timeout == -1 {
timeout = DefaultCommandExecutionTimeout
timeout = defaultCommandExecutionTimeout
}
if len(dir) == 0 {