Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-vcs/src/lib.rs')
| -rw-r--r-- | helix-vcs/src/lib.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/helix-vcs/src/lib.rs b/helix-vcs/src/lib.rs index 4c5f2036..539be779 100644 --- a/helix-vcs/src/lib.rs +++ b/helix-vcs/src/lib.rs @@ -1,7 +1,3 @@ -//! `helix_vcs` provides types for working with diffs from a Version Control System (VCS). -//! Currently `git` is the only supported provider for diffs, but this architecture allows -//! for other providers to be added in the future. - use anyhow::{anyhow, bail, Result}; use arc_swap::ArcSwap; use std::{ @@ -20,16 +16,12 @@ mod status; pub use status::FileChange; -/// Contains all active diff providers. Diff providers are compiled in via features. Currently -/// only `git` is supported. #[derive(Clone)] pub struct DiffProviderRegistry { providers: Vec<DiffProvider>, } impl DiffProviderRegistry { - /// Get the given file from the VCS. This provides the unedited document as a "base" - /// for a diff to be created. pub fn get_diff_base(&self, file: &Path) -> Option<Vec<u8>> { self.providers .iter() @@ -43,7 +35,6 @@ impl DiffProviderRegistry { }) } - /// Get the current name of the current [HEAD](https://stackoverflow.com/questions/2304087/what-is-head-in-git). pub fn get_current_head_name(&self, file: &Path) -> Option<Arc<ArcSwap<Box<str>>>> { self.providers .iter() @@ -84,7 +75,6 @@ impl Default for DiffProviderRegistry { let providers = vec![ #[cfg(feature = "git")] DiffProvider::Git, - DiffProvider::None, ]; DiffProviderRegistry { providers } } @@ -95,7 +85,7 @@ impl Default for DiffProviderRegistry { /// /// `Copy` is simply to ensure the `clone()` call is the simplest it can be. #[derive(Copy, Clone)] -enum DiffProvider { +pub enum DiffProvider { #[cfg(feature = "git")] Git, None, |