]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Merge branch 'jk/maint-rev-list-nul' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 24 Nov 2010 20:46:32 +0000 (12:46 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 Nov 2010 20:46:32 +0000 (12:46 -0800)
* jk/maint-rev-list-nul:
  rev-list: handle %x00 NUL in user format

1  2 
builtin/rev-list.c

diff --combined builtin/rev-list.c
index 158ce1111af12db1445d82cfa5728bc19837570d,3b2dca08093bf5eb8fe1a2ffe08036fdd903cedb..ba27d39f977f2807cddb6e18364837b9fd50e970
@@@ -11,9 -11,9 +11,9 @@@
  static const char rev_list_usage[] =
  "git rev-list [OPTION] <commit-id>... [ -- paths... ]\n"
  "  limiting output:\n"
 -"    --max-count=nr\n"
 -"    --max-age=epoch\n"
 -"    --min-age=epoch\n"
 +"    --max-count=<n>\n"
 +"    --max-age=<epoch>\n"
 +"    --min-age=<epoch>\n"
  "    --sparse\n"
  "    --no-merges\n"
  "    --remove-empty\n"
@@@ -33,7 -33,7 +33,7 @@@
  "    --objects | --objects-edge\n"
  "    --unpacked\n"
  "    --header | --pretty\n"
 -"    --abbrev=nr | --no-abbrev\n"
 +"    --abbrev=<n> | --no-abbrev\n"
  "    --abbrev-commit\n"
  "    --left-right\n"
  "  special purpose:\n"
@@@ -147,8 -147,10 +147,10 @@@ static void show_commit(struct commit *
                        }
                } else {
                        if (revs->commit_format != CMIT_FMT_USERFORMAT ||
-                           buf.len)
-                               printf("%s%c", buf.buf, info->hdr_termination);
+                           buf.len) {
+                               fwrite(buf.buf, 1, buf.len, stdout);
+                               putchar(info->hdr_termination);
+                       }
                }
                strbuf_release(&buf);
        } else {