summaryrefslogtreecommitdiff
path: root/t/t9501-gitweb-standalone-http-status.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-11-23 22:28:31 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-11-23 22:28:31 -0800
commit2a971012b6be236c46cab7212239d70d92b02715 (patch)
treeca5f9efba4fed1236e686818629213bac12ce319 /t/t9501-gitweb-standalone-http-status.sh
parentMerge branch 'cc/replace' (diff)
parentt/gitweb-lib: Split HTTP response with non-GNU sed (diff)
downloadtgif-2a971012b6be236c46cab7212239d70d92b02715.tar.xz
Merge branch 'mr/gitweb-snapshot'
* mr/gitweb-snapshot: t/gitweb-lib: Split HTTP response with non-GNU sed gitweb: Smarter snapshot names gitweb: Document current snapshot rules via new tests t/gitweb-lib.sh: Split gitweb output into headers and body gitweb: check given hash before trying to create snapshot
Diffstat (limited to 't/t9501-gitweb-standalone-http-status.sh')
-rwxr-xr-xt/t9501-gitweb-standalone-http-status.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
index d0ff21d426..0688a57e1d 100755
--- a/t/t9501-gitweb-standalone-http-status.sh
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -75,4 +75,43 @@ test_expect_success \
test_debug 'cat gitweb.output'
+# ----------------------------------------------------------------------
+# snapshot hash ids
+
+test_expect_success 'snapshots: good tree-ish id' '
+ gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+ grep "Status: 200 OK" gitweb.output
+'
+test_debug 'cat gitweb.output'
+
+test_expect_success 'snapshots: bad tree-ish id' '
+ gitweb_run "p=.git;a=snapshot;h=frizzumFrazzum;sf=tgz" &&
+ grep "404 - Object does not exist" gitweb.output
+'
+test_debug 'cat gitweb.output'
+
+test_expect_success 'snapshots: bad tree-ish id (tagged object)' '
+ echo object > tag-object &&
+ git add tag-object &&
+ git commit -m "Object to be tagged" &&
+ git tag tagged-object `git hash-object tag-object` &&
+ gitweb_run "p=.git;a=snapshot;h=tagged-object;sf=tgz" &&
+ grep "400 - Object is not a tree-ish" gitweb.output
+'
+test_debug 'cat gitweb.output'
+
+test_expect_success 'snapshots: good object id' '
+ ID=`git rev-parse --verify HEAD` &&
+ gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
+ grep "Status: 200 OK" gitweb.output
+'
+test_debug 'cat gitweb.output'
+
+test_expect_success 'snapshots: bad object id' '
+ gitweb_run "p=.git;a=snapshot;h=abcdef01234;sf=tgz" &&
+ grep "404 - Object does not exist" gitweb.output
+'
+test_debug 'cat gitweb.output'
+
+
test_done