chiark / gitweb /
git-debrebase: merge: Break out merge_wreckage_cleaning (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 17:09:34 +0000 (18:09 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 19:11:09 +0000 (20:11 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 589fa90..0558e61 100755 (executable)
@@ -154,6 +154,14 @@ our $snags_summarised = 0;
 our @deferred_updates;
 our @deferred_update_messages;
 
+sub merge_wreckage_cleaning ($) {
+    my ($updates) = @_;
+    git_for_each_ref("$wrecknoteprefix/*", sub {
+       my ($objid,$objtype,$fullrefname,$reftail) = @_;
+       push @$updates, "delete $fullrefname";
+    });
+}
+
 sub all_snags_summarised () {
     $snags_forced + $snags_tripped == $snags_summarised;
 }
@@ -383,10 +391,7 @@ sub merge_failed ($$) {
 
     if ($opt_save_wreckage) {
        my @updates;
-       git_for_each_ref("$wrecknoteprefix/*", sub {
-            my ($objid,$objtype,$fullrefname,$reftail) = @_;
-            push @updates, "delete $fullrefname";
-        });
+       merge_wreckage_cleaning \@updates;
        keys %$wrecknotes;
        while (my ($k,$v) = each %$wrecknotes) {
            push @updates, "create $wrecknoteprefix/$k $v";