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

Method getIsCommitMap

repository/git.go:845–856  ·  view source on GitHub ↗

getIsCommitMap returns a mapping of all the annotated objects that are commits.

(repo *GitRepo)

Source from the content-addressed store, hash-verified

843
844// getIsCommitMap returns a mapping of all the annotated objects that are commits.
845func (overview *notesOverview) getIsCommitMap(repo *GitRepo) (map[string]bool, error) {
846 var stdout bytes.Buffer
847 var stderr bytes.Buffer
848 if err := repo.runGitCommandWithIO(overview.ObjectHashesReader, &stdout, &stderr, "cat-file", "--batch-check=%(objectname) %(objecttype)"); err != nil {
849 return nil, fmt.Errorf("Failure performing a batch file check: %v", err)
850 }
851 isCommit, err := splitBatchCheckOutput(&stdout)
852 if err != nil {
853 return nil, fmt.Errorf("Failure parsing the output of a batch file check: %v", err)
854 }
855 return isCommit, nil
856}
857
858// getNoteContentsMap returns a mapping from all the notes hashes to their contents.
859func (overview *notesOverview) getNoteContentsMap(repo *GitRepo) (map[string][]byte, error) {

Callers 1

GetAllNotesMethod · 0.80

Calls 2

splitBatchCheckOutputFunction · 0.85
runGitCommandWithIOMethod · 0.80

Tested by

no test coverage detected