From 304607ae5d4b18acaeffaa980b97ba3984ece311 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Mon, 20 Apr 2020 18:35:22 +1000 Subject: support configurable merge args --- docs/Config.md | 2 ++ pkg/commands/git.go | 3 ++- pkg/config/app_config.go | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/Config.md b/docs/Config.md index 0362c4a86..3d9caba36 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -35,6 +35,8 @@ Default path for the config file: merging: # only applicable to unix users manualCommit: false + # extra args passed to `git merge`, e.g. --no-ff + args: "" skipHookPrefix: WIP autoFetch: true update: diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 5958886c3..f996c01b5 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -410,7 +410,8 @@ func (c *GitCommand) ListStash() (string, error) { // Merge merge func (c *GitCommand) Merge(branchName string) error { - return c.OSCommand.RunCommand("git merge --no-edit %s", branchName) + mergeArgs := c.Config.GetUserConfig().GetString("git.merging.args") + return c.OSCommand.RunCommand("git merge --no-edit %s %s", mergeArgs, branchName) } // AbortMerge abort merge diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 76f2fb76f..f3824c5f1 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -264,6 +264,7 @@ git: useConfig: false merging: manualCommit: false + args: "" skipHookPrefix: 'WIP' autoFetch: true update: -- cgit v1.2.3