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

Method HasRef

repository/git.go:116–126  ·  view source on GitHub ↗
(ref string)

Source from the content-addressed store, hash-verified

114}
115
116func (repo *GitRepo) HasRef(ref string) (bool, error) {
117 _, _, err := repo.runGitCommandRaw("show-ref", "--verify", "--quiet", ref)
118 if err == nil {
119 return true, nil
120 }
121 if _, ok := err.(*exec.ExitError); ok {
122 return false, nil
123 }
124 // Got an unexpected error
125 return false, err
126}
127
128// HasObject returns whether or not the repo contains an object with the given hash.
129func (repo *GitRepo) HasObject(hash string) (bool, error) {

Callers 1

mergeArchivesMethod · 0.95

Calls 1

runGitCommandRawMethod · 0.95

Tested by

no test coverage detected