summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands/rebase.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/commands/git_commands/rebase.go')
-rw-r--r--pkg/commands/git_commands/rebase.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/commands/git_commands/rebase.go b/pkg/commands/git_commands/rebase.go
index 50c599a66..e7a2d766a 100644
--- a/pkg/commands/git_commands/rebase.go
+++ b/pkg/commands/git_commands/rebase.go
@@ -181,12 +181,18 @@ func (self *RebaseCommands) PrepareInteractiveRebaseCommand(opts PrepareInteract
debug = "TRUE"
}
+ emptyArg := " --empty=keep"
+ if self.version.IsOlderThan(2, 26, 0) {
+ emptyArg = ""
+ }
+
rebaseMergesArg := " --rebase-merges"
if self.version.IsOlderThan(2, 22, 0) {
rebaseMergesArg = ""
}
- cmdStr := fmt.Sprintf("git rebase --interactive --autostash --keep-empty --empty=keep --no-autosquash%s %s",
- rebaseMergesArg, opts.baseShaOrRoot)
+
+ cmdStr := fmt.Sprintf("git rebase --interactive --autostash --keep-empty%s --no-autosquash%s %s",
+ emptyArg, rebaseMergesArg, opts.baseShaOrRoot)
self.Log.WithField("command", cmdStr).Debug("RunCommand")
cmdObj := self.cmd.New(cmdStr)