Skip to content

Commit 0aaa784

Browse files
committed
Fix empty branch list
1 parent a41a690 commit 0aaa784

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/print/unicode.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ type UnicodeGraphInfo = (Vec<String>, Vec<String>, Vec<usize>);
3737

3838
/// Creates a text-based visual representation of a graph.
3939
pub fn print_unicode(graph: &GitGraph, settings: &Settings) -> Result<UnicodeGraphInfo, String> {
40+
if graph.all_branches.len() == 0 {
41+
return Ok((vec![], vec![], vec![]));
42+
}
4043
let num_cols = 2 * graph
4144
.all_branches
4245
.iter()

0 commit comments

Comments
 (0)