aboutsummaryrefslogtreecommitdiff
path: root/src/vcs.rs
diff options
context:
space:
mode:
authorNerdyPepper <[email protected]>2019-05-20 15:26:19 +0100
committerNerdyPepper <[email protected]>2019-05-20 15:26:19 +0100
commitb297d4b7250ebb86d91a13ea535f0f32dc4388aa (patch)
treeb9366d6014a79bd4cc1dd2a099dacbfb0016449b /src/vcs.rs
parentf8a3b4d8d2b452f09e86f282ec0bd87dc57e71e8 (diff)
fixed: panics on empty local bare repos
Diffstat (limited to 'src/vcs.rs')
-rw-r--r--src/vcs.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vcs.rs b/src/vcs.rs
index 5bc194d..26edf81 100644
--- a/src/vcs.rs
+++ b/src/vcs.rs
@@ -21,7 +21,10 @@ pub fn vcs_status() -> Option<(colored::ColoredString, colored::ColoredString)>
21 return None 21 return None
22 } 22 }
23 let repo = repo.unwrap(); 23 let repo = repo.unwrap();
24 let reference = repo.head().unwrap(); 24 let reference = match repo.head() {
25 Ok(r) => r,
26 Err(_) => return None
27 };
25 let mut branch; 28 let mut branch;
26 29
27 if reference.is_branch() { 30 if reference.is_branch() {