chiark / gitweb /
git-debrebase: merge: Actually use merge resolutions
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Aug 2018 00:25:18 +0000 (01:25 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Aug 2018 00:45:44 +0000 (01:45 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 96966ad..f9b6254 100755 (executable)
@@ -1481,12 +1481,20 @@ sub walk ($;$$$) {
                read_tree_debian($cltree);
                @parents = map { $_->{Breakwater} } @{ $cl->{Parents} };
            } elsif ($method eq 'MergeMergeSeries') {
-               print "Running merge resolution for $cl->{CommitId}...\n";
-               $mwrecknote->('new-base', $build);
-               $build = merge_series
-                   $build, $cl->{MergeWreckNotes},
-                   $cl->{MergeInterchangeBaseInfo},
-                   @{ $cl->{Parents} };
+               my $cachehit = reflog_cache_lookup
+                   $merge_cache_ref, "vanilla-merge $cl->{CommitId}";
+               if ($cachehit) {
+                   print "Using supplied resolution for $cl->{CommitId}...\n";
+                   $build = $cachehit;
+                   $mwrecknote->('cached-resolution', $build);
+               } else {
+                   print "Running merge resolution for $cl->{CommitId}...\n";
+                   $mwrecknote->('new-base', $build);
+                   $build = merge_series
+                       $build, $cl->{MergeWreckNotes},
+                       $cl->{MergeInterchangeBaseInfo},
+                       @{ $cl->{Parents} };
+               }
                $last_anchor = $cl->{MergeBestAnchor};
 
                # Check for mismerges: