1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-07 01:06:09 +02:00

send-email: get rid of indirect object syntax

Change indirect object syntax such as "new X ARGS" to
"X->new(ARGS)". This allows perl to see what "new" is at compile-time
without having loaded Term::ReadLine. This doesn't matter now, but
will in a subsequent commit when we start lazily loading it.

Let's do the same for the adjacent "FakeTerm" package for consistency,
even though we're not going to conditionally load it.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ævar Arnfjörð Bjarmason 2021-05-28 11:23:48 +02:00 committed by Junio C Hamano
parent 4adbf387bf
commit 447ed29c0d

View File

@ -194,11 +194,11 @@ sub format_2822_time {
my @repo = $repo ? ($repo) : ();
my $term = eval {
$ENV{"GIT_SEND_EMAIL_NOTTY"}
? new Term::ReadLine 'git-send-email', \*STDIN, \*STDOUT
: new Term::ReadLine 'git-send-email';
? Term::ReadLine->new('git-send-email', \*STDIN, \*STDOUT)
: Term::ReadLine->new('git-send-email');
};
if ($@) {
$term = new FakeTerm "$@: going non-interactive";
$term = FakeTerm->new("$@: going non-interactive");
}
# Behavior modification variables