chiark / gitweb /
git-debrebase: Break out record_gdrlast
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Aug 2018 21:27:56 +0000 (22:27 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Aug 2018 21:27:56 +0000 (22:27 +0100)
NFC

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 165dc66..8e347f1 100755 (executable)
@@ -428,6 +428,11 @@ sub any_snags () {
     return $snags_forced || $snags_tripped;
 }
 
+sub record_gdrlast ($$) {
+    my ($gdrlast, $newvalue) = @_;
+    push @deferred_updates, "update $gdrlast $newvalue $git_null_obj";
+}
+
 sub gbp_pq_export ($$$) {
     my ($bname, $base, $tip) = @_;
     # must be run in a workarea.  $bname and patch-queue/$bname
@@ -1881,8 +1886,7 @@ sub stitch ($$$$$) {
            # ffq-prev is ahead of us, and the only tree changes it has
            # are possibly addition of things in debian/patches/.
            # Just wind forwards rather than making a pointless pseudomerge.
-           push @deferred_updates,
-               "update $gdrlast $ffq_prev_commitish $git_null_obj";
+           record_gdrlast $gdrlast, $ffq_prev_commitish;
            update_head_checkout $old_head, $ffq_prev_commitish,
                "stitch (fast forward)";
            return;
@@ -1895,7 +1899,7 @@ sub stitch ($$$$$) {
        'Declare fast forward / record previous work',
         "[git-debrebase pseudomerge: $prose]",
     ];
-    push @deferred_updates, "update $gdrlast $new_head $git_null_obj";
+    record_gdrlast $gdrlast, $new_head;
     update_head $old_head, $new_head, "stitch: $prose";
 }