diff options
author | NerdyPepper <[email protected]> | 2019-05-20 15:26:19 +0100 |
---|---|---|
committer | NerdyPepper <[email protected]> | 2019-05-20 15:26:19 +0100 |
commit | b297d4b7250ebb86d91a13ea535f0f32dc4388aa (patch) | |
tree | b9366d6014a79bd4cc1dd2a099dacbfb0016449b | |
parent | f8a3b4d8d2b452f09e86f282ec0bd87dc57e71e8 (diff) |
fixed: panics on empty local bare repos
-rw-r--r-- | src/vcs.rs | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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() { |