Skip to content

Commit a1eb9ee

Browse files
committed
fix(cli): Give space after each subtree
After gitext-rs#207, we ended up with ``` 8dc84dc net: phy: broadcom: Enable 10BaseT DAC early wake ├─┐ │ ⌽ slow (ready) slow │ ⌽ master (no remote) Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)" ⌽ 551acdc Merge tag 'net-5.17-final' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net ├─┐ │ ⌽ linux-5.17.y (no remote) Linux 5.17 │ ⌽ wmo/linux-5.17.y-backports (no remote) net: dsa: mv88e6xxx: Fill in STU support for all supported chips │ ⌽ wmo/linux-5.17.y (pushed) net: dsa: Backport Marvell Peridot cmode fix from Netbox ⌽ net-bridge-host-l2-multicast (no remote) selftests: forwarding: verify flood of known mc on mcast_router port ``` We were giving space after the first gap but not subsequent. We needed something more like a `join` operation. Now we do.
1 parent 4ff26da commit a1eb9ee

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

src/bin/git-stack/stack.rs

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,10 +1275,11 @@ impl<'r> Tree<'r> {
12751275
}
12761276
tree.push(stack_tree);
12771277
} else {
1278-
if i != 0 && !stack.is_empty() {
1279-
tree.push(termtree::Tree::root(joint).with_glyphs(SPACE_GLYPHS));
1280-
}
1281-
for child_tree in stack.into_iter() {
1278+
let stack_len = stack.len();
1279+
for (j, child_tree) in stack.into_iter().enumerate() {
1280+
if i != 0 && j == 0 {
1281+
tree.push(termtree::Tree::root(joint).with_glyphs(SPACE_GLYPHS));
1282+
}
12821283
let child = RenderNode {
12831284
repo,
12841285
head_branch,
@@ -1287,17 +1288,23 @@ impl<'r> Tree<'r> {
12871288
palette,
12881289
};
12891290
tree.push(termtree::Tree::root(child).with_glyphs(GLYPHS));
1290-
for child_stack in child_tree.stacks.into_iter() {
1291-
let mut stack_tree = termtree::Tree::root(joint).with_glyphs(JOINT_GLYPHS);
1292-
for child_tree in child_stack.into_iter() {
1293-
stack_tree.push(child_tree.into_display(
1294-
repo,
1295-
head_branch,
1296-
protected_branches,
1297-
palette,
1298-
));
1291+
if !child_tree.stacks.is_empty() {
1292+
for child_stack in child_tree.stacks.into_iter() {
1293+
let mut stack_tree =
1294+
termtree::Tree::root(joint).with_glyphs(JOINT_GLYPHS);
1295+
for child_tree in child_stack.into_iter() {
1296+
stack_tree.push(child_tree.into_display(
1297+
repo,
1298+
head_branch,
1299+
protected_branches,
1300+
palette,
1301+
));
1302+
}
1303+
tree.push(stack_tree);
1304+
}
1305+
if j < stack_len {
1306+
tree.push(termtree::Tree::root(joint).with_glyphs(SPACE_GLYPHS));
12991307
}
1300-
tree.push(stack_tree);
13011308
}
13021309
}
13031310
}

0 commit comments

Comments
 (0)