path: root/git-add--interactive.perl
diff options
authorStephan Beyer <>2009-02-08 17:40:39 (GMT)
committerJunio C Hamano <>2009-02-08 21:06:33 (GMT)
commit9aad6cbaef3c459ff4953f5a22bbbc7abfc72800 (patch)
tree94728112a631ac5150e6f83d8b2e02c5cc4c69d5 /git-add--interactive.perl
parent621f1b4bcf40f1469fc59202248df35619e33c82 (diff)
add -p: get rid of warnings about unitialized values
After invoking git add -p I always got the warnings: Use of uninitialized value $_[3] in exec at line 1282. Use of uninitialized value $args[2] in join or string at line 1264. A bisect showed that these warnings occur in a301973 "add -p: print errors in separate color" the first time. They can be reproduced by setting color.ui (or color.interactive) to "auto" and unsetting and color.interactive.error. I am using Perl 5.10.0. The reason of the warning is that color.interactive.error defaults to which defaults to nothing in the specific codepath. It defaults to 'red bold' some lines above which could lead to the wrong assumption that it always defaults to 'red bold' now. This patch lets it default to 'red bold', blowing the warnings away. Signed-off-by: Stephan Beyer <> Acked-By: Thomas Rast <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'git-add--interactive.perl')
1 files changed, 2 insertions, 1 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index ec47888..5f129a4 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -14,7 +14,8 @@ my ($prompt_color, $header_color, $help_color) =
) : ();
my $error_color = ();
if ($menu_use_color) {
- my $help_color_spec = $repo->config('');
+ my $help_color_spec = ($repo->config('') or
+ 'red bold');
$error_color = $repo->get_color('color.interactive.error',