Skip to content

Commit 57e0e3e

Browse files
dschogitster
authored andcommitted
cvsexportcommit: chomp only removes trailing whitespace
In commit fef3a7c(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>
1 parent 4b172de commit 57e0e3e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git-cvsexportcommit.perl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@
210210
my $basename = basename($name);
211211

212212
$basename = "no file " . $basename if (exists($added{$basename}));
213-
chomp($basename);
213+
$basename =~ s/^\s+//;
214+
$basename =~ s/\s+$//;
214215

215216
if (!exists($fullname{$basename})) {
216217
$fullname{$basename} = $name;

0 commit comments

Comments
 (0)