瀏覽代碼

Migrate branch --column to use format_columns()

Jelmer Vernooij 2 月之前
父節點
當前提交
bd8af9c26a
共有 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")