X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit-badcommit-fixup;h=46637899d91920f234cb78bb27b4f7eb58af912b;hp=6d6a705ec8a235c84f31bea89df63ea1f81349c6;hb=88f02532eb93f6a108c94a1aae0d5ba5dabbacac;hpb=216e164c51dad9de2ee55a1c528745502f736765 diff --git a/dgit-badcommit-fixup b/dgit-badcommit-fixup index 6d6a705e..46637899 100755 --- a/dgit-badcommit-fixup +++ b/dgit-badcommit-fixup @@ -104,6 +104,12 @@ sub rewrite_commit ($) { return $newobj; } +our @updates; + +sub filter_updates () { + @updates = grep { $_->[1] ne $_->[2] } @updates; +} + sub rewrite_tag ($) { my ($obj) = @_; $_ = getobj $obj, 'tag'; @@ -129,8 +135,6 @@ die "$? $!" if $?; chomp $refs; -our @updates; - foreach my $rline (split /\n/, $refs) { my ($obj, $type, $refname) = $rline =~ m/^(\w+)\s+(\w+)\s+(\S.*)/ @@ -147,7 +151,7 @@ foreach my $rline (split /\n/, $refs) { push @updates, [ $refname, $obj, $rewrite ]; } -@updates = grep { $_->[1] ne $_->[2] } @updates; +filter_updates(); #print Dumper(\@updates);