chiark / gitweb /
test suite: tagupl: Use a different strategy to avoid fsck fail
[dgit.git] / tests / tests / tagupl
index e1f4391772064e6b9af79a358f60bf51b5733b6e..b4aa6ec9ac04dd96320bb339ef303eb37fe2e905 100755 (executable)
@@ -46,8 +46,16 @@ perl -i -ne '
        print or die $!;
 ' ../basetag
 
+mv-ident () {
+       local f=$tmp/$1
+       if test -e $f; then
+               mv $f $f--$ident
+       fi
+}
+
 next-mangle () {
-       mv ../tagupl/overall.log ../tagupl/overall.log-$ident
+       mv-ident tagupl/overall.log
+       mv-ident sendmail.log
        ident=$1
 }
 
@@ -67,6 +75,32 @@ expect-quit () {
        grep ": $mstring" ../tagupl/overall.log
 }
 
+tagname=test-dummy/1.2
+t-expect-fail E:'failed command: git fetch' \
+t-tagupl-run-drs
+
+tagname=splorf/$v     ; expect-quit baddistro '' 'tag name not for us'
+tagname=test-dummy/1,2; expect-quit badver    '' 'tag name not for us'
+tagname=test-dummy/$v
+
 expect-quit noplease s/please-upload/plunk/ 'tag missing please-upload'
 
+# we are going to trash $p because it will contain corrupted objects
+# which makes our end-of-test fsck fail
+cp -al ../$p ../$p.save
+cd ../$p
+
+next-mangle badtagger
+git cat-file tag test-dummy/1.0-1 | perl -pe '
+       s/\+\d+$/xyz/ if m/^tagger /;
+       exit 0 if m/^$/;
+' >../tagobj-$ident
+echo >>../tagobj-$ident
+cat ../basetag >>../tagobj-$ident
+git update-ref $tagname $(git hash-object -w -t tag ../tagobj-$ident)
+
+cd ..
+rm -rf $p
+mv $p.save $p
+
 t-ok