diff options
author | Thomas Rast <trast@student.ethz.ch> | 2009-02-06 20:30:01 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-02-07 00:37:36 -0800 |
commit | 748aa689bac2c1dd5d902815b0dec6364d20bf34 (patch) | |
tree | e75bb75d10c5da84beca3a0ede816272c72471bc /git-add--interactive.perl | |
parent | a301973641f426ab42e5bf9faa6e4da5bd658148 (diff) | |
download | git-748aa689bac2c1dd5d902815b0dec6364d20bf34.tar.gz |
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 <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-add--interactive.perl')
-rwxr-xr-x | git-add--interactive.perl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl index be8ca8ebb2..ec47888f57 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; }; } |