aboutsummaryrefslogtreecommitdiff
path: root/git-cvsexportcommit.perl
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-05-14 23:30:43 +0100
committerJunio C Hamano <gitster@pobox.com>2008-05-15 15:19:04 -0700
commit57e0e3ebd6fac2bf5fe46fd946dae6129b07f474 (patch)
tree4dd95eb5164532698b28bdb4ec77ca3c30ebaf20 /git-cvsexportcommit.perl
parent4b172de81b878cdc8b10803fd0cd79b3ca66a621 (diff)
downloadgit-57e0e3ebd6fac2bf5fe46fd946dae6129b07f474.tar.gz
git-57e0e3ebd6fac2bf5fe46fd946dae6129b07f474.tar.xz
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>
Diffstat (limited to 'git-cvsexportcommit.perl')
-rwxr-xr-xgit-cvsexportcommit.perl3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index b6036bd4d..317a89027 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -210,7 +210,8 @@ if (@canstatusfiles) {
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;