MCPcopy Create free account
hub / github.com/google/git-appraise / MergeNotes

Method MergeNotes

repository/git.go:1048–1061  ·  view source on GitHub ↗

MergeNotes merges in the remote's state of the notes reference into the local repository's.

(remote, notesRefPattern string)

Source from the content-addressed store, hash-verified

1046// MergeNotes merges in the remote's state of the notes reference into the
1047// local repository's.
1048func (repo *GitRepo) MergeNotes(remote, notesRefPattern string) error {
1049 remoteRefPattern := getRemoteNotesRef(remote, notesRefPattern)
1050 refsMap, err := repo.getRefHashes(remoteRefPattern)
1051 if err != nil {
1052 return err
1053 }
1054 for remoteRef := range refsMap {
1055 localRef := getLocalNotesRef(remote, remoteRef)
1056 if _, err := repo.runGitCommand("notes", "--ref", localRef, "merge", remoteRef, "-s", "cat_sort_uniq"); err != nil {
1057 return err
1058 }
1059 }
1060 return nil
1061}
1062
1063// PullNotes fetches the contents of the given notes ref from a remote repo,
1064// and then merges them with the corresponding local notes using the

Callers 2

PullNotesMethod · 0.95
PullNotesAndArchiveMethod · 0.95

Calls 4

getRefHashesMethod · 0.95
runGitCommandMethod · 0.95
getRemoteNotesRefFunction · 0.85
getLocalNotesRefFunction · 0.85

Tested by

no test coverage detected