@matheusbsbs / matheus-bagliano / commits / 7b40a4552a
Fork 0

git add -i: Remove unused variables

Signed-off-by: Jean-Luc Herren <jlh@gmx.ch> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Jean-Luc Herren committed Oct 9, 2007 at 21:34 UTC 7b40a4552a0fbdc6ee9a22ce10408d79ca1599af
1 file changed +6 -10
git-add--interactive.perl
+6 -10
@@ -374,9 +374,8 @@ sub split_hunk {
374 # it can be split, but we would need to take care of
375 # overlaps later.
376
377 - my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) = parse_hunk_header($text->[0]);
377 + my ($o_ofs, undef, $n_ofs) = parse_hunk_header($text->[0]);
378 my $hunk_start = 1;
379 - my $next_hunk_start;
379
380 OUTER:
381 while (1) {
@@ -443,8 +442,8 @@ sub split_hunk {
442 for my $hunk (@split) {
443 $o_ofs = $hunk->{OLD};
444 $n_ofs = $hunk->{NEW};
446 - $o_cnt = $hunk->{OCNT};
447 - $n_cnt = $hunk->{NCNT};
445 + my $o_cnt = $hunk->{OCNT};
446 + my $n_cnt = $hunk->{NCNT};
447
448 my $head = ("@@ -$o_ofs" .
449 (($o_cnt != 1) ? ",$o_cnt" : '') .
@@ -459,7 +458,7 @@ sub split_hunk {
458 sub find_last_o_ctx {
459 my ($it) = @_;
460 my $text = $it->{TEXT};
462 - my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) = parse_hunk_header($text->[0]);
461 + my ($o_ofs, $o_cnt) = parse_hunk_header($text->[0]);
462 my $i = @{$text};
463 my $last_o_ctx = $o_ofs + $o_cnt;
464 while (0 < --$i) {
@@ -531,8 +530,7 @@ sub coalesce_overlapping_hunks {
530
531 for (grep { $_->{USE} } @in) {
532 my $text = $_->{TEXT};
534 - my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) =
535 - parse_hunk_header($text->[0]);
533 + my ($o_ofs) = parse_hunk_header($text->[0]);
534 if (defined $last_o_ctx &&
535 $o_ofs <= $last_o_ctx) {
536 merge_hunk($out[-1], $_);
@@ -699,7 +697,7 @@ sub patch_update_cmd {
697
698 @hunk = coalesce_overlapping_hunks(@hunk);
699
702 - my ($o_lofs, $n_lofs) = (0, 0);
700 + my $n_lofs = 0;
701 my @result = ();
702 for (@hunk) {
703 my $text = $_->{TEXT};
@@ -806,8 +804,6 @@ sub main_loop {
804 }
805 }
806
809 -my @z;
810 -
807 refresh();
808 status_cmd();
809 main_loop();