aboutsummaryrefslogtreecommitdiff
path: root/commitquery/node.go
diff options
context:
space:
mode:
Diffstat (limited to 'commitquery/node.go')
-rw-r--r--commitquery/node.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/commitquery/node.go b/commitquery/node.go
new file mode 100644
index 00000000..cd357631
--- /dev/null
+++ b/commitquery/node.go
@@ -0,0 +1,39 @@
+package commitquery
+
+import (
+ commitgraphread "codeberg.org/lindenii/furgit/commitgraph/read"
+ "codeberg.org/lindenii/furgit/objectid"
+)
+
+// nodeIndex identifies one internal query node.
+type nodeIndex int
+
+// node stores one mutable commit traversal node.
+type node struct {
+ id objectid.ObjectID
+
+ parents []nodeIndex
+
+ commitTime int64
+ generation uint64
+
+ hasGeneration bool
+ hasGraphPos bool
+ loaded bool
+
+ graphPos commitgraphread.Position
+ marks markBits
+
+ touchedPhase uint32
+}
+
+// newNode allocates one empty internal node.
+func (query *Query) newNode(id objectid.ObjectID) nodeIndex {
+ count := len(query.nodes)
+
+ idx := nodeIndex(count)
+
+ query.nodes = append(query.nodes, node{id: id})
+
+ return idx
+}