chiark / gitweb /
git-debrebase: test suite: gdr-newupstream-v0: new test
[dgit.git] / git-debrebase
index 2dbfa90e4de218224b791709c63b53e3ff2e56df..8e472514c34f82c92affe9dd629a71a7c770a28e 100755 (executable)
@@ -893,12 +893,7 @@ sub cmd_launder_v0 () {
 
 sub defaultcmd_rebase () {
     my $old = get_head();
-    my ($status, $message) = record_ffq_prev_deferred();
-    if ($status eq 'deferred' || $status eq 'exists') {
-    } else {
-       fproblem $status, "could not record ffq-prev: $message";
-       fproblems_maybe_bail();
-    }
+    record_ffq_auto();
     my ($tip,$breakwater) = walk $old;
     update_head_postlaunder $old, $tip, 'launder for rebase';
     runcmd @git, qw(rebase), @ARGV, $breakwater;
@@ -1015,6 +1010,15 @@ sub record_ffq_prev_deferred () {
     return ('deferred', undef);
 }
 
+sub record_ffq_auto () {
+    my ($status, $message) = record_ffq_prev_deferred();
+    if ($status eq 'deferred' || $status eq 'exists') {
+    } else {
+       fproblem $status, "could not record ffq-prev: $message";
+       fproblems_maybe_bail();
+    }
+}
+
 sub cmd_new_upstream_v0 () {
     # automatically and unconditionally launders before rebasing
     # if rebase --abort is used, laundering has still been done
@@ -1029,6 +1033,8 @@ sub cmd_new_upstream_v0 () {
 
     my $new_upstream = git_rev_parse shift @ARGV;
 
+    record_ffq_auto();
+
     my $piece = sub {
         my ($n, @x) = @_; # may be ''
         my $pc = $pieces{$n} //= {
@@ -1064,13 +1070,13 @@ sub cmd_new_upstream_v0 () {
     # now we need to investigate the branch this generates the
     # laundered version but we don't switch to it yet
     my $old_head = get_head();
-    my ($old_laundered_tip,$old_bw,$old_upstream_update) = walk $old_head;
+    my ($old_laundered_tip,$old_bw,$old_anchor) = walk $old_head;
 
     my $old_bw_cl = classify $old_bw;
-    my $old_upstream_update_cl = classify $old_upstream_update;
-    confess unless $old_upstream_update_cl->{OrigParents};
+    my $old_anchor_cl = classify $old_anchor;
+    confess unless $old_anchor_cl->{OrigParents};
     my $old_upstream = parsecommit
-        $old_upstream_update_cl->{OrigParents}[0]{CommitId};
+        $old_anchor_cl->{OrigParents}[0]{CommitId};
 
     $piece->('', Old => $old_upstream->{CommitId});