Merge branch 'js/stash'
[gitweb.git] / builtin-rev-list.c
index ebf53f5944f1a53c5336f69e2ef3105ce50d0823..86db8b03fe4295497cf011a75617d6dc8f172c64 100644 (file)
@@ -92,13 +92,15 @@ static void show_commit(struct commit *commit)
                putchar('\n');
 
        if (revs.verbose_header) {
-               static char pretty_header[16384];
+               char *buf = NULL;
+               unsigned long buflen = 0;
                pretty_print_commit(revs.commit_format, commit, ~0,
-                                   pretty_header, sizeof(pretty_header),
+                                   &buf, &buflen,
                                    revs.abbrev, NULL, NULL, revs.date_mode);
-               printf("%s%c", pretty_header, hdr_termination);
+               printf("%s%c", buf, hdr_termination);
+               free(buf);
        }
-       fflush(stdout);
+       maybe_flush_or_die(stdout, "stdout");
        if (commit->parents) {
                free_commit_list(commit->parents);
                commit->parents = NULL;