chiark / gitweb /
git-debrebase: convert-from-*: leave debrebase-last refs
[dgit.git] / git-debrebase
index d80c8d35bb1875e509f658077eb3a1ed7cb7c69a..9d0bda0b41b4cc6ccce0c1f6bd87144bb36dd77d 100755 (executable)
@@ -2416,15 +2416,19 @@ sub begin_convert_from () {
 
     fail "ffq-prev exists, this is already managed by git-debrebase!"
        if $ffq_prev && git_get_ref $ffq_prev;
+
+    my $gdrlast_obj = $gdrlast && git_get_ref $gdrlast;
     snag 'already-converted',
        "ahead of debrebase-last, this is already managed by git-debrebase!"
-       if $gdrlast && git_get_ref $gdrlast && is_fast_fwd $gdrlast, $head;
-    return ($head, undef);
+       if $gdrlast_obj && is_fast_fwd $gdrlast_obj, $head;
+    return ($head, { LastRef => $gdrlast, LastObj => $gdrlast_obj });
 }
 
 sub complete_convert_from ($$$$) {
     my ($old_head, $new_head, $gi, $mrest) = @_;
     ffq_check $new_head;
+    record_gdrlast $gi->{LastRef}, $new_head, $gi->{LastObj}
+       if $gi->{LastRef};
     snags_maybe_bail();
     update_head_checkout $old_head, $new_head, $mrest;
 }