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/populate.go | |
| parent | research: Maybe drop mmap in packfile_bloom (diff) | |
| signature | No signature | |
commitquery: Merge from ancestor and mergebases
Diffstat (limited to 'internal/commitquery/populate.go')
| -rw-r--r-- | internal/commitquery/populate.go | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/internal/commitquery/populate.go b/internal/commitquery/populate.go deleted file mode 100644 index 87d65bf8..00000000 --- a/internal/commitquery/populate.go +++ /dev/null @@ -1,42 +0,0 @@ -package commitquery - -import "fmt" - -// populateNode fills one node's metadata and resolves its parents. -func (ctx *Context) populateNode(idx NodeIndex, commit Commit) error { - if ctx.nodes[idx].loaded { - if ctx.nodes[idx].id != commit.ID { - return fmt.Errorf("commitquery: node identity mismatch: have %s, got %s", ctx.nodes[idx].id, commit.ID) - } - - return nil - } - - ctx.nodes[idx].id = commit.ID - ctx.nodes[idx].commitTime = commit.CommitTime - ctx.nodes[idx].generation = commit.Generation - ctx.nodes[idx].hasGeneration = commit.HasGeneration - - if commit.HasGraphPos { - ctx.nodes[idx].graphPos = commit.GraphPos - ctx.nodes[idx].hasGraphPos = true - ctx.byGraphPos[commit.GraphPos] = idx - } - - ctx.nodes[idx].loaded = true - ctx.nodes[idx].parents = ctx.nodes[idx].parents[:0] - - for _, parent := range commit.Parents { - parentIdx, err := ctx.resolveParent(parent) - if err != nil { - ctx.nodes[idx].loaded = false - ctx.nodes[idx].parents = nil - - return err - } - - ctx.nodes[idx].parents = append(ctx.nodes[idx].parents, parentIdx) - } - - return nil -} |
