chiark / gitweb /
git-debrebase: Break out do_launder_head (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 29 Mar 2018 18:48:04 +0000 (19:48 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Jun 2018 15:07:01 +0000 (16:07 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 171324671faed440b06338d41208b3eeda52e47b..866b0ded6cfe06bc30469ca01935f805b62f306d 100755 (executable)
@@ -885,6 +885,15 @@ sub update_head_postlaunder ($$$) {
     runcmd @git, qw(rm --quiet --ignore-unmatch -rf debian/patches);
 }
 
     runcmd @git, qw(rm --quiet --ignore-unmatch -rf debian/patches);
 }
 
+sub do_launder_head ($) {
+    my ($reflogmsg) = @_;
+    my $old = get_head();
+    record_ffq_auto();
+    my ($tip,$breakwater) = walk $old;
+    update_head_postlaunder $old, $tip, $reflogmsg;
+    return ($tip,$breakwater);
+}
+
 sub cmd_launder_v0 () {
     badusage "no arguments to launder-v0 allowed" if @ARGV;
     my $old = get_head();
 sub cmd_launder_v0 () {
     badusage "no arguments to launder-v0 allowed" if @ARGV;
     my $old = get_head();
@@ -896,10 +905,7 @@ sub cmd_launder_v0 () {
 }
 
 sub defaultcmd_rebase () {
 }
 
 sub defaultcmd_rebase () {
-    my $old = get_head();
-    record_ffq_auto();
-    my ($tip,$breakwater) = walk $old;
-    update_head_postlaunder $old, $tip, 'launder for rebase';
+    my ($tip,$breakwater) = do_launder_head 'launder for rebase';
     runcmd @git, qw(rebase), @ARGV, $breakwater;
 }
 
     runcmd @git, qw(rebase), @ARGV, $breakwater;
 }