MCPcopy Index your code
hub / github.com/google/git-appraise / MergeRef

Method MergeRef

repository/git.go:441–454  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

439// The messages argument(s) provide text that should be included in the default
440// merge commit message (separated by blank lines).
441func (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.

Callers

nothing calls this directly

Calls 1

runGitCommandInlineMethod · 0.95

Tested by

no test coverage detected