From: Thomas Rast Date: Fri, 6 Feb 2009 19:30:01 +0000 (+0100) Subject: add -p: import Term::ReadKey with 'require' X-Git-Tag: v1.6.2-rc0~1^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=748aa689bac2c1dd5d902815b0dec6364d20bf34;p=git.git add -p: import Term::ReadKey with 'require' eval{use...} is no good because the 'use' is evaluated at compile time, so manually 'require' it. We need to forward declare the functions we use, otherwise Perl raises a compilation error. Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- diff --git a/git-add--interactive.perl b/git-add--interactive.perl index be8ca8ebb..ec47888f5 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -40,9 +40,12 @@ my ($diff_new_color) = my $normal_color = $repo->get_color("", "reset"); my $use_readkey = 0; +sub ReadMode; +sub ReadKey; if ($repo->config_bool("interactive.singlekey")) { eval { - use Term::ReadKey; + require Term::ReadKey; + Term::ReadKey->import; $use_readkey = 1; }; }