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)
| 1183 | // we merely ensure that their history graph includes every commit that we |
| 1184 | // intend to keep. |
| 1185 | func (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. |
| 1199 | func (repo *GitRepo) Push(remote string, refSpecs ...string) error { |
nothing calls this directly
no test coverage detected