chiark / gitweb /
git-debrebase: merge: Actually record merge resolutions
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Aug 2018 00:36:59 +0000 (01:36 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Aug 2018 00:45:19 +0000 (01:45 +0100)
And, destroy it on scrap.

Nothing consumes this yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase
tests/tests/gdr-merge-conflicts

index 09e0907..96966ad 100755 (executable)
@@ -56,6 +56,7 @@ our ($opt_defaultcmd_interactive);
 our $us = qw(git-debrebase);
 
 our $wrecknoteprefix = 'refs/debrebase/wreckage';
+our $merge_cache_ref = 'refs/debrebase/merge-resolutions';
 
 $|=1;
 
@@ -2216,6 +2217,10 @@ sub cmd_scrap () {
            "update $gdrlast $ffq_prev_commitish $git_null_obj",
            "update $ffq_prev $git_null_obj $ffq_prev_commitish";
     }
+    if (git_get_ref $merge_cache_ref) {
+       push @deferred_updates,
+           "delete $merge_cache_ref";
+    }
     if (!@deferred_updates) {
        fail "No ongoing git-debrebase session." unless $opt_noop_ok;
        finish 0;
@@ -2622,6 +2627,7 @@ END
 
 sub cmd_record_resolved_merge () {
     badusage "record-resolved-merge takes no further arguments" if @ARGV;
+    # xxx needs documentation
     my $new = get_head();
     my $method;
 
@@ -2631,8 +2637,8 @@ sub cmd_record_resolved_merge () {
     my $maybe = sub { print "Seems to be $method.\n"; };
     my $yes = sub {
        my ($key, $ref) = @_;
+       reflog_cache_insert $merge_cache_ref, $key, $ref;
        print "OK.  You can switch branches and try git-debrebase again.\n";
-       confess "todo $ref"; # xxx
        1;
     };
 
index f0abea7..12e7055 100755 (executable)
@@ -112,7 +112,6 @@ git commit -m FIX
 git reset --hard
 git clean -xdff
 
-t-expect-fail F:todo \
 t-git-debrebase record-resolved-merge
 
 git checkout master