Diff options
Diffstat (limited to '')
-rwxr-xr-xtests/t0106-commit.sh12
1 file changed, 6 insertions, 6 deletions
diff --git a/tests/t0106-commit.sh b/tests/t0106-commit.sh
index 5564038..9a0a7e1 100755
--- a/tests/t0106-commit.sh
+++ b/tests/t0106-commit.sh
@@ -1,8 +1,7 @@
#!/bin/sh
# The commit page. Most checks read the markup for the tree link, the parent
-# link, the subject and the diffstat. The last few use a root commit, which
-# has no parent and diffs against the empty tree.
+# link, the subject and the diffstat.
test_description='Check content on commit page'
. ./setup.sh
@@ -38,8 +37,9 @@ test_expect_success 'a commit that changes no files draws no diffstat table' '
! grep "<table class=.diffstat.>" tmp
'
+# A root commit has no parent, so it diffs against the empty tree.
test_expect_success 'get root commit' '
- root=$(cd repos/foo && git rev-list --reverse HEAD | head -1) &&
+ root=$(git -C repos/foo rev-list --max-parents=0 HEAD) &&
cgit_url "foo/commit&id=$root" >tmp &&
grep "</html>" tmp
'
@@ -66,7 +66,7 @@ test_expect_success 'a message that is not UTF-8 has its stray bytes replaced' '
cid=$(git hash-object --literally -t commit -w raw) &&
git update-ref refs/heads/latin "$cid"
) &&
- cgit_query "url=foo/commit&h=latin" >tmp &&
+ cgit_url "foo/commit&h=latin" >tmp &&
grep "<div class=.commit-subject.>caf? subject<" tmp &&
grep "body ? end" tmp &&
! grep "caf$(printf "\351")" tmp
@@ -78,9 +78,9 @@ test_expect_success 'an octopus merge, which draws no diff, offers no diff optio
cid=$(git commit-tree -p HEAD -p HEAD~1 -p HEAD~2 -m octopus HEAD^{tree}) &&
git update-ref refs/heads/octopus "$cid"
) &&
- cgit_query "url=foo/commit&h=octopus" >tmp &&
+ cgit_url "foo/commit&h=octopus" >tmp &&
! grep "cgit-panel" tmp &&
- cgit_query "url=foo/commit" >tmp &&
+ cgit_url "foo/commit" >tmp &&
grep "cgit-panel" tmp
'