File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ struct Configuration {
216
216
}
217
217
218
218
fn get_configuration ( ) -> Result < Configuration > {
219
- let repo = Repository :: open ( "./" ) . map_err ( |_| Error :: GitNotInstalled ) ?;
219
+ let repo = Repository :: open ( "./" ) . map_err ( |_| Error :: NotGitRepo ) ?;
220
220
let config = repo. config ( ) . map_err ( |_| Error :: NoGitData ) ?;
221
221
let mut remote_url = String :: new ( ) ;
222
222
let mut repository_name = String :: new ( ) ;
@@ -409,6 +409,8 @@ enum Error {
409
409
NoGitData ,
410
410
/// An IO error occoured while reading ./
411
411
ReadDirectory ,
412
+ /// Not in a Git Repo
413
+ NotGitRepo ,
412
414
}
413
415
414
416
impl fmt:: Debug for Error {
@@ -417,7 +419,8 @@ impl fmt::Debug for Error {
417
419
Error :: SourceCodeNotFound => "Could not find any source code in this directory" ,
418
420
Error :: GitNotInstalled => "Git failed to execute" ,
419
421
Error :: NoGitData => "Could not retrieve git configuration data" ,
420
- Error :: ReadDirectory => "Could read directory ./" ,
422
+ Error :: ReadDirectory => "Could not read directory ./" ,
423
+ Error :: NotGitRepo => "You are not at the root of a Git Repo" ,
421
424
} ;
422
425
write ! ( f, "{}" , content)
423
426
}
You can’t perform that action at this time.
0 commit comments