chiark / gitweb /
Push reorg: Postpone FF check
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 879adea2c6252f64e9bb9cae537cbb53744aa30f..90b1fde67a5cb9887e42dec2e3be18c2c2183347 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 --),