From d0ecbaf1a4c23f85b04e0ea90f5fa69c75ae1108 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Mon, 9 May 2022 21:03:59 -0700 Subject: [PATCH] graphlog: don't de-indent multi-line text at end of chain --- src/graphlog.rs | 8 ++++---- tests/test_operations.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/graphlog.rs b/src/graphlog.rs index 1fa65896e..175678dd4 100644 --- a/src/graphlog.rs +++ b/src/graphlog.rs @@ -148,7 +148,7 @@ where self.maybe_write_pending_text()?; } - let pad_to_index = self.edges.len(); + let pad_to_index = self.edges.len() + if edges.is_empty() { 1 } else { 0 }; // Close any edges to missing nodes. for (i, edge) in edges.iter().enumerate().rev() { if *edge == Edge::Missing { @@ -479,7 +479,7 @@ mod tests { | o node 3 o | node 2 / more - | text + | text o node 1 "###); @@ -501,8 +501,8 @@ mod tests { | o node 2 | ~ o node 1 - more - text + more + text "###); Ok(()) diff --git a/tests/test_operations.rs b/tests/test_operations.rs index 3c49de2d6..82254c595 100644 --- a/tests/test_operations.rs +++ b/tests/test_operations.rs @@ -29,7 +29,7 @@ fn test_op_log() { @ | add workspace 'default' o - initialize repo + initialize repo "###); let add_workspace_id = stdout[2..14].to_string(); let initialize_repo_id = stdout.lines().nth(2).unwrap()[2..14].to_string();