chiark / gitweb /
git-debpush: check that upstream tag is ancestor of $branch
authorSean Whitton <spwhitton@spwhitton.name>
Wed, 17 Jul 2019 08:31:41 +0000 (09:31 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 17 Jul 2019 13:12:27 +0000 (14:12 +0100)
Closes: #932096
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
git-debpush
tests/tests/tagupl

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
index cf750fe62cfadedf22164163921a3dd2b52c7efa..3b0a7a090ef567c108b2fdbcdc1f455ca87b42ea 100755 (executable)
@@ -27,7 +27,9 @@ t-tagupl-settings
 
 tagname=test-dummy/$v
 
+t-expect-fail "upstream tag $upstreamtag is not an ancestor of refs/heads/master" \
 t-tagupl-test --quilt=gbp --upstream=$upstreamtag
+t-tagupl-test --quilt=gbp --force --upstream=$upstreamtag
 t-pushed-good master
 
 # todo: test each miss/rejection