chiark / gitweb /
Push reorg: Postpone FF check
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 18 Sep 2016 11:46:37 +0000 (12:46 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 25 Sep 2016 19:12:52 +0000 (20:12 +0100)
We need to do this after the quilt fixup, because we are going to make
quilt fixup perhaps generate a pseudo-merge.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 879adea..90b1fde 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2513,22 +2513,6 @@ END
                " if this is intentional, use --new";
     }
 
-    my $forceflag = '';
-    if ($archive_hash) {
-       if (is_fast_fwd($archive_hash, 'HEAD')) {
-           # ok
-       } elsif (deliberately_not_fast_forward) {
-           $forceflag = '+';
-       } else {
-           fail "dgit push: HEAD is not a descendant".
-               " of the archive's version.\n".
-               "dgit: To overwrite its contents,".
-               " use git merge -s ours ".lrref().".\n".
-               "dgit: To rewind history, if permitted by the archive,".
-               " use --deliberately-not-fast-forward";
-       }
-    }
-
     supplementary_message(<<'END');
 Push failed, while preparing your push.
 You can retry the push, after fixing the problem, if you like.
@@ -2589,6 +2573,23 @@ END
     }
 
     check_not_dirty();
+
+    my $forceflag = '';
+    if ($archive_hash) {
+       if (is_fast_fwd($archive_hash, 'HEAD')) {
+           # ok
+       } elsif (deliberately_not_fast_forward) {
+           $forceflag = '+';
+       } else {
+           fail "dgit push: HEAD is not a descendant".
+               " of the archive's version.\n".
+               "dgit: To overwrite its contents,".
+               " use git merge -s ours ".lrref().".\n".
+               "dgit: To rewind history, if permitted by the archive,".
+               " use --deliberately-not-fast-forward";
+       }
+    }
+
     changedir $ud;
     progress "checking that $dscfn corresponds to HEAD";
     runcmd qw(dpkg-source -x --),