aboutsummaryrefslogtreecommitdiff
path: root/commitquery/queries_is_ancestor.go
blob: 865ac8ed521742f4e733af4796a0c8d9b1657379 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package commitquery

import objectid "lindenii.org/go/furgit/object/id"

// IsAncestor reports whether ancestor is reachable from descendant through
// commit parent edges.
//
// Both inputs are peeled through annotated tags before commit traversal.
func (queries *Queries) IsAncestor(ancestor, descendant objectid.ObjectID) (bool, error) {
	query := queries.acquire()
	defer queries.release(query)

	return query.IsAncestor(ancestor, descendant)
}