Преглед изворни кода

Migrate branch --column to use format_columns()

Jelmer Vernooij пре 2 месеци
родитељ
комит
6761404447
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      dulwich/cli.py

+ 3 - 1
dulwich/cli.py

@@ -3730,7 +3730,9 @@ class cmd_branch(Command):
             branches: Iterator[bytes] | Sequence[bytes], use_columns: bool = False
         ) -> None:
             if use_columns:
-                write_columns(branches, sys.stdout)
+                branch_names = [branch.decode() for branch in branches]
+                output = format_columns(branch_names, mode="column")
+                sys.stdout.write(output)
             else:
                 for branch in branches:
                     sys.stdout.write(f"{branch.decode()}\n")