chiark / gitweb /
git-debrebase: ffq_prev_branchinfo: return $drlast
[dgit.git] / git-debrebase
index 9d87e76760ce866c717e0962fdec78868652bc4f..eddbf6b6ccf101febd229008e8b312b2af3658e3 100755 (executable)
@@ -877,7 +877,7 @@ sub cmd_analyse () {
 }
 
 sub ffq_prev_branchinfo () {
-    # => ('status', "message", [$current, $ffq_prev])
+    # => ('status', "message", [$current, $ffq_prev, $drlast])
     # 'status' may be
     #    branch         message is undef
     #    weird-symref   } no $current,
@@ -887,8 +887,9 @@ sub ffq_prev_branchinfo () {
     return ('weird-symref', 'HEAD symref is not to refs/')
        unless $current =~ m{^refs/};
     my $ffq_prev = "refs/$ffq_refprefix/$'";
+    my $drlast = "refs/$gdrlast_refprefix/$'";
     printdebug "ffq_prev_branchinfo branch current $current\n";
-    return ('branch', undef, $current, $ffq_prev);
+    return ('branch', undef, $current, $ffq_prev, $drlast);
 }
 
 sub record_ffq_prev_deferred () {
@@ -903,7 +904,8 @@ sub record_ffq_prev_deferred () {
     # if "deferred", will have added something about that to
     #   @deferred_update_messages, and also maybe printed (already)
     #   some messages about ff checks
-    my ($status, $message, $current, $ffq_prev) = ffq_prev_branchinfo();
+    my ($status, $message, $current, $ffq_prev, $drlast)
+       = ffq_prev_branchinfo();
     return ($status, $message) unless $status eq 'branch';
 
     my $currentval = get_head();
@@ -1191,7 +1193,8 @@ sub cmd_stitch () {
     my $prose = '';
     GetOptions('prose=s', \$prose) or die badusage("bad options to stitch");
     badusage "no arguments allowed" if @ARGV;
-    my ($status, $message, $current, $ffq_prev) = ffq_prev_branchinfo();
+    my ($status, $message, $current, $ffq_prev, $drlast)
+       = ffq_prev_branchinfo();
     if ($status ne 'branch') {
        fproblem $status, "could not check ffq-prev: $message";
        fproblems_maybe_bail();
@@ -1293,7 +1296,7 @@ sub cmd_convert_from_gbp () {
 sub cmd_convert_to_gbp () {
     badusage "no arguments allowed" if @ARGV;
     my $head = get_head();
-    my $ffq = (ffq_prev_branchinfo())[3];
+    my (undef, undef, undef, $ffq, $drlast) = ffq_prev_branchinfo();
     my $bw = breakwater_of $head;
     fresh_workarea();
     my $out;