diff options
| author | 2026-03-11 20:41:32 +0800 | |
|---|---|---|
| committer | 2026-03-11 20:41:32 +0800 | |
| commit | 040b572d95e4ca27e1ada6113c405b8a1eb4a669 (patch) | |
| tree | 68d826f4d91144105802c9d1c67175ba9b314e29 /internal/commitquery/ancestor.go | |
| parent | research: Maybe drop mmap in packfile_bloom (diff) | |
| signature | No signature | |
commitquery: Merge from ancestor and mergebases
Diffstat (limited to 'internal/commitquery/ancestor.go')
| -rw-r--r-- | internal/commitquery/ancestor.go | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/internal/commitquery/ancestor.go b/internal/commitquery/ancestor.go deleted file mode 100644 index d050ce08..00000000 --- a/internal/commitquery/ancestor.go +++ /dev/null @@ -1,30 +0,0 @@ -package commitquery - -// IsAncestor reports whether ancestor is reachable from descendant through -// commit parent edges. -func IsAncestor(ctx *Context, ancestor, descendant NodeIndex) (bool, error) { - if ancestor == descendant { - return true, nil - } - - ancestorGeneration := ctx.EffectiveGeneration(ancestor) - descendantGeneration := ctx.EffectiveGeneration(descendant) - - if ancestorGeneration != generationInfinity && - descendantGeneration != generationInfinity && - ancestorGeneration > descendantGeneration { - return false, nil - } - - minGeneration := uint64(0) - if ancestorGeneration != generationInfinity { - minGeneration = ancestorGeneration - } - - err := paintDownToCommon(ctx, ancestor, []NodeIndex{descendant}, minGeneration) - if err != nil { - return false, err - } - - return ctx.HasAnyMarks(ancestor, markRight), nil -} |
