File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -138,12 +138,14 @@ pub struct EspIdf {
138
138
#[ derive( Debug , Clone ) ]
139
139
pub enum SourceTree {
140
140
Git ( git:: Repository ) ,
141
+ Plain ( PathBuf ) ,
141
142
}
142
143
143
144
impl SourceTree {
144
145
pub fn path ( & self ) -> & Path {
145
146
match self {
146
147
SourceTree :: Git ( repo) => repo. worktree ( ) ,
148
+ SourceTree :: Plain ( path) => path,
147
149
}
148
150
}
149
151
}
@@ -155,9 +157,9 @@ impl EspIdf {
155
157
let idf_path = env:: var_os ( IDF_PATH_VAR ) . ok_or_else ( || {
156
158
FromEnvError :: NoRepo ( anyhow ! ( "environment variable `{IDF_PATH_VAR}` not found" ) )
157
159
} ) ?;
158
- let tree = match git:: Repository :: open ( idf_path) {
160
+ let tree = match git:: Repository :: open ( & idf_path) {
159
161
Ok ( repo) => SourceTree :: Git ( repo) ,
160
- Err ( e ) => { return Err ( FromEnvError :: NoRepo ( e ) ) ; }
162
+ Err ( _ ) => SourceTree :: Plain ( PathBuf :: from ( idf_path ) ) ,
161
163
} ;
162
164
163
165
let path_var = env:: var_os ( "PATH" ) . unwrap_or_default ( ) ;
You can’t perform that action at this time.
0 commit comments