[PATCH] git-apply --stat: show new filename for rename/copy patch.
authorJunio C Hamano <junkio@cox.net>
Wed, 22 Jun 2005 09:29:16 +0000 (02:29 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 22 Jun 2005 17:23:48 +0000 (10:23 -0700)
When a patch is a git extended rename/copy patch, "git-apply
--stat" showed the old filename.  Change it to show the new
filename, because most of the time we are interested in looking
at the resulting tree.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
apply.c

diff --git a/apply.c b/apply.c
index af97537..53a9bb6 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -723,11 +723,11 @@ const char minuses[]= "---------------------------------------------------------
 
 static void show_stats(struct patch *patch)
 {
-       char *name = patch->old_name;
+       char *name = patch->new_name;
        int len, max, add, del, total;
 
        if (!name)
-               name = patch->new_name;
+               name = patch->old_name;
 
        /*
         * "scale" the filename