Re: [PATCH v2] add -p: fix 2.17.0-rc* regression due to moved code
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 1, 2018, 05:00 UTC
- Message-ID
- <xmqqbmf31pxx.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180331125058.4506-1-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 14 quoted lines
> diff --git a/git-add--interactive.perl b/git-add--interactive.perl
> index d190469cd8..c1f52e457f 100755
> --- a/git-add--interactive.perl
> +++ b/git-add--interactive.perl
> @@ -1561,13 +1561,13 @@ sub patch_update_file {
> elsif ($line =~ m|^/(.*)|) {
> my $regex = $1;
> unless ($other =~ m|/|) {
> error_msg __("No other hunks to search\n");
> next;
> }
> - if ($1 eq "") {
> + if ($regex eq "") {
> print colored $prompt_color, __("search for regex? ");Ah. That "unless ... { }" thing is what was inserted recently, and the patch is an obvious fix once the problem is pointed out. Thanks for a careful reading.
It makes me wonder what the original author, who already captured $1 in $regex, was thinking when he wrote the comparison with $1 there, but that is OK---ithappend long time ago in early 2009.
Will apply. Thanks.
Show 5 quoted lines
> $regex = <STDIN>;
> if (defined $regex) {
> chomp $regex;
> }
> }