chiark / gitweb /
Dgit: Break out $tarball_f_ext_re.
[dgit.git] / git-debpush
index 841937510b6f1666cafb52dc43cc490cd102d001..c3b067dca4eff7feb0edab1812c33694f3e29e5e 100755 (executable)
@@ -230,6 +230,14 @@ case "$quilt_mode" in
     *) badusage "invalid quilt mode: $quilt_mode" ;;
 esac
 
+# **** Early sanity check ****
+
+if [ "$branch" = "HEAD" ] \
+       && ! git symbolic-ref --quiet HEAD >/dev/null; then
+    fail_check detached \
+               "HEAD is detached; you probably don't want to debpush it"
+fi
+
 # **** Gather git information ****
 
 remoteconfigs=()
@@ -411,6 +419,20 @@ case "$quilt_mode" in
         ;;
 esac
 
+# ---- git-debrebase branch format checks
+
+# only check branches, since you can't run `git debrebase conclude` on
+# non-branches
+case "$branch" in
+    refs/heads/*)
+        # see "STITCHING, PSEUDO-MERGES, FFQ RECORD" in git-debrebase(5)
+        ffq_prev_ref="refs/ffq-prev/${branch#refs/}"
+        if git show-ref --quiet --verify "$ffq_prev_ref"; then
+            fail_check unstitched \
+ "this looks like an unstitched git-debrebase branch, which should not be pushed"
+        fi
+esac
+
 # ---- Summary
 
 if $failed_check; then