summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-07-03 15:01:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-07-03 20:44:30 (GMT)
commit3cb567386d5d0349bfb5e3aaf85e973faf685dda (patch)
tree86865561fd3ff11e22f3832eccd4a6e29d81f120 /diff.c
parent9cb18f56fdee6885884f5f08bd5335a42d9034dc (diff)
downloadgit-3cb567386d5d0349bfb5e3aaf85e973faf685dda.zip
git-3cb567386d5d0349bfb5e3aaf85e973faf685dda.tar.gz
git-3cb567386d5d0349bfb5e3aaf85e973faf685dda.tar.bz2
diff --no-index: fix --name-status with added files
Without this patch, an added file would be reported as /dev/null. Noticed by David Kastrup. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index dc6da5e..da992dd 100644
--- a/diff.c
+++ b/diff.c
@@ -2407,7 +2407,8 @@ static void diff_flush_raw(struct diff_filepair *p,
printf("%s ",
diff_unique_abbrev(p->two->sha1, abbrev));
}
- printf("%s%c%s", status, inter_name_termination, path_one);
+ printf("%s%c%s", status, inter_name_termination,
+ two_paths || p->one->mode ? path_one : path_two);
if (two_paths)
printf("%c%s", inter_name_termination, path_two);
putchar(line_termination);