(ref *plumbing.Reference)
| 228 | func (iter *ReferenceIter) Close() {} |
| 229 | |
| 230 | func referenceToMap(ref *plumbing.Reference) (map[string]interface{}, error) { |
| 231 | if ref == nil { |
| 232 | return nil, fmt.Errorf("nil reference") |
| 233 | } |
| 234 | refMap := map[string]interface{}{ |
| 235 | "Name": ref.Name().String(), |
| 236 | "Type": ref.Type().String(), |
| 237 | "Target": ref.Target().String(), |
| 238 | // Include other fields as necessary. |
| 239 | } |
| 240 | if ref.Type() == plumbing.HashReference { |
| 241 | refMap["Hash"] = ref.Hash().String() |
| 242 | } |
| 243 | return refMap, nil |
| 244 | } |
| 245 | |
| 246 | func jsonToReference(data []byte) (*plumbing.Reference, error) { |
| 247 | var refMap map[string]interface{} |
no test coverage detected