diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-04-22 16:12:13 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-06-16 16:07:01 +0100 |
commit | def888415f7c15890ac55019b3187b5931c0682e (patch) | |
tree | aed3e81ee1a1ac6f1a44a30975882c4e7d09484b /git-debrebase | |
parent | d740305a9c26a80521480a1242f13e55b6928621 (diff) |
git-debrebase: break out do_stitch (nfc)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'git-debrebase')
-rwxr-xr-x | git-debrebase | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/git-debrebase b/git-debrebase index 7a49dd7..ab1990a 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 () { |