aboutsummaryrefslogtreecommitdiff
path: root/supergit/src/branch.rs
diff options
context:
space:
mode:
authorKaiden Fey <kookie@spacekookie.de>2020-10-25 05:36:08 +0100
committerKatharina Fey <kookie@spacekookie.de>2020-10-25 05:36:08 +0100
commit63cd5d0a8d3f77c0267f12a6aef52533cc2f7d09 (patch)
treed46fb6058a6ade2726154fff76d5bda1d6dfc7e0 /supergit/src/branch.rs
parent392444d21101ce7b637f2e5a385490605f93ccf1 (diff)
Adding a whole lot of shit (octopus and supergit)
Diffstat (limited to 'supergit/src/branch.rs')
-rw-r--r--supergit/src/branch.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/supergit/src/branch.rs b/supergit/src/branch.rs
new file mode 100644
index 0000000..81abbff
--- /dev/null
+++ b/supergit/src/branch.rs
@@ -0,0 +1,22 @@
+use crate::{Commit, CommitId};
+
+/// Abstraction for a branch history slice
+pub struct Branch {
+ name: String,
+ head: CommitId,
+ history: Vec<BranchCommit>,
+}
+
+/// A commit represented as a relationship to a branch
+///
+/// Most commits will be simple, meaning they are in sequence on the
+/// branch. Two types of merge commits exist: normal, and octopus.
+/// All branches leading into this branch are a reverse tree
+pub enum BranchCommit {
+ /// A single commit
+ Commit(Commit),
+ /// A merge commit from one other branch
+ Merge(Branch),
+ /// An octopus merge with multiple branches
+ Octopus(Vec<Branch>),
+}