summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdgit-badcommit-fixup10
1 files changed, 7 insertions, 3 deletions
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);