浏览代码

Don't print "Changes to be committed" header if there are no changes to
commit.

Jelmer Vernooij 8 年之前
父节点
当前提交
a8acf10194
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      bin/dulwich

+ 3 - 2
bin/dulwich

@@ -335,11 +335,12 @@ def cmd_status(args):
     else:
         gitdir = '.'
     status = porcelain.status(gitdir)
-    if status.staged:
+    if any(names for (kind, names) in status.staged.items()):
         sys.stdout.write("Changes to be committed:\n\n")
         for kind, names in status.staged.items():
             for name in names:
-                sys.stdout.write("\t%s: %s\n" % (kind, name))
+                sys.stdout.write("\t%s: %s\n" % (
+                    kind, name.decode(sys.getfilesystemencoding())))
         sys.stdout.write("\n")
     if status.unstaged:
         sys.stdout.write("Changes not staged for commit:\n\n")