| @@ -100,7 +100,10 @@ impl Cache { · 99 unmodified lines |
| 100 | /// Collect everything needed to checkout files into a worktree. | 100 | /// Collect everything needed to checkout files into a worktree. |
| 101 | /// Note that some of the options being returned will be defaulted so safe settings, the caller might have to override them | 101 | /// Note that some of the options being returned will be defaulted so safe settings, the caller might have to override them |
| 102 | /// depending on the use-case. | 102 | /// depending on the use-case. |
| 103 | pub(crate) fn checkout_options(&self) -> Result<git_worktree::index::checkout::Options, checkout_options::Error> { | 103 | pub(crate) fn checkout_options( |
| | 104 | &self, |
| | 105 | git_dir: &std::path::Path, |
| | 106 | ) -> Result<git_worktree::index::checkout::Options, checkout_options::Error> { |
| 104 | fn checkout_thread_limit_from_config( | 107 | fn checkout_thread_limit_from_config( |
| 105 | config: &git_config::File<'static>, | 108 | config: &git_config::File<'static>, |
| 106 | ) -> Option<Result<usize, checkout_options::Error>> { | 109 | ) -> Option<Result<usize, checkout_options::Error>> { |
| @@ -128,12 +131,15 @@ impl Cache { · 21 unmodified lines |
| 128 | .unwrap_or(default)) | 131 | .unwrap_or(default)) |
| 129 | } | 132 | } |
| 130 | | 133 | |
| 131 | fn assemble_attribute_globals(me: &Cache) -> Result<git_attributes::MatchGroup, checkout_options::Error> { | 134 | fn assemble_attribute_globals( |
| | 135 | me: &Cache, |
| | 136 | _git_dir: &std::path::Path, |
| | 137 | ) -> Result<git_attributes::MatchGroup, checkout_options::Error> { |
| 132 | let _attributes_file = match me.trusted_file_path("core", None, "attributesFile").transpose()? { | 138 | let _attributes_file = match me.trusted_file_path("core", None, "attributesFile").transpose()? { |
| 133 | Some(attributes) => Some(attributes.into_owned()), | 139 | Some(attributes) => Some(attributes.into_owned()), |
| 134 | None => me.xdg_config_path("attributes").ok().flatten(), | 140 | None => me.xdg_config_path("attributes").ok().flatten(), |
| 135 | }; | 141 | }; |
| 136 | // let group = git_attributes::MatchGroup::<git_attributes::Attributes>::from_git_dir() | 142 | // TODO: implement git_attributes::MatchGroup::<git_attributes::Attributes>::from_git_dir(), similar to what's done for `Ignore`. |
| 137 | Ok(Default::default()) | 143 | Ok(Default::default()) |
| 138 | } | 144 | } |
| 139 | | 145 | |
| @@ -154,7 +160,7 @@ impl Cache { · 14 unmodified lines |
| 154 | .resolved | 160 | .resolved |
| 155 | .string("core", None, "checkStat") | 161 | .string("core", None, "checkStat") |
| 156 | .map_or(true, |v| v.as_ref() != "minimal"), | 162 | .map_or(true, |v| v.as_ref() != "minimal"), |
| 157 | attribute_globals: assemble_attribute_globals(self)?, | 163 | attribute_globals: assemble_attribute_globals(self, git_dir)?, |
| 158 | }) | 164 | }) |
| 159 | } | 165 | } |
| 160 | pub(crate) fn xdg_config_path( | 166 | pub(crate) fn xdg_config_path( |