Skip to content

Commit

Permalink
allow rebase on pull
Browse files Browse the repository at this point in the history
Signed-off-by: fhochleitner <felix.hochleitner@outlook.com>
  • Loading branch information
fhochleitner committed Sep 15, 2023
1 parent 35b4599 commit fa9da09
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/api/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ func DeployFromTo(c *model.Config, repo *git.Repository) {
cmd.Dir = dir
_ = execute(cmd)

cmd = exec.Command("git", "config", "--local", "pull.rebase", "true")
cmd.Dir = dir
_ = execute(cmd)

for fromIndex < toIndex {
fromBranch := c.Stages[fromIndex]
toBranch := c.Stages[fromIndex+1]
Expand All @@ -106,11 +110,11 @@ func merge(wt *git.Worktree, fromBranch string, toBranch string) {
cmd.Dir = wt.Filesystem.Root()
_ = execute(cmd)

cmd = exec.Command("git", "config", "pull.rebase", "true")
cmd = exec.Command("git", "rebase", fromBranch, toBranch)
cmd.Dir = wt.Filesystem.Root()
_ = execute(cmd)

cmd = exec.Command("git", "rebase", fromBranch, toBranch)
cmd = exec.Command("git", "pull")
cmd.Dir = wt.Filesystem.Root()
_ = execute(cmd)
}
Expand Down

0 comments on commit fa9da09

Please sign in to comment.