chiark / gitweb /
Test suite: drs-push-rejects: Test push of same version with different dgit
[dgit.git] / tests / tests / drs-push-rejects
index 37828908a45e3997b3a5a3b6c8e5a101399384ae..f87cbdcbefc5f873b32c74b3b36e830534c30dae 100755 (executable)
@@ -27,16 +27,20 @@ mustsucceed () {
 
 prep () {
        local suite=$1
-       local csuite=$2
+       csuite=$2
        cp $tmp/masters/* $tmp/.
        tag_signer='-u Senatus'
        tag_message="$p release $version for $suite ($csuite) [dgit]"
-       tag_name=test-dummy/$version
+       re-prep
+}
+re-prep () {
+       tag_name=$tagpfx/$version
        push_spec1="HEAD:refs/dgit/$csuite"
        push_spec2="refs/tags/$tag_name"
        push_spec="$push_spec1 $push_spec2"
 }
 mktag () {
+       t-git-next-date
        git tag -f $tag_signer -m "$tag_message" $tag_name "$@"
 }
 
@@ -101,7 +105,8 @@ mustfail 'push is missing tag ref update' $push_spec1
 mustfail 'push is missing head ref update' +$push_spec2
 mustfail 'pushing unexpected ref' $push_spec HEAD:refs/wombat
 mustfail 'pushing multiple heads' $push_spec HEAD:refs/dgit/wombat
-mustfail 'pushing multiple tags' $push_spec HEAD:refs/tags/test-dummy/wombat
+mustfail E:'pushing multiple tags|pushing too many similar tags' \
+       $push_spec HEAD:refs/tags/$tagpfx/wombat
 
 prep unstable sid
 mktag
@@ -128,11 +133,11 @@ mktag HEAD~:
 mustfail 'tag refers to wrong kind of object' $push_spec
 
 prep unstable sid
-tag_name=test-dummy/wombat
+tag_name=$tagpfx/wombat
 mktag
-#git update-ref test-dummy/$version test-dummy/wombat
+#git update-ref $tagpfx/$version $tagpfx/wombat
 mustfail 'tag name in tag is wrong' \
-       refs/tags/test-dummy/wombat:refs/tags/test-dummy/$version $push_spec1
+       refs/tags/$tagpfx/wombat:refs/tags/$tagpfx/$version $push_spec1
 
 prep unstable sid
 mktag
@@ -144,6 +149,12 @@ mustfail 'push is missing head ref update' $push_spec1 +$push_spec2
 git commit --allow-empty -m 'Dummy update'
 mktag
 mustfail 'not replacing previously-pushed version' +$push_spec1 +$push_spec2
+
+t-newtag
+re-prep
+mktag
+mustfail 'not replacing previously-pushed version' +$push_spec1 +$push_spec2
+
 git reset --hard HEAD~
 
 prep_dm_mangle () {