diff options
Diffstat (limited to 'apps/servers/octopus/supergit/src/raw/branch.rs')
-rw-r--r-- | apps/servers/octopus/supergit/src/raw/branch.rs | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/apps/servers/octopus/supergit/src/raw/branch.rs b/apps/servers/octopus/supergit/src/raw/branch.rs deleted file mode 100644 index 1e2d27ad9c20..000000000000 --- a/apps/servers/octopus/supergit/src/raw/branch.rs +++ /dev/null @@ -1,51 +0,0 @@ -use super::{HashId, RawRepository}; -use crate::Branch; -use git2::{Commit, Repository}; - -/// Represent some raw branch metadata -pub struct RawBranch { - pub name: String, - pub head: HashId, -} - -fn print_commit(i: &String, c: &Commit) { - println!( - "{}{}: {}", - i, - c.id().to_string(), - c.message().unwrap().trim().split("\n").nth(0).unwrap() - ); -} - -fn print_parent_tree(c: &Commit, indent: String) { - c.parents().for_each(|c| { - println!( - "{}{}: {}", - indent, - c.id().to_string(), - c.message().unwrap().trim().split("\n").nth(0).unwrap() - ); - - print_parent_tree(&c, indent.clone()); - }); -} - -impl RawBranch { - /// Consume branch reference and enumerate real branch history - pub fn into_branch(self, repo: &mut RawRepository) -> Branch { - todo!() - } - - /// **REMOVE ME** A test function to do some test things - pub fn enumerate(&self, indent: String, repo: &Repository) { - let c = repo.find_commit((&self.head).into()).unwrap(); - println!( - "{}{}: {}", - indent, - c.id().to_string(), - c.message().unwrap().trim().split("\n").nth(0).unwrap() - ); - - print_parent_tree(&c, indent); - } -} |