-rw-r--r-- | ui-commit.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ui-commit.c b/ui-commit.c index c5ee8e7..b49b2e9 100644 --- a/ui-commit.c +++ b/ui-commit.c @@ -43,14 +43,21 @@ void print_filepair(struct diff_filepair *pair) default: die("bug: unhandled diff status %c", pair->status); } html("<tr>"); htmlf("<td class='mode'>"); - html_filemode(pair->two->mode); - if (pair->one->mode != pair->two->mode) { + if (is_null_sha1(pair->two->sha1)) { + html_filemode(pair->one->mode); + } else { + html_filemode(pair->two->mode); + } + + if (pair->one->mode != pair->two->mode && + !is_null_sha1(pair->one->sha1) && + !is_null_sha1(pair->two->sha1)) { html("<span class='modechange'>["); html_filemode(pair->one->mode); html("]</span>"); } htmlf("</td><td class='%s'>", class); query = fmt("id=%s", sha1_to_hex(pair->two->sha1)); |