@matheusbsbs / matheus-bagliano / commits / 57e0e3ebd6
Fork 0

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>

Johannes Schindelin committed May 14, 2008 at 23:30 UTC 57e0e3ebd6fac2bf5fe46fd946dae6129b07f474
1 file changed +2 -1
git-cvsexportcommit.perl
+2 -1
@@ -210,7 +210,8 @@ if (@canstatusfiles) {
210 my $basename = basename($name);
211
212 $basename = "no file " . $basename if (exists($added{$basename}));
213 - chomp($basename);
213 + $basename =~ s/^\s+//;
214 + $basename =~ s/\s+$//;
215
216 if (!exists($fullname{$basename})) {
217 $fullname{$basename} = $name;