aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/code.gitea.io/git/command.go
diff options
context:
space:
mode:
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 8ca99fd6d3..fc48d2871b 100644
--- a/vendor/code.gitea.io/git/command.go
+++ b/vendor/code.gitea.io/git/command.go
@@ -37,9 +37,12 @@ func (c *Command) String() string {
// NewCommand creates and returns a new Git Command based on given command and arguments.
func NewCommand(args ...string) *Command {
+ // Make an explicit copy of GlobalCommandArgs, otherwise append might overwrite it
+ cargs := make([]string, len(GlobalCommandArgs))
+ copy(cargs, GlobalCommandArgs)
return &Command{
name: "git",
- args: append(GlobalCommandArgs, args...),
+ args: append(cargs, args...),
}
}