aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-10-06 08:56:07 -0700
committerShawn O. Pearce <spearce@spearce.org>2008-10-06 08:56:07 -0700
commit276328ffb87cefdc515bee5f09916aea6e0244ed (patch)
tree162b276adac033e8a41266071e046f0f4cf4cd6d /diff.c
parent048f2762007d022defceb6850a44bc1bd5ccebf7 (diff)
parente261cf94848d31868c21fb11cade51c30dfcdbe7 (diff)
downloadgit-276328ffb87cefdc515bee5f09916aea6e0244ed.tar.gz
git-276328ffb87cefdc515bee5f09916aea6e0244ed.tar.xz
Merge branch 'maint'
* maint: Update release notes for 1.6.0.3 Teach rebase -i to honor pre-rebase hook docs: describe pre-rebase hook do not segfault if make_cache_entry failed make prefix_path() never return NULL fix bogus "diff --git" header from "diff --no-index" Fix fetch/clone --quiet when stdout is connected builtin-blame: Fix blame -C -C with submodules. bash: remove fetch, push, pull dashed form leftovers Conflicts: diff.c
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 4e4e439e0..02e948c9d 100644
--- a/diff.c
+++ b/diff.c
@@ -1509,6 +1509,10 @@ static void builtin_diff(const char *name_a,
b_prefix = o->b_prefix;
}
+ /* Never use a non-valid filename anywhere if at all possible */
+ name_a = DIFF_FILE_VALID(one) ? name_a : name_b;
+ name_b = DIFF_FILE_VALID(two) ? name_b : name_a;
+
a_one = quote_two(a_prefix, name_a + (*name_a == '/'));
b_two = quote_two(b_prefix, name_b + (*name_b == '/'));
lbl[0] = DIFF_FILE_VALID(one) ? a_one : "/dev/null";