chiark / gitweb /
git-debpush: check that upstream tag is ancestor of $branch
[dgit.git] / git-debpush
index 80594f5cd0c5f392521fa6c77a052792abb048f2..39ff4103150a504bc73971d155f7e2f29ceb51d7 100755 (executable)
@@ -278,6 +278,14 @@ if ! [ "x$last_debian_tag" = "x" ]; then
     fi
 fi
 
+if ! [ "x$upstream_tag" = "x" ] \
+        && ! git merge-base --is-ancestor "$upstream_tag" "$branch" \
+        && ! [ "$quilt_mode" = "baredebian" ]; then
+    fail_check \
+ "upstream tag $upstream_tag is not an ancestor of $branch; probably a mistake"
+fi
+
+
 if ! $force && $failed_check; then
     fail "some checks failed; you can override with --force"
 fi