diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-27 08:35:52 +0800 |
---|---|---|
committer | Antoine GIRARD <sapk@users.noreply.github.com> | 2019-11-27 01:35:52 +0100 |
commit | 7b7d382b8b414e7da67dfec7c7e1ef9e0e269d68 (patch) | |
tree | ea2bd9ccb5ba69da61fbf463c4f87409e98307b7 /modules/git/command.go | |
parent | 9d9e6ac4117b8efd2f85fc625a4ccfdcf73c4fc3 (diff) | |
download | gitea-7b7d382b8b414e7da67dfec7c7e1ef9e0e269d68.tar.gz gitea-7b7d382b8b414e7da67dfec7c7e1ef9e0e269d68.zip |
Fix datarace on git.GlobalCommandArgs on tests (#9162)
* fix datarace on git.GlobalCommandArgs on tests
* fix tests
* fix tests
* fix tests
Diffstat (limited to 'modules/git/command.go')
-rw-r--r-- | modules/git/command.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/git/command.go b/modules/git/command.go index 7772abd2d5..65878edb7d 100644 --- a/modules/git/command.go +++ b/modules/git/command.go @@ -52,6 +52,14 @@ func NewCommand(args ...string) *Command { } } +// NewCommandNoGlobals creates and returns a new Git Command based on given command and arguments only with the specify args and don't care global command args +func NewCommandNoGlobals(args ...string) *Command { + return &Command{ + name: GitExecutable, + args: args, + } +} + // AddArguments adds new argument(s) to the command. func (c *Command) AddArguments(args ...string) *Command { c.args = append(c.args, args...) |