pub fn check( root: &Path, base: Option<&str>, head: &str, mode: GateMode, json: bool, ) -> Result<()>