add -p: get rid of Git.pm warnings about unitialized values
commit9aad6cbaef3c459ff4953f5a22bbbc7abfc72800
authorStephan Beyer <s-beyer@gmx.net>
Sun, 8 Feb 2009 17:40:39 +0000 (8 18:40 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 8 Feb 2009 21:06:33 +0000 (8 13:06 -0800)
tree94728112a631ac5150e6f83d8b2e02c5cc4c69d5
parent621f1b4bcf40f1469fc59202248df35619e33c82
add -p: get rid of Git.pm warnings about unitialized values

After invoking git add -p I always got the warnings:

 Use of uninitialized value $_[3] in exec at Git.pm line 1282.
 Use of uninitialized value $args[2] in join or string at Git.pm 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 color.interactive.help and color.interactive.error.
I am using Perl 5.10.0.

The reason of the warning is that color.interactive.error defaults to
color.interactive.help 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 <s-beyer@gmx.net>
Acked-By: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-add--interactive.perl