author | Lars Hjemli <hjemli@gmail.com> | 2007-05-15 07:27:27 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-15 07:27:27 (UTC) |
commit | c94afaacf4f996e3c983bcc150a2bacde2b00f20 (patch) (unidiff) | |
tree | 44cd81246b5f90f10da90d7186b6f24e9156d93c /ui-diff.c | |
parent | e903011c4457c24c0095f270ca5e78c40729434f (diff) | |
download | cgit-c94afaacf4f996e3c983bcc150a2bacde2b00f20.zip cgit-c94afaacf4f996e3c983bcc150a2bacde2b00f20.tar.gz cgit-c94afaacf4f996e3c983bcc150a2bacde2b00f20.tar.bz2 |
ui-diff: show /dev/null as filename for add/delete
The diff headers showed an invalid filename when a patch created or
deleted a file. Fix it.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-diff.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -32,13 +32,16 @@ static void print_line(char *line, int len) | |||
32 | } | 32 | } |
33 | 33 | ||
34 | static void header(unsigned char *sha1, char *path1, | 34 | static void header(unsigned char *sha1, char *path1, |
35 | unsigned char *sha2, char *path2) | 35 | unsigned char *sha2, char *path2) |
36 | { | 36 | { |
37 | char *abbrev1, *abbrev2; | 37 | char *abbrev1, *abbrev2; |
38 | 38 | if (is_null_sha1(sha1)) | |
39 | path1 = "dev/null"; | ||
40 | if (is_null_sha1(sha2)) | ||
41 | path2 = "dev/null"; | ||
39 | html("<tr><td>"); | 42 | html("<tr><td>"); |
40 | html("<div class='head'>"); | 43 | html("<div class='head'>"); |
41 | html("diff --git a/"); | 44 | html("diff --git a/"); |
42 | html_txt(path1); | 45 | html_txt(path1); |
43 | html(" b/"); | 46 | html(" b/"); |
44 | html_txt(path2); | 47 | html_txt(path2); |