diff options
| author | Mica White <botahamec@outlook.com> | 2026-06-20 09:04:33 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-06-20 09:04:33 -0400 |
| commit | 1897aa4c604a0d9ab81f84dbff687b7f42bc1f0f (patch) | |
| tree | 8ed0db5fc0342dc221bb63e431d4012ec7c27c3b /src/utils.rs | |
| parent | 230a1e6987a322077f4b7ed16392ef4372285307 (diff) | |
Diffstat (limited to 'src/utils.rs')
| -rw-r--r-- | src/utils.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils.rs b/src/utils.rs index dc0c082..9b868eb 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -15,8 +15,8 @@ pub enum TreeError { pub fn current_branch_ref(repository: &Repository) -> Result<String, git2::Error> { let head = repository.head()?; let ref_name = match head.kind() { - Some(git2::ReferenceType::Symbolic) => head.symbolic_target(), - _ => head.name(), + Some(git2::ReferenceType::Symbolic) => head.symbolic_target()?, + _ => Some(head.name()?), } .ok_or(git2::Error::new( git2::ErrorCode::Invalid, |
