aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-24 01:42:06 -0800
committerJunio C Hamano <junkio@cox.net>2007-02-24 01:42:06 -0800
commit8a13becc0dd4c8876ebf471bf880446c1a10b7e9 (patch)
tree9448f573c17a91697904e46305f09f7679e7e4dd /diff.c
parent509b4d73b26bb442fd409bbca3772ba22875d310 (diff)
parent5089277718503a4de7817b5f6754cb03116d5524 (diff)
downloadgit-8a13becc0dd4c8876ebf471bf880446c1a10b7e9.tar.gz
git-8a13becc0dd4c8876ebf471bf880446c1a10b7e9.tar.xz
Merge branch 'maint'
* maint: diff-patch: Avoid emitting double-slashes in textual patch. Reword git-am 3-way fallback failure message. Limit filename for format-patch core.legacyheaders: Use the description used in RelNotes-1.5.0 git-show-ref --verify: Fail if called without a reference Conflicts: builtin-show-ref.c diff.c
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index 5ecb12225..d1eae7214 100644
--- a/diff.c
+++ b/diff.c
@@ -219,6 +219,8 @@ static void emit_rewrite_diff(const char *name_a,
const char *new = diff_get_color(color_diff, DIFF_FILE_NEW);
const char *reset = diff_get_color(color_diff, DIFF_RESET);
+ name_a += (*name_a == '/');
+ name_b += (*name_b == '/');
name_a_tab = strchr(name_a, ' ') ? "\t" : "";
name_b_tab = strchr(name_b, ' ') ? "\t" : "";
@@ -1064,8 +1066,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);