Something went wrong. Try again.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041//! No `git` on PATH is not the same as no checkout.//!//! The checkout probes answer "is this a repository" through git's exit//! status, and a spawn failure used to become `false` — so a sandbox without//! git was told to cd into the repository it was already standing in.//!//! The command runs inside a real checkout, so the only thing missing is the//! binary. `/nonexistent` is a PATH no process can resolve `git` through.
#![cfg(test)]
mod support;
use support::Scenario;
#[test]fn a_missing_git_is_reported_as_missing_not_as_a_missing_checkout() { let world = Scenario::new("no-git"); let run = world .command(&["pr", "list"]) .env("PATH", "/nonexistent") .finish();
assert_eq!( run.code, Some(2), "a missing binary is a usage failure\n--- stderr ---\n{}", run.stderr ); assert!( run.stderr.contains("git is not installed or not on PATH"), "the message has to name git\n--- stderr ---\n{}", run.stderr ); assert!( !run.stderr.contains("not a git repository"), "atgc is standing in a repository; git is what is absent\n--- stderr ---\n{}", run.stderr );}