chiark / gitweb /
git-debrebase: keycommits: Fix doc comment
[dgit.git] / git-debrebase
index 353b405ffa9cbec39ebefd2d001614da02426bf1..d0fc8fd75032c963a2f8dff319af890d0cff3a08 100755 (executable)
@@ -1081,9 +1081,8 @@ sub keycommits ($;$$$$$) {
     my ($head, $furniture, $unclean, $trouble, $fatal, $claimed_bw) = @_;
     # => ($anchor, $breakwater)
 
-    # $unclean->("unclean-$tagsfx", $msg, $cl)
     # $furniture->("unclean-$tagsfx", $msg, $cl)
-    # $dgitimport->("unclean-$tagsfx", $msg, $cl))
+    # $unclean->("unclean-$tagsfx", $msg, $cl)
     #   is callled for each situation or commit that
     #   wouldn't be found in a laundered branch
     # $furniture is for furniture commits such as might be found on an
@@ -2635,13 +2634,18 @@ sub cmd_convert_to_gbp () {
     my (undef, undef, undef, $ffq, $gdrlast) = ffq_prev_branchinfo();
     my ($anchor, $breakwater) = keycommits $head, 0;
     my $out = $breakwater;
-    make_patches_staged $head;
-    in_workarea sub {
-       $out = make_commit [$out], [
-            'Commit patch queue (converted from git-debrebase format)',
-            '[git-debrebase convert-to-gbp: commit patches]',
-        ];
-    };
+    my $any = make_patches_staged $head;
+    if ($any) {
+       in_workarea sub {
+           $out = make_commit [$out], [
+               'Commit patch queue (converted from git-debrebase format)',
+               '[git-debrebase convert-to-gbp: commit patches]',
+           ];
+       };
+    } else {
+       # in this case, it can be fast forward
+       $out = $head;
+    }
     if (defined $ffq) {
        push @deferred_updates, "delete $ffq";
        push @deferred_updates, "delete $gdrlast";