]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-commit.c
Use html_filemode in ui-tree.c
[ps-cgit] / ui-commit.c
index c5ee8e70490e3e1c963c903b3e171ed131eb3775..b49b2e9f187724adf04b017e9d3545d6a6b3dcfb 100644 (file)
@@ -46,8 +46,15 @@ void print_filepair(struct diff_filepair *pair)
 
        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>");