summaryrefslogtreecommitdiff
path: root/git-debrebase
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-08-25 13:33:16 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-08-25 13:34:17 +0100
commit8c94cb4bc182dc63bd51adb430c1649dbb3da37e (patch)
tree8733ee3e6da83dddf72a830c76fa6b8ffe459dde /git-debrebase
parent7b8e6ff1d7c697ec131f6ab9106583c8a28d3e7f (diff)
git-debrebase: convert-to-gbp: Handle no-patches case better
In this case it's very like git-debrebase forget-was-debrebase. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'git-debrebase')
-rwxr-xr-xgit-debrebase19
1 files changed, 12 insertions, 7 deletions
diff --git a/git-debrebase b/git-debrebase
index 353b405..a67008f 100755
--- a/git-debrebase
+++ b/git-debrebase
@@ -2635,13 +2635,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";