From 397f40c5e2d471582a688474df4aa1c9ed0f7a54 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 19 Aug 2018 22:27:56 +0100 Subject: git-debrebase: Break out record_gdrlast NFC Signed-off-by: Ian Jackson --- git-debrebase | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'git-debrebase') diff --git a/git-debrebase b/git-debrebase index 165dc66..8e347f1 100755 --- a/git-debrebase +++ b/git-debrebase @@ -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"; } -- cgit v1.2.3