summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9cb18f5)
raw | patch | inline | side by side (parent: 9cb18f5)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Tue, 3 Jul 2007 15:01:06 +0000 (16:01 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 3 Jul 2007 20:44:30 +0000 (13:44 -0700) |
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>
Noticed by David Kastrup.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c | patch | blob | history | |
t/t4013-diff-various.sh | patch | blob | history | |
t/t4013/diff.diff_--name-status_dir2_dir | [new file with mode: 0644] | patch | blob |
index dc6da5e253c4a64440a2da9e2f785f3ea06bea61..da992dd4851dd67ab9a307c1b08ebed442e406cb 100644 (file)
--- a/diff.c
+++ b/diff.c
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);
index 8f4c29a6b5a263d6f18d95757b76ac55e9443068..4e7d68dda28a54cdc4f46e11717e113fa8dd479c 100755 (executable)
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&
mkdir dir &&
+ mkdir dir2 &&
for i in 1 2 3; do echo $i; done >file0 &&
for i in A B; do echo $i; done >dir/sub &&
cat file0 >file2 &&
diff --patch-with-raw initial..side
diff --patch-with-stat -r initial..side
diff --patch-with-raw -r initial..side
+diff --name-status dir2 dir
EOF
test_done
diff --git a/t/t4013/diff.diff_--name-status_dir2_dir b/t/t4013/diff.diff_--name-status_dir2_dir
--- /dev/null
@@ -0,0 +1,3 @@
+$ git diff --name-status dir2 dir
+A dir/sub
+$