From 63cd5d0a8d3f77c0267f12a6aef52533cc2f7d09 Mon Sep 17 00:00:00 2001 From: Kaiden Fey Date: Sun, 25 Oct 2020 05:36:08 +0100 Subject: Adding a whole lot of shit (octopus and supergit) --- supergit/src/branch.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 supergit/src/branch.rs (limited to 'supergit/src/branch.rs') 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, +} + +/// 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), +} -- cgit v1.2.3