Sfoglia il codice sorgente

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

Jelmer Vernooij 8 anni fa
parent
commit
a8acf10194
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  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")