Merge branch 'maint'
[gitweb.git] / builtin-rev-list.c
index 09774f9559b81050d89bd6663b8b672438da4342..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),
-                                   revs.abbrev, NULL, NULL, revs.relative_date);
-               printf("%s%c", pretty_header, hdr_termination);
+                                   &buf, &buflen,
+                                   revs.abbrev, NULL, NULL, revs.date_mode);
+               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;
@@ -113,6 +115,10 @@ static void show_object(struct object_array_entry *p)
         * confuse downstream git-pack-objects very badly.
         */
        const char *ep = strchr(p->name, '\n');
+
+       if (p->item->type == OBJ_BLOB && !has_sha1_file(p->item->sha1))
+               die("missing blob object '%s'", sha1_to_hex(p->item->sha1));
+
        if (ep) {
                printf("%s %.*s\n", sha1_to_hex(p->item->sha1),
                       (int) (ep - p->name),