chiark / gitweb /
git-debrebase: merge: Introduce global mwrecknote sub
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 16:29:34 +0000 (17:29 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 17:34:50 +0000 (18:34 +0100)
NFC

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index d101742..277e0f8 100755 (executable)
@@ -362,6 +362,11 @@ sub gbp_pq_export ($$$) {
 #  our own patch identification algorithm?
 #  this is an alternative strategy
 
+sub mwrecknote ($$$) {
+    my ($wrecknotes, $reftail, $commitish) = @_;
+    $wrecknotes->{$reftail} = $commitish;
+}
+
 sub merge_series ($$$;@) {
     my ($newbase, $wrecknotes, $base_q, @input_qs) = @_;
     # $base_q{SeriesBase}  $input_qs[]{SeriesBase}
@@ -388,10 +393,7 @@ sub merge_series ($$$;@) {
 
     my $result;
 
-    my $mwrecknote = sub {
-       my ($reftail, $commitish) = @_;
-       $wrecknotes->{$reftail} = $commitish;
-    };
+    my $mwrecknote = sub { &mwrecknote($wrecknotes, @_); };
 
     local $workarea = fresh_playground "$playprefix/merge";
     my $seriesfile = "debian/patches/series";
@@ -1039,10 +1041,7 @@ sub walk ($;$$$) {
        fail "something useful about failed merge attempt @_ xxx".Dumper($cl);
     };
 
-    my $mwrecknote = sub {
-       my ($reftail, $commitish) = @_;
-       $cl->{MergeWreckNotes}{$reftail} = $commitish;
-    };
+    my $mwrecknote = sub { &mwrecknote($cl->{MergeWreckNotes}, @_); };
 
     my $last_anchor;