summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2006-12-17 22:30:55 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2006-12-17 22:30:55 (UTC)
commitfb6e5869dcc81b775d5ac79dd3afac7220c366dd (patch) (side-by-side diff)
tree6e68d9dfe43d3ca5c6fc5b9be6546ea70779f0f1
parent6cb326c83b3c0b35d472305294afee3105b3088d (diff)
downloadcgit-fb6e5869dcc81b775d5ac79dd3afac7220c366dd.zip
cgit-fb6e5869dcc81b775d5ac79dd3afac7220c366dd.tar.gz
cgit-fb6e5869dcc81b775d5ac79dd3afac7220c366dd.tar.bz2
Don't show new and old filemode for added/removed files
It gives us no extra info whatsoever to show "----------" for either new or old mode, it's just noise (especially since we now show the "old" filemode for deleted files) Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--ui-commit.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ui-commit.c b/ui-commit.c
index c5ee8e7..b49b2e9 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -25,50 +25,57 @@ void print_filepair(struct diff_filepair *pair)
case DIFF_STATUS_DELETED:
class = "del";
break;
case DIFF_STATUS_MODIFIED:
class = "upd";
break;
case DIFF_STATUS_RENAMED:
class = "mov";
break;
case DIFF_STATUS_TYPE_CHANGED:
class = "typ";
break;
case DIFF_STATUS_UNKNOWN:
class = "unk";
break;
case DIFF_STATUS_UNMERGED:
class = "stg";
break;
default:
die("bug: unhandled diff status %c", pair->status);
}
html("<tr>");
htmlf("<td class='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) {
+ }
+
+ 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));
html_link_open(cgit_pageurl(cgit_query_repo, "view", query),
NULL, NULL);
if (pair->status == DIFF_STATUS_COPIED ||
pair->status == DIFF_STATUS_RENAMED) {
html_txt(pair->two->path);
htmlf("</a> (%s from ", pair->status == DIFF_STATUS_COPIED ?
"copied" : "renamed");
query = fmt("id=%s", sha1_to_hex(pair->one->sha1));
html_link_open(cgit_pageurl(cgit_query_repo, "view", query),
NULL, NULL);
html_txt(pair->one->path);
html("</a>)");
} else {
html_txt(pair->two->path);
html("</a>");
}
html("<td>");