convert: treat an empty string for clean/smudge filters as "cat"
[gitweb.git] / log-tree.c
index 94de49254394fbece202d2ffbca55636bfa6c9ed..f70a30e12702fa68c77f6b2490692f3861ad32e7 100644 (file)
@@ -133,7 +133,7 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
                if (!obj)
                        break;
                if (!obj->parsed)
-                       parse_object(get_object_hash(*obj));
+                       parse_object(obj->oid.hash);
                add_name_decoration(DECORATION_REF_TAG, refname, obj);
        }
        return 0;
@@ -165,7 +165,7 @@ static void show_parents(struct commit *commit, int abbrev)
        struct commit_list *p;
        for (p = commit->parents; p ; p = p->next) {
                struct commit *parent = p->item;
-               printf(" %s", find_unique_abbrev(get_object_hash(parent->object), abbrev));
+               printf(" %s", find_unique_abbrev(parent->object.oid.hash, abbrev));
        }
 }
 
@@ -173,7 +173,7 @@ static void show_children(struct rev_info *opt, struct commit *commit, int abbre
 {
        struct commit_list *p = lookup_decoration(&opt->children, &commit->object);
        for ( ; p; p = p->next) {
-               printf(" %s", find_unique_abbrev(get_object_hash(p->item->object), abbrev));
+               printf(" %s", find_unique_abbrev(p->item->object.oid.hash, abbrev));
        }
 }
 
@@ -342,7 +342,8 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit,
 {
        const char *subject = NULL;
        const char *extra_headers = opt->extra_headers;
-       const char *name = oid_to_hex(&commit->object.oid);
+       const char *name = oid_to_hex(opt->zero_commit ?
+                                     &null_oid : &commit->object.oid);
 
        *need_8bit_cte_p = 0; /* unknown */
        if (opt->total > 0) {
@@ -469,7 +470,7 @@ static int which_parent(const unsigned char *sha1, const struct commit *commit)
        const struct commit_list *parent;
 
        for (nth = 0, parent = commit->parents; parent; parent = parent->next) {
-               if (!hashcmp(get_object_hash(parent->item->object), sha1))
+               if (!hashcmp(parent->item->object.oid.hash, sha1))
                        return nth;
                nth++;
        }
@@ -507,9 +508,9 @@ static void show_one_mergetag(struct commit *commit,
                          &commit->parents->next->item->object.oid))
                strbuf_addf(&verify_message,
                            "merged tag '%s'\n", tag->tag);
-       else if ((nth = which_parent(get_object_hash(*tag->tagged), commit)) < 0)
+       else if ((nth = which_parent(tag->tagged->oid.hash, commit)) < 0)
                strbuf_addf(&verify_message, "tag %s names a non-parent %s\n",
-                                   tag->tag, get_object_hash(*tag->tagged));
+                                   tag->tag, tag->tagged->oid.hash);
        else
                strbuf_addf(&verify_message,
                            "parent #%d, tagged '%s'\n", nth + 1, tag->tag);
@@ -553,7 +554,7 @@ void show_log(struct rev_info *opt)
 
                if (!opt->graph)
                        put_revision_mark(opt, commit);
-               fputs(find_unique_abbrev(get_object_hash(commit->object), abbrev_commit), stdout);
+               fputs(find_unique_abbrev(commit->object.oid.hash, abbrev_commit), stdout);
                if (opt->print_parents)
                        show_parents(commit, abbrev_commit);
                if (opt->children.name)
@@ -613,7 +614,7 @@ void show_log(struct rev_info *opt)
 
                if (!opt->graph)
                        put_revision_mark(opt, commit);
-               fputs(find_unique_abbrev(get_object_hash(commit->object), abbrev_commit),
+               fputs(find_unique_abbrev(commit->object.oid.hash, abbrev_commit),
                      stdout);
                if (opt->print_parents)
                        show_parents(commit, abbrev_commit);
@@ -621,7 +622,7 @@ void show_log(struct rev_info *opt)
                        show_children(opt, commit, abbrev_commit);
                if (parent)
                        printf(" (from %s)",
-                              find_unique_abbrev(get_object_hash(parent->object),
+                              find_unique_abbrev(parent->object.oid.hash,
                                                  abbrev_commit));
                fputs(diff_get_color_opt(&opt->diffopt, DIFF_RESET), stdout);
                show_decorations(opt, commit);
@@ -660,7 +661,7 @@ void show_log(struct rev_info *opt)
                struct strbuf notebuf = STRBUF_INIT;
 
                raw = (opt->commit_format == CMIT_FMT_USERFORMAT);
-               format_display_notes(get_object_hash(commit->object), &notebuf,
+               format_display_notes(commit->object.oid.hash, &notebuf,
                                     get_log_output_encoding(), raw);
                ctx.notes_message = notebuf.len
                        ? strbuf_detach(&notebuf, NULL)