From 37707aada0157f255dbad920b917efb601184e12 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 29 Mar 2026 13:38:19 +0000 Subject: commitquery: Reorganize --- commitquery/populate.go | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 commitquery/populate.go (limited to 'commitquery/populate.go') diff --git a/commitquery/populate.go b/commitquery/populate.go deleted file mode 100644 index 26fb5629..00000000 --- a/commitquery/populate.go +++ /dev/null @@ -1,42 +0,0 @@ -package commitquery - -import "fmt" - -// populateNode fills one node's metadata and resolves its parents. -func (query *query) populateNode(idx nodeIndex, commit commitData) error { - if query.nodes[idx].loaded { - if query.nodes[idx].id != commit.ID { - return fmt.Errorf("commitquery: node identity mismatch: have %s, got %s", query.nodes[idx].id, commit.ID) - } - - return nil - } - - query.nodes[idx].id = commit.ID - query.nodes[idx].commitTime = commit.CommitTime - query.nodes[idx].generation = commit.Generation - query.nodes[idx].hasGeneration = commit.HasGeneration - - if commit.HasGraphPos { - query.nodes[idx].graphPos = commit.GraphPos - query.nodes[idx].hasGraphPos = true - query.byGraphPos[commit.GraphPos] = idx - } - - query.nodes[idx].loaded = true - query.nodes[idx].parents = query.nodes[idx].parents[:0] - - for _, parent := range commit.Parents { - parentIdx, err := query.resolveParent(parent) - if err != nil { - query.nodes[idx].loaded = false - query.nodes[idx].parents = nil - - return err - } - - query.nodes[idx].parents = append(query.nodes[idx].parents, parentIdx) - } - - return nil -} -- cgit v1.3.1-10-gc9f91