File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,11 @@ pub fn get_paths_from_cmd(paths_cmd: &str) -> Result<Vec<AbsPath>> {
162162 . output ( )
163163 . context ( "failed to run provided paths_cmd" ) ?;
164164
165+ ensure ! (
166+ output. status. success( ) ,
167+ format!( "Failed to run provided paths_cmd: '{}'" , paths_cmd)
168+ ) ;
169+
165170 let files = std:: str:: from_utf8 ( & output. stdout ) . context ( "failed to parse paths_cmd output" ) ?;
166171 let files = files
167172 . lines ( )
@@ -331,6 +336,12 @@ mod tests {
331336 Ok ( ( ) )
332337 }
333338
339+ #[ test]
340+ fn invalid_get_paths_from_cmd_fails ( ) -> ( ) {
341+ assert ! ( get_paths_from_cmd( "asoidjfoaisdjf" ) . is_err( ) ) ;
342+ assert ! ( get_paths_from_cmd( "false" ) . is_err( ) ) ;
343+ }
344+
334345 #[ test]
335346 fn merge_base_with ( ) -> Result < ( ) > {
336347 let git = GitCheckout :: new ( ) ?;
You can’t perform that action at this time.
0 commit comments