chiark / gitweb /
Test suite: Check tag updates work properly
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 4 Jul 2015 18:03:44 +0000 (19:03 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 4 Jul 2015 20:38:48 +0000 (21:38 +0100)
tests/tests/tag-updates [new file with mode: 0755]

diff --git a/tests/tests/tag-updates b/tests/tests/tag-updates
new file mode 100755 (executable)
index 0000000..544be16
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-tstunt-parsechangelog
+t-prep-newpackage example 1.0
+
+cd $p
+revision=1
+t-dgit build
+t-dgit push --new
+
+tagref=`t-v-tag`
+tagname=${tn#refs/tags}
+
+(set -e
+ cd $tmp/git/$p.git
+ git tag -m UNWANTED unwanted dgit/sid)
+
+fetch-check () {
+       t-dgit fetch
+       t-ref-same-exact $tagref
+       t-refs-notexist refs/tags/unwanted
+       git rev-parse refs/dgit-fetch/sid/tags/unwanted
+}
+
+t-ref-same-exact $tagref
+fetch-check
+
+git tag -d $tagname
+fetch-check
+
+git tag -f -m BOGUS $tagname HEAD
+t-refs-same-start
+t-ref-same-exact $tagref
+fetch-check
+
+echo done.