(s storer.ReferenceStorer, ref plumbing.ReferenceName)
| 1545 | } |
| 1546 | |
| 1547 | func expand_ref(s storer.ReferenceStorer, ref plumbing.ReferenceName) (*plumbing.Reference, error) { |
| 1548 | // For improving troubleshooting, this preserves the error for the provided `ref`, |
| 1549 | // and returns the error for that specific ref in case all parse rules fails. |
| 1550 | var ret error |
| 1551 | for _, rule := range plumbing.RefRevParseRules { |
| 1552 | resolvedRef, err := storer.ResolveReference(s, plumbing.ReferenceName(fmt.Sprintf(rule, ref))) |
| 1553 | |
| 1554 | if err == nil { |
| 1555 | return resolvedRef, nil |
| 1556 | } else if ret == nil { |
| 1557 | ret = err |
| 1558 | } |
| 1559 | } |
| 1560 | |
| 1561 | return nil, ret |
| 1562 | } |
| 1563 | |
| 1564 | // ResolveRevision resolves revision to corresponding hash. It will always |
| 1565 | // resolve to a commit hash, not a tree or annotated tag. |
no test coverage detected
searching dependent graphs…