Fix "git diff --stat" with long filenames
Fix "git diff --stat" with long filenames

When we cut off the front of a filename to make it fit on the line, we add
a "..." in front. However, the way the "git diff" code was written, we
will never reset the prefix back to the empty string, so every single
filename afterwards will have the "..." prefix, whether appropriate or
not.

You can see this with "git diff v2.6.16.." on the current kernel tree,
since there are filenames with long names that changed there:

 [ snip snip ]
 Documentation/filesystems/vfs.txt                  |  229
 .../firmware_class/firmware_sample_driver.c        |    3
 .../firmware_sample_firmware_class.c               |    1
 ...Documentation/fujitsu/frv/kernel-ABI.txt           |  192
 ...Documentation/hwmon/w83627hf                       |    4
 [ snip snip ]

notice how the two Documentation/firmware** filenames caused the "..." to
be added, but then the later filenames don't want it, and it also screws
up the alignment of the line numbering afterwards.

Trivially fixed by moving the declaration (and initial setting) of the
"prefix" variable into the for-loop where it is used.

Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>
Signed-off-by: Junio C Hamano <dc50d1021234060e53ec42a77d526afa2fe07479@cox.net>

destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git