Code

t800?-blame.sh: retitle uniquely
[git.git] / t / t9502-gitweb-standalone-parse-output.sh
index 741187b9e42558153e341a31c3c84c022ad3b8ae..dd8389000187b11fe126f6ca76f578324075bd6f 100755 (executable)
@@ -56,29 +56,57 @@ test_debug '
 
 test_expect_success 'snapshot: full sha1' '
        gitweb_run "p=.git;a=snapshot;h=$FULL_ID;sf=tar" &&
-       check_snapshot ".git-$FULL_ID" ".git"
+       check_snapshot ".git-$SHORT_ID"
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
 test_expect_success 'snapshot: shortened sha1' '
        gitweb_run "p=.git;a=snapshot;h=$SHORT_ID;sf=tar" &&
-       check_snapshot ".git-$SHORT_ID" ".git"
+       check_snapshot ".git-$SHORT_ID"
+'
+test_debug 'cat gitweb.headers && cat file_list'
+
+test_expect_success 'snapshot: almost full sha1' '
+       ID=$(git rev-parse --short=30 HEAD) &&
+       gitweb_run "p=.git;a=snapshot;h=$ID;sf=tar" &&
+       check_snapshot ".git-$SHORT_ID"
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
 test_expect_success 'snapshot: HEAD' '
        gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tar" &&
-       check_snapshot ".git-HEAD" ".git"
+       check_snapshot ".git-HEAD-$SHORT_ID"
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
 test_expect_success 'snapshot: short branch name (master)' '
        gitweb_run "p=.git;a=snapshot;h=master;sf=tar" &&
-       check_snapshot ".git-master" ".git"
+       ID=$(git rev-parse --verify --short=7 master) &&
+       check_snapshot ".git-master-$ID"
+'
+test_debug 'cat gitweb.headers && cat file_list'
+
+test_expect_success 'snapshot: short tag name (first)' '
+       gitweb_run "p=.git;a=snapshot;h=first;sf=tar" &&
+       ID=$(git rev-parse --verify --short=7 first) &&
+       check_snapshot ".git-first-$ID"
+'
+test_debug 'cat gitweb.headers && cat file_list'
+
+test_expect_success 'snapshot: full branch name (refs/heads/master)' '
+       gitweb_run "p=.git;a=snapshot;h=refs/heads/master;sf=tar" &&
+       ID=$(git rev-parse --verify --short=7 master) &&
+       check_snapshot ".git-master-$ID"
+'
+test_debug 'cat gitweb.headers && cat file_list'
+
+test_expect_success 'snapshot: full tag name (refs/tags/first)' '
+       gitweb_run "p=.git;a=snapshot;h=refs/tags/first;sf=tar" &&
+       check_snapshot ".git-first"
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
-test_expect_failure 'snapshot: hierarchical branch name (xx/test)' '
+test_expect_success 'snapshot: hierarchical branch name (xx/test)' '
        gitweb_run "p=.git;a=snapshot;h=xx/test;sf=tar" &&
        ! grep "filename=.*/" gitweb.headers
 '