Unified · Split
| @@ -26,7 +26,7 @@ impl Context { · 25 unmodified lines | |||
| 26 | ) -> anyhow::Result<Self> { | 26 | ) -> anyhow::Result<Self> { |
| 27 | let meta = cargo_metadata::MetadataCommand::new().exec()?; | 27 | let meta = cargo_metadata::MetadataCommand::new().exec()?; |
| 28 | let root = meta.workspace_root.clone(); | 28 | let root = meta.workspace_root.clone(); |
| 29 | let repo = git::discover(&root)?.apply_environment(); | 29 | let repo = git::discover(&root)?; |
| 30 | let crates_index = crate::crates_index::Index::new_cargo_default()?; | 30 | let crates_index = crate::crates_index::Index::new_cargo_default()?; |
| 31 | let history = (force_history_segmentation | 31 | let history = (force_history_segmentation |
| 32 | || matches!(bump, BumpSpec::Auto) | 32 | || matches!(bump, BumpSpec::Auto) |
| @@ -53,7 +53,7 @@ where · 52 unmodified lines | |||
| 53 | W: io::Write, | 53 | W: io::Write, |
| 54 | P: Progress, | 54 | P: Progress, |
| 55 | { | 55 | { |
| 56 | let repo = git::discover(working_dir)?.apply_environment(); | 56 | let repo = git::discover(working_dir)?; |
| 57 | let commit_id = repo.rev_parse_single(rev_spec)?.detach(); | 57 | let commit_id = repo.rev_parse_single(rev_spec)?.detach(); |
| 58 | let mut string_heap = BTreeSet::<&'static [u8]>::new(); | 58 | let mut string_heap = BTreeSet::<&'static [u8]>::new(); |
| 59 | let needs_stats = file_stats || line_stats; | 59 | let needs_stats = file_stats || line_stats; |
| @@ -26,9 +26,7 @@ pub fn checkout_exclusive( · 25 unmodified lines | |||
| 26 | thread_limit, | 26 | thread_limit, |
| 27 | }: index::checkout_exclusive::Options, | 27 | }: index::checkout_exclusive::Options, |
| 28 | ) -> anyhow::Result<()> { | 28 | ) -> anyhow::Result<()> { |
| 29 | let repo = repo | 29 | let repo = repo.map(git_repository::discover).transpose()?; |
| 30 | .map(|dir| git_repository::discover(dir).map(|r| r.apply_environment())) | ||
| 31 | .transpose()?; | ||
| 32 | 30 | ||
| 33 | let dest_directory = dest_directory.as_ref(); | 31 | let dest_directory = dest_directory.as_ref(); |
| 34 | if dest_directory.exists() { | 32 | if dest_directory.exists() { |
| @@ -89,8 +89,7 @@ pub fn main() -> Result<()> { · 88 unmodified lines | |||
| 89 | mapping.full.modify(to_match_settings); | 89 | mapping.full.modify(to_match_settings); |
| 90 | mapping.reduced.modify(to_match_settings); | 90 | mapping.reduced.modify(to_match_settings); |
| 91 | let mut repo = git::ThreadSafeRepository::discover_opts(repository, Default::default(), mapping) | 91 | let mut repo = git::ThreadSafeRepository::discover_opts(repository, Default::default(), mapping) |
| 92 | .map(git::Repository::from) | 92 | .map(git::Repository::from)?; |
| 93 | .map(|r| r.apply_environment())?; | ||
| 94 | if !config.is_empty() { | 93 | if !config.is_empty() { |
| 95 | repo.config_snapshot_mut() | 94 | repo.config_snapshot_mut() |
| 96 | .append_config(config.iter(), git::config::Source::Cli) | 95 | .append_config(config.iter(), git::config::Source::Cli) |