summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2014-03-06 00:46:48 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2014-03-06 00:46:48 +0000
commit4455e483399bb622093aac0ff1cbb93795669859 (patch)
treecdc2cf20ca601637d8cfe72707e25a30557096ba
parent8a8f3f8c39b086d8d0987f979ca0120efc373c12 (diff)
dgit-repos-server: some better error msgs, more tests
-rwxr-xr-xdgit-repos-server6
-rwxr-xr-xtests/tests/drs-push-rejects14
2 files changed, 17 insertions, 3 deletions
diff --git a/dgit-repos-server b/dgit-repos-server
index add5424..49fa795 100755
--- a/dgit-repos-server
+++ b/dgit-repos-server
@@ -464,9 +464,9 @@ sub tagh1 ($) {
sub checks () {
debug "checks";
checksuite();
- tagh1('type') eq 'commit' or die;
- tagh1('object') eq $commit or die;
- tagh1('tag') eq $tagname or die;
+ tagh1('type') eq 'commit' or reject "tag refers to wrong kind of object";
+ tagh1('object') eq $commit or reject "tag refers to wrong commit";
+ tagh1('tag') eq $tagname or reject "tag name in tag is wrong";
my $v = $version;
$v =~ y/~:/_%/;
diff --git a/tests/tests/drs-push-rejects b/tests/tests/drs-push-rejects
index fa3b530..aa092bc 100755
--- a/tests/tests/drs-push-rejects
+++ b/tests/tests/drs-push-rejects
@@ -97,7 +97,17 @@ cp $tmp/dm.gpg $tmp/dd.gpg
mustfail 'key not found in keyrings' $push_spec
prep unstable sid
+mktag HEAD~
+mustfail 'tag refers to wrong commit' $push_spec
+
+prep unstable sid
+mktag HEAD~:
+mustfail 'tag refers to wrong kind of object' $push_spec
+
+prep unstable sid
+mktag
mustsucceed $push_spec # succeeds
+
mktag
mustfail 'not replacing previously-pushed version' $push_spec
@@ -113,6 +123,10 @@ prep_dm_mangle () {
git checkout v2
version=3-2_dummy2
+prep_dm_mangle ''
+perl -i.bak -ne 'print if 1..s/(pari-extra).*\n/$1/' $tmp/dm.txt
+mustfail '' $push_spec # malformed (truncated) dm.txt; don't care about msg
+
prep_dm_mangle 's/allow:/asponge:/i'
mustfail 'missing Allow section in permission' $push_spec