MergeRef merges the given ref into the current one. The ref argument is the ref to merge, and fastForward indicates that the current ref should only move forward, as opposed to creating a bubble merge. The messages argument(s) provide text that should be included in the default merge commit message
(ref string, fastForward bool, messages ...string)
| 439 | // The messages argument(s) provide text that should be included in the default |
| 440 | // merge commit message (separated by blank lines). |
| 441 | func (repo *GitRepo) MergeRef(ref string, fastForward bool, messages ...string) error { |
| 442 | args := []string{"merge"} |
| 443 | if fastForward { |
| 444 | args = append(args, "--ff", "--ff-only") |
| 445 | } else { |
| 446 | args = append(args, "--no-ff") |
| 447 | } |
| 448 | if len(messages) > 0 { |
| 449 | commitMessage := strings.Join(messages, "\n\n") |
| 450 | args = append(args, "-e", "-m", commitMessage) |
| 451 | } |
| 452 | args = append(args, ref) |
| 453 | return repo.runGitCommandInline(args...) |
| 454 | } |
| 455 | |
| 456 | // MergeAndSignRef merges the given ref into the current one and signs the |
| 457 | // merge. |
nothing calls this directly
no test coverage detected