fix typo in git-am manpage
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index aaab3095a5f44d5d835bda4bc60112481bf94ed9..b8a90e91a9af75e1e5f5d69ce45c2a59e64071d1 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -211,6 +211,8 @@ static void emit_rewrite_diff(const char *name_a,
        diff_populate_filespec(two, 0);
        lc_a = count_lines(one->data, one->size);
        lc_b = count_lines(two->data, two->size);
+       name_a += (*name_a == '/');
+       name_b += (*name_b == '/');
        printf("--- a/%s\n+++ b/%s\n@@ -", name_a, name_b);
        print_line_count(lc_a);
        printf(" +");
@@ -1020,8 +1022,8 @@ static void builtin_diff(const char *name_a,
        const char *set = diff_get_color(o->color_diff, DIFF_METAINFO);
        const char *reset = diff_get_color(o->color_diff, DIFF_RESET);
 
-       a_one = quote_two("a/", name_a);
-       b_two = quote_two("b/", name_b);
+       a_one = quote_two("a/", name_a + (*name_a == '/'));
+       b_two = quote_two("b/", name_b + (*name_b == '/'));
        lbl[0] = DIFF_FILE_VALID(one) ? a_one : "/dev/null";
        lbl[1] = DIFF_FILE_VALID(two) ? b_two : "/dev/null";
        printf("%sdiff --git %s %s%s\n", set, a_one, b_two, reset);
@@ -1364,6 +1366,7 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
                s->data = xmmap(NULL, s->size, PROT_READ, MAP_PRIVATE, fd, 0);
                close(fd);
                s->should_munmap = 1;
+               /* FIXME! CRLF -> LF conversion goes here, based on "s->path" */
        }
        else {
                char type[20];