1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-04-28 04:35:16 +02:00

cvsexportcommit: chomp only removes trailing whitespace

In commit fef3a7cc(cvsexportcommit: be graceful when "cvs status"
reorders the arguments), caution was taken to get the status even
for files with leading or trailing whitespace.

However, the author of that commit missed that chomp() removes only
trailing newlines.  With help of the mailing list, the author realized
his mistake and provided this patch.

The idea is that we do not want to rely on a certain layout of the
output of "cvs status".  Therefore we only call it with files that are
unambiguous after stripping leading and trailing whitespace.

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 2008-05-14 23:30:43 +01:00 committed by Junio C Hamano
parent 4b172de81b
commit 57e0e3ebd6

View File

@ -210,7 +210,8 @@
my $basename = basename($name);
$basename = "no file " . $basename if (exists($added{$basename}));
chomp($basename);
$basename =~ s/^\s+//;
$basename =~ s/\s+$//;
if (!exists($fullname{$basename})) {
$fullname{$basename} = $name;