aboutsummaryrefslogtreecommitdiffstats
path: root/ui-diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-diff.c')
-rw-r--r--ui-diff.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/ui-diff.c b/ui-diff.c
index c6bad63..3d46da2 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -229,11 +229,6 @@ static void header(unsigned char *sha1, char *path1, int mode1,
229 html(" b/"); 229 html(" b/");
230 html_txt(path2); 230 html_txt(path2);
231 231
232 if (is_null_sha1(sha1))
233 path1 = "dev/null";
234 if (is_null_sha1(sha2))
235 path2 = "dev/null";
236
237 if (mode1 == 0) 232 if (mode1 == 0)
238 htmlf("<br/>new file mode %.6o", mode2); 233 htmlf("<br/>new file mode %.6o", mode2);
239 234
@@ -251,13 +246,21 @@ static void header(unsigned char *sha1, char *path1, int mode1,
251 if (mode2 != mode1) 246 if (mode2 != mode1)
252 htmlf("..%.6o", mode2); 247 htmlf("..%.6o", mode2);
253 } 248 }
254 html("<br/>--- a/"); 249 if (is_null_sha1(sha1)) {
250 path1 = "dev/null";
251 html("<br/>--- /");
252 } else
253 html("<br/>--- a/");
255 if (mode1 != 0) 254 if (mode1 != 0)
256 cgit_tree_link(path1, NULL, NULL, ctx.qry.head, 255 cgit_tree_link(path1, NULL, NULL, ctx.qry.head,
257 sha1_to_hex(old_rev_sha1), path1); 256 sha1_to_hex(old_rev_sha1), path1);
258 else 257 else
259 html_txt(path1); 258 html_txt(path1);
260 html("<br/>+++ b/"); 259 if (is_null_sha1(sha2)) {
260 path2 = "dev/null";
261 html("<br/>+++ /");
262 } else
263 html("<br/>+++ b/");
261 if (mode2 != 0) 264 if (mode2 != 0)
262 cgit_tree_link(path2, NULL, NULL, ctx.qry.head, 265 cgit_tree_link(path2, NULL, NULL, ctx.qry.head,
263 sha1_to_hex(new_rev_sha1), path2); 266 sha1_to_hex(new_rev_sha1), path2);