From: Ian Jackson Date: Sun, 22 Apr 2018 15:12:13 +0000 (+0100) Subject: git-debrebase: break out do_stitch (nfc) X-Git-Tag: archive/debian/5.0~75 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=def888415f7c15890ac55019b3187b5931c0682e git-debrebase: break out do_stitch (nfc) Signed-off-by: Ian Jackson --- diff --git a/git-debrebase b/git-debrebase index 7a49dd76..ab1990af 100755 --- a/git-debrebase +++ b/git-debrebase @@ -1072,6 +1072,21 @@ sub stitch ($$$$$) { update_head $old_head, $new_head, "stitch: $prose"; } +sub do_stitch ($) { + my ($prose) = @_; + + my ($ffq_prev, $gdrlast, $ffq_prev_commitish) = ffq_prev_info(); + if (!$ffq_prev_commitish) { + fail "No ffq-prev to stitch." unless $opt_noop_ok; + return; + } + my $dangling_head = get_head(); + + keycommits $dangling_head, \&snag, \&snag, \&snag; + + stitch($dangling_head, $ffq_prev, $gdrlast, $ffq_prev_commitish, $prose); +} + sub cmd_new_upstream_v0 () { # automatically and unconditionally launders before rebasing # if rebase --abort is used, laundering has still been done @@ -1286,17 +1301,7 @@ sub cmd_stitch () { my $prose = 'stitch'; GetOptions('prose=s', \$prose) or die badusage("bad options to stitch"); badusage "no arguments allowed" if @ARGV; - - my ($ffq_prev, $gdrlast, $ffq_prev_commitish) = ffq_prev_info(); - if (!$ffq_prev_commitish) { - fail "No ffq-prev to stitch." unless $opt_noop_ok; - return; - } - my $old_head = get_head(); - - keycommits $old_head, \&snag, \&snag, \&snag; - - stitch($old_head, $ffq_prev, $gdrlast, $ffq_prev_commitish, $prose); + do_stitch($prose); } sub cmd_convert_from_gbp () {