| 41 | } |
| 42 | |
| 43 | fn git(&self, root: &Path, args: &[&str]) -> Result<CommandOutput, ChangeSourceError> { |
| 44 | let mut spec = CommandSpec::new("git", root); |
| 45 | spec.args = args.iter().map(|arg| (*arg).to_owned()).collect(); |
| 46 | spec.env.insert("GIT_OPTIONAL_LOCKS".into(), "0".into()); |
| 47 | spec.timeout = self.timeout; |
| 48 | spec.max_output_bytes = self.max_candidates.saturating_mul(4096).max(64 * 1024); |
| 49 | self.runner.run(&spec) |
| 50 | } |
| 51 | |
| 52 | fn ensure_available(&self, root: &Path) -> Result<(), ChangeSourceError> { |
| 53 | let output = self.git(root, &["--version"])?; |