shithub: furgit

ref: cf02f2958c191bea02126faf8daf72a7aae76bd9
dir: /internal/commitquery/load.go/

View raw version
package commitquery

// ensureLoaded completes one node's metadata load if it has not been loaded yet.
func (ctx *Context) ensureLoaded(idx NodeIndex) error {
	if ctx.nodes[idx].loaded {
		return nil
	}

	if ctx.nodes[idx].hasGraphPos {
		return ctx.loadByGraphPos(idx)
	}

	return ctx.loadByOID(idx)
}