1
1
use anyhow:: Result ;
2
+ use std:: io:: ErrorKind ;
2
3
use std:: path:: { Path , PathBuf } ;
3
- use std:: { io:: ErrorKind , process:: ExitStatus } ;
4
4
use tokio:: process:: Command ;
5
5
use url:: Url ;
6
6
@@ -64,7 +64,7 @@ impl GitSource {
64
64
// TODO: the following and templates/git.rs are duplicates
65
65
66
66
pub ( crate ) enum GitError {
67
- ProgramFailed ( ExitStatus , Vec < u8 > ) ,
67
+ ProgramFailed ( Vec < u8 > ) ,
68
68
ProgramNotFound ,
69
69
Other ( anyhow:: Error ) ,
70
70
}
@@ -74,7 +74,7 @@ impl std::fmt::Display for GitError {
74
74
match self {
75
75
Self :: ProgramNotFound => f. write_str ( "`git` command not found - is git installed?" ) ,
76
76
Self :: Other ( e) => e. fmt ( f) ,
77
- Self :: ProgramFailed ( _ , stderr) => match std:: str:: from_utf8 ( stderr) {
77
+ Self :: ProgramFailed ( stderr) => match std:: str:: from_utf8 ( stderr) {
78
78
Ok ( s) => f. write_str ( s) ,
79
79
Err ( _) => f. write_str ( "(cannot get error)" ) ,
80
80
} ,
@@ -93,7 +93,7 @@ impl UnderstandGitResult for Result<std::process::Output, std::io::Error> {
93
93
if output. status . success ( ) {
94
94
Ok ( output. stdout )
95
95
} else {
96
- Err ( GitError :: ProgramFailed ( output. status , output . stderr ) )
96
+ Err ( GitError :: ProgramFailed ( output. stderr ) )
97
97
}
98
98
}
99
99
Err ( e) => match e. kind ( ) {
0 commit comments