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

Method PullNotesAndArchive

repository/git.go:1185–1196  ·  view source on GitHub ↗

PullNotesAndArchive fetches the contents of the notes and archives refs from a remote repo, and merges them with the corresponding local refs. For notes refs, we assume that every note can be automatically merged using the 'cat_sort_uniq' strategy (the git-appraise schemas fit that requirement), so

(remote, notesRefPattern, archiveRefPattern string)

Source from the content-addressed store, hash-verified

1183// we merely ensure that their history graph includes every commit that we
1184// intend to keep.
1185func (repo *GitRepo) PullNotesAndArchive(remote, notesRefPattern, archiveRefPattern string) error {
1186 if _, err := repo.FetchAndReturnNewReviewHashes(remote, notesRefPattern, archiveRefPattern); err != nil {
1187 return fmt.Errorf("failure fetching from the remote %q: %v", remote, err)
1188 }
1189 if err := repo.MergeArchives(remote, archiveRefPattern); err != nil {
1190 return fmt.Errorf("failure merging archives from the remote %q: %v", remote, err)
1191 }
1192 if err := repo.MergeNotes(remote, notesRefPattern); err != nil {
1193 return fmt.Errorf("failure merging notes from the remote %q: %v", remote, err)
1194 }
1195 return nil
1196}
1197
1198// Push pushes the given refs to a remote repo.
1199func (repo *GitRepo) Push(remote string, refSpecs ...string) error {

Callers

nothing calls this directly

Calls 3

MergeArchivesMethod · 0.95
MergeNotesMethod · 0.95

Tested by

no test coverage detected