getNoteContentsMap returns a mapping from all the notes hashes to their contents.
(repo *GitRepo)
| 857 | |
| 858 | // getNoteContentsMap returns a mapping from all the notes hashes to their contents. |
| 859 | func (overview *notesOverview) getNoteContentsMap(repo *GitRepo) (map[string][]byte, error) { |
| 860 | var stdout bytes.Buffer |
| 861 | var stderr bytes.Buffer |
| 862 | if err := repo.runGitCommandWithIO(overview.NotesHashesReader, &stdout, &stderr, "cat-file", "--batch=%(objectname)\n%(objectsize)"); err != nil { |
| 863 | return nil, fmt.Errorf("Failure performing a batch file read: %v", err) |
| 864 | } |
| 865 | noteContentsMap, err := splitBatchCatFileOutput(&stdout) |
| 866 | if err != nil { |
| 867 | return nil, fmt.Errorf("Failure parsing the output of a batch file read: %v", err) |
| 868 | } |
| 869 | return noteContentsMap, nil |
| 870 | } |
| 871 | |
| 872 | // GetAllNotes reads the contents of the notes under the given ref for every commit. |
| 873 | // |
no test coverage detected