chiark / gitweb /
git-debrebase: New feature `scrap'
[dgit.git] / git-debrebase
index 98e645a43a9255b81a7821a671b406239c922f90..62fbf6156c06e644fffdf17be99f4f0e7e9ea9a7 100755 (executable)
@@ -1577,6 +1577,18 @@ sub cmd_conclude () {
     do_stitch 'quick';
 }
 
+sub cmd_scrap () {
+    my ($ffq_prev, $gdrlast, $ffq_prev_commitish) = ffq_prev_info();
+    fail "No ongoing git-debrebase session." unless $ffq_prev_commitish;
+    my $scrapping_head = get_head();
+    badusage "no arguments allowed" if @ARGV;
+    push @deferred_updates,
+       "update $gdrlast $ffq_prev_commitish $git_null_obj",
+       "update $ffq_prev $git_null_obj $ffq_prev_commitish";
+    snags_maybe_bail();
+    update_head_checkout $scrapping_head, $ffq_prev_commitish, "scrap";
+}
+
 sub make_patches_staged ($) {
     my ($head) = @_;
     # Produces the patches that would result from $head if it were