diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2007-07-03 16:01:06 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-07-03 13:44:30 -0700 |
commit | 3cb567386d5d0349bfb5e3aaf85e973faf685dda (patch) | |
tree | 86865561fd3ff11e22f3832eccd4a6e29d81f120 /diff.c | |
parent | 9cb18f56fdee6885884f5f08bd5335a42d9034dc (diff) | |
download | git-3cb567386d5d0349bfb5e3aaf85e973faf685dda.tar.gz git-3cb567386d5d0349bfb5e3aaf85e973faf685dda.tar.xz |
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |