revParseCommit returns the full commit hash for the given repo ref.
(repoDir, repoRef string)
| 390 | |
| 391 | // revParseCommit returns the full commit hash for the given repo ref. |
| 392 | func revParseCommit(repoDir, repoRef string) (string, error) { |
| 393 | repoRef = strings.TrimSpace(repoRef) |
| 394 | if repoRef == "" { |
| 395 | return "", nil |
| 396 | } |
| 397 | // Force refs like annotated tags to resolve to the commit they point at. |
| 398 | return revParse(repoDir, repoRef+"^{commit}") |
| 399 | } |
| 400 | |
| 401 | // revParse returns the full commit hash for the given repo ref from local repo. |
| 402 | // The ref can be any valid git revision (branch, tag, HEAD, commit hash, etc.). |
no test coverage detected