summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 529dd38)
raw | patch | inline | side by side (parent: 529dd38)
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Thu, 30 Sep 2010 13:43:09 +0000 (13:43 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 30 Sep 2010 19:20:33 +0000 (12:20 -0700) |
Change `while(<$fh>) { my $c = $_' to `while(my $c = <$fh>) {', and
use `chomp $c' instead of `$c =~ s/\n$//g;', the two are equivalent in
this case.
I've also changed the --cccmd test so that we test for the stripping
of whitespace at the beginning of the lines returned from the
--cccmd. I think we probably shouldn't do this, but it was there
already so I haven't changed the behavior.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.comReviewed-by: Avery Pennarun <apenwarr@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
use `chomp $c' instead of `$c =~ s/\n$//g;', the two are equivalent in
this case.
I've also changed the --cccmd test so that we test for the stripping
of whitespace at the beginning of the lines returned from the
--cccmd. I think we probably shouldn't do this, but it was there
already so I haven't changed the behavior.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.comReviewed-by: Avery Pennarun <apenwarr@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl | patch | blob | history | |
t/t9001-send-email.sh | patch | blob | history |
diff --git a/git-send-email.perl b/git-send-email.perl
index bfc6d4b45b1c7e2b9741eba5cfe323979751e7d2..036e4b4259babdda1e76a5aa558c3600b43a89c0 100755 (executable)
--- a/git-send-email.perl
+++ b/git-send-email.perl
if (defined $cc_cmd && !$suppress_cc{'cccmd'}) {
open my $fh, "$cc_cmd \Q$t\E |"
or die "(cc-cmd) Could not execute '$cc_cmd'";
- while(<$fh>) {
- my $c = $_;
+ while(my $c = <$fh>) {
+ chomp $c;
$c =~ s/^\s*//g;
- $c =~ s/\n$//g;
next if ($c eq $sender and $suppress_from);
push @cc, $c;
printf("(cc-cmd) Adding cc: %s from: '%s'\n",
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 6f67da4e71459e8ae44cce2a23c6f62c34947d12..99a16d57502a7f880cae34863cf344a318f3b176 100755 (executable)
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
test_expect_success $PREREQ 'cccmd works' '
clean_fake_sendmail &&
cp $patches cccmd.patch &&
- echo cccmd--cccmd@example.com >>cccmd.patch &&
+ echo "cccmd-- cccmd@example.com" >>cccmd.patch &&
{
echo "#!$SHELL_PATH"
echo sed -n -e s/^cccmd--//p \"\$1\"