Unified · Split
| @@ -69,7 +69,7 @@ max-performance = [ "git-features/fast-sha1", · 68 unmodified lines | ||
| 69 | 69 | "git-pack/pack-cache-lru-dynamic"] |
| 70 | 70 | ## Re-export stability tier 2 crates for convenience and make `Repository` struct fields with types from these crates publicly accessible. |
| 71 | 71 | ## Doing so is less stable than the stability tier 1 that `git-repository` is a member of. |
| 72 | −unstable = ["git-index", "git-mailmap", "git-glob", "git-credentials", "git-attributes"] | |
| 72 | +unstable = ["git-mailmap", "git-credentials"] | |
| 73 | 73 | ## Print debugging information about usage of object database caches, useful for tuning cache sizes. |
| 74 | 74 | cache-efficiency-debug = ["git-features/cache-efficiency-debug"] |
| 75 | 75 | |
| @@ -102,10 +102,10 @@ git-mailmap = { version = "^0.3.0", path = "../git-mailmap", optional = true } · 26 unmodified lines | ||
| 102 | 102 | git-features = { version = "^0.22.0", path = "../git-features", features = ["progress", "once_cell"] } |
| 103 | 103 | |
| 104 | 104 | # unstable only |
| 105 | −git-attributes = { version = "^0.3.0", path = "../git-attributes", optional = true } | |
| 106 | −git-glob = { version = "^0.3.1", path = "../git-glob", optional = true } | |
| 105 | +git-attributes = { version = "^0.3.0", path = "../git-attributes" } | |
| 106 | +git-glob = { version = "^0.3.1", path = "../git-glob" } | |
| 107 | 107 | git-credentials = { version = "^0.3.0", path = "../git-credentials", optional = true } |
| 108 | −git-index = { version = "^0.4.0", path = "../git-index", optional = true } | |
| 108 | +git-index = { version = "^0.4.0", path = "../git-index" } | |
| 109 | 109 | git-worktree = { version = "^0.4.0", path = "../git-worktree" } |
| 110 | 110 | |
| 111 | 111 | signal-hook = { version = "0.3.9", default-features = false } |
| @@ -242,7 +242,6 @@ impl Cache { · 241 unmodified lines | ||
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | /// Return a path by using the `$XDF_CONFIG_HOME` or `$HOME/.config/…` environment variables locations. |
| 245 | − #[cfg_attr(not(feature = "git-index"), allow(dead_code))] | |
| 246 | 245 | pub fn xdg_config_path( |
| 247 | 246 | &self, |
| 248 | 247 | resource_file_name: &str, |
| @@ -63,13 +63,10 @@ pub(crate) struct Cache { · 62 unmodified lines | ||
| 63 | 63 | /// The object kind to pick if a prefix is ambiguous. |
| 64 | 64 | pub object_kind_hint: Option<spec::parse::ObjectKindHint>, |
| 65 | 65 | /// If true, we are on a case-insensitive file system. |
| 66 | − #[cfg_attr(not(feature = "git-index"), allow(dead_code))] | |
| 67 | 66 | pub ignore_case: bool, |
| 68 | 67 | /// The path to the user-level excludes file to ignore certain files in the worktree. |
| 69 | − #[cfg_attr(not(feature = "git-index"), allow(dead_code))] | |
| 70 | 68 | pub excludes_file: Option<std::path::PathBuf>, |
| 71 | 69 | /// Define how we can use values obtained with `xdg_config(…)` and its `XDG_CONFIG_HOME` variable. |
| 72 | − #[cfg_attr(not(feature = "git-index"), allow(dead_code))] | |
| 73 | 70 | xdg_config_home_env: permission::env_var::Resource, |
| 74 | 71 | /// Define how we can use values obtained with `xdg_config(…)`. and its `HOME` variable. |
| 75 | 72 | home_env: permission::env_var::Resource, |
| @@ -126,7 +126,7 @@ · 125 unmodified lines | ||
| 126 | 126 | // This also means that their major version changes affect our major version, but that's alright as we directly expose their |
| 127 | 127 | // APIs/instances anyway. |
| 128 | 128 | pub use git_actor as actor; |
| 129 | −#[cfg(all(feature = "unstable", feature = "git-attributes"))] | |
| 129 | +#[cfg(all(feature = "unstable"))] | |
| 130 | 130 | pub use git_attributes as attrs; |
| 131 | 131 | #[cfg(all(feature = "unstable", feature = "git-credentials"))] |
| 132 | 132 | pub use git_credentials as credentials; |
| @@ -137,11 +137,11 @@ pub use git_diff as diff; · 4 unmodified lines | ||
| 137 | 137 | use git_features::threading::OwnShared; |
| 138 | 138 | #[cfg(feature = "unstable")] |
| 139 | 139 | pub use git_features::{parallel, progress, progress::Progress, threading}; |
| 140 | −#[cfg(all(feature = "unstable", feature = "git-glob"))] | |
| 140 | +#[cfg(feature = "unstable")] | |
| 141 | 141 | pub use git_glob as glob; |
| 142 | 142 | pub use git_hash as hash; |
| 143 | 143 | #[doc(inline)] |
| 144 | −#[cfg(all(feature = "unstable", feature = "git-index"))] | |
| 144 | +#[cfg(feature = "unstable")] | |
| 145 | 145 | pub use git_index as index; |
| 146 | 146 | pub use git_lock as lock; |
| 147 | 147 | pub use git_object as objs; |
| @@ -3,7 +3,7 @@ pub use git_mailmap::*; · 2 unmodified lines | ||
| 3 | 3 | |
| 4 | 4 | /// |
| 5 | 5 | pub mod load { |
| 6 | − /// The error returned by [`crate::Repository::load_mailmap_into()`]. | |
| 6 | + /// The error returned by [`crate::Repository::open_mailmap_into()`]. | |
| 7 | 7 | #[derive(Debug, thiserror::Error)] |
| 8 | 8 | #[allow(missing_docs)] |
| 9 | 9 | pub enum Error { |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | impl crate::Repository { |
| 2 | 2 | // TODO: tests |
| 3 | − /// Similar to [`load_mailmap_into()`][crate::Repository::load_mailmap_into()], but ignores all errors and returns at worst | |
| 3 | + /// Similar to [`open_mailmap_into()`][crate::Repository::open_mailmap_into()], but ignores all errors and returns at worst | |
| 4 | 4 | /// an empty mailmap, e.g. if there is no mailmap or if there were errors loading them. |
| 5 | 5 | /// |
| 6 | 6 | /// This represents typical usage within git, which also works with what's there without considering a populated mailmap |
| @@ -68,7 +68,6 @@ impl crate::Repository { · 67 unmodified lines | ||
| 68 | 68 | /// It will use the `index.threads` configuration key to learn how many threads to use. |
| 69 | 69 | /// Note that it may fail if there is no index. |
| 70 | 70 | // TODO: test |
| 71 | − #[cfg(feature = "git-index")] | |
| 72 | 71 | pub fn open_index(&self) -> Result<git_index::File, worktree::open_index::Error> { |
| 73 | 72 | use std::convert::{TryFrom, TryInto}; |
| 74 | 73 | let thread_limit = self |
| @@ -6,7 +6,6 @@ use crate::head; · 5 unmodified lines | ||
| 6 | 6 | |
| 7 | 7 | /// A worktree checkout containing the files of the repository in consumable form. |
| 8 | 8 | pub struct Worktree<'repo> { |
| 9 | − #[cfg_attr(not(feature = "git-index"), allow(dead_code))] | |
| 10 | 9 | pub(crate) parent: &'repo Repository, |
| 11 | 10 | /// The root path of the checkout. |
| 12 | 11 | pub(crate) path: &'repo std::path::Path, |
| @@ -70,7 +70,6 @@ pub(crate) fn id(git_dir: &std::path::Path, has_common_dir: bool) -> Option<&BSt · 69 unmodified lines | ||
| 70 | 70 | pub mod proxy; |
| 71 | 71 | |
| 72 | 72 | /// |
| 73 | −#[cfg(feature = "git-index")] | |
| 74 | 73 | pub mod open_index { |
| 75 | 74 | use crate::bstr::BString; |
| 76 | 75 | |
| @@ -102,7 +101,6 @@ pub mod open_index { · 25 unmodified lines | ||
| 102 | 101 | } |
| 103 | 102 | |
| 104 | 103 | /// |
| 105 | −#[cfg(feature = "git-index")] | |
| 106 | 104 | pub mod excludes { |
| 107 | 105 | use std::path::PathBuf; |
| 108 | 106 | |
| @@ -9,9 +9,10 @@ mod worktree; · 8 unmodified lines | ||
| 9 | 9 | |
| 10 | 10 | #[test] |
| 11 | 11 | fn size_in_memory() { |
| 12 | − assert_eq!( | |
| 13 | − std::mem::size_of::<Repository>(), | |
| 14 | − 696, | |
| 15 | − "size of Repository shouldn't change without us noticing, it's meant to be cloned" | |
| 12 | + let expected = [688, 696]; | |
| 13 | + assert!( | |
| 14 | + expected.contains(&std::mem::size_of::<Repository>()), | |
| 15 | + "size of Repository shouldn't change without us noticing, it's meant to be cloned: should have been within {:?}", | |
| 16 | + expected | |
| 16 | 17 | ); |
| 17 | 18 | } |