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

Method MergeAndSignRef

repository/git.go:463–478  ·  view source on GitHub ↗

MergeAndSignRef merges the given ref into the current one and signs the merge. 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 d

(ref string, fastForward bool,
	messages ...string)

Source from the content-addressed store, hash-verified

461// The messages argument(s) provide text that should be included in the default
462// merge commit message (separated by blank lines).
463func (repo *GitRepo) MergeAndSignRef(ref string, fastForward bool,
464 messages ...string) error {
465
466 args := []string{"merge"}
467 if fastForward {
468 args = append(args, "--ff", "--ff-only", "-S")
469 } else {
470 args = append(args, "--no-ff", "-S")
471 }
472 if len(messages) > 0 {
473 commitMessage := strings.Join(messages, "\n\n")
474 args = append(args, "-e", "-m", commitMessage)
475 }
476 args = append(args, ref)
477 return repo.runGitCommandInline(args...)
478}
479
480// RebaseRef rebases the current ref onto the given one.
481func (repo *GitRepo) RebaseRef(ref string) error {

Callers

nothing calls this directly

Calls 1

runGitCommandInlineMethod · 0.95

Tested by

no test coverage detected