aboutsummaryrefslogtreecommitdiff
path: root/supergit/src/branch.rs
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>),
}