[−][src]Module radicle_surf::vcs::git
use nonempty::NonEmpty; use radicle_surf::file_system::{Directory, File, Label, Path, SystemType}; use radicle_surf::file_system::unsound; use radicle_surf::vcs::git::*; use std::collections::HashMap; let repo = GitRepository::new("./data/git-platinum") .expect("Could not retrieve ./data/git-platinum as git repository"); let browser = GitBrowser::new(&repo).expect("Could not initialise Browser"); let directory = browser.get_directory().expect("Could not render Directory"); let mut directory_contents = directory.list_directory(); directory_contents.sort(); assert_eq!(directory_contents, vec![ SystemType::file(unsound::label::new(".i-am-well-hidden")), SystemType::file(unsound::label::new(".i-too-am-hidden")), SystemType::file(unsound::label::new("README.md")), SystemType::directory(unsound::label::new("bin")), SystemType::directory(unsound::label::new("src")), SystemType::directory(unsound::label::new("text")), SystemType::directory(unsound::label::new("this")), ]); // find src directory in the Git directory and the in-memory directory let src_directory = directory .find_directory(&Path::new(unsound::label::new("src"))) .unwrap(); let mut src_directory_contents = src_directory.list_directory(); src_directory_contents.sort(); assert_eq!(src_directory_contents, vec![ SystemType::file(unsound::label::new("Eval.hs")), SystemType::file(unsound::label::new("Folder.svelte")), SystemType::file(unsound::label::new("memory.rs")), ]);
Re-exports
pub use git2; |
Structs
Branch | The combination of a branch's name and where its locality (remote or local). |
BranchName | A newtype wrapper over |
GitRepository | Wrapper around the |
Sha1 | A newtype wrapper over |
TagName | A newtype wrapper over |
Enums
GitError | |
GitObject | An enumeration of git objects we can fetch and turn
into a |
Type Definitions
GitBrowser | A |
GitHistory | A |