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

Method getNoteContentsMap

repository/git.go:859–870  ·  view source on GitHub ↗

getNoteContentsMap returns a mapping from all the notes hashes to their contents.

(repo *GitRepo)

Source from the content-addressed store, hash-verified

857
858// getNoteContentsMap returns a mapping from all the notes hashes to their contents.
859func (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//

Callers 1

GetAllNotesMethod · 0.80

Calls 2

splitBatchCatFileOutputFunction · 0.85
runGitCommandWithIOMethod · 0.80

Tested by

no test coverage detected