(ref string)
| 114 | } |
| 115 | |
| 116 | func (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. |
| 129 | func (repo *GitRepo) HasObject(hash string) (bool, error) { |
no test coverage detected