Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2020-11-02 16:48:16 +0300
committerToon Claes <toon@gitlab.com>2021-02-17 18:12:20 +0300
commitcd6307dc7ae7391388f30e886ed582d655eb1d21 (patch)
treec904b5a89fc05d90b8b6ba287a40d17000232e4b /internal/git2go
parent13d3f1ff3cad5b6ecb32e54eca17356947c3caa1 (diff)
Move ErrInvalidArgument to a more common place
ErrInvalidArgument is used outside merge so it makes more sense to move the definition to command.go where there are a bunch more functions and such that are shared across this package.
Diffstat (limited to 'internal/git2go')
-rw-r--r--internal/git2go/command.go6
-rw-r--r--internal/git2go/merge.go5
2 files changed, 6 insertions, 5 deletions
diff --git a/internal/git2go/command.go b/internal/git2go/command.go
index c65665de1..c64b1c899 100644
--- a/internal/git2go/command.go
+++ b/internal/git2go/command.go
@@ -5,6 +5,7 @@ import (
"context"
"encoding/base64"
"encoding/json"
+ "errors"
"fmt"
"io"
"os/exec"
@@ -15,6 +16,11 @@ import (
"gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
)
+var (
+ // ErrInvalidArgument is returned in case the merge arguments are invalid.
+ ErrInvalidArgument = errors.New("invalid parameters")
+)
+
func binaryPathFromCfg(cfg config.Cfg) string {
return filepath.Join(cfg.BinDir, "gitaly-git2go")
}
diff --git a/internal/git2go/merge.go b/internal/git2go/merge.go
index e92856810..aca2035f7 100644
--- a/internal/git2go/merge.go
+++ b/internal/git2go/merge.go
@@ -16,11 +16,6 @@ const (
MergeRecursionLimit = 20
)
-var (
- // ErrInvalidArgument is returned in case the merge arguments are invalid.
- ErrInvalidArgument = errors.New("invalid parameters")
-)
-
// MergeCommand contains parameters to perform a merge.
type MergeCommand struct {
// Repository is the path to execute merge in.