From 88f02532eb93f6a108c94a1aae0d5ba5dabbacac Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 6 Jan 2017 16:26:19 +0000 Subject: dgit-badcommit-fixup: Break out filter_updates Signed-off-by: Ian Jackson --- dgit-badcommit-fixup | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'dgit-badcommit-fixup') diff --git a/dgit-badcommit-fixup b/dgit-badcommit-fixup index 6d6a705..4663789 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); -- cgit v1.2.3