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>
This commit is contained in:
Johannes Schindelin
2007-07-03 16:01:06 +01:00
committed by Junio C Hamano
parent 9cb18f56fd
commit 3cb567386d
3 changed files with 7 additions and 1 deletions

3
diff.c
View File

@ -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);