Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Log the path of a repository that will not open
The 404 page names only the repository and nothing reached the log, so
a mistyped repo.path left no trace of the path cgit had tried.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0205-config.sh | 14 |
1 file changed, 14 insertions, 0 deletions
diff --git a/tests/t0205-config.sh b/tests/t0205-config.sh index 3b892e9..5044148 100755 --- a/tests/t0205-config.sh +++ b/tests/t0205-config.sh @@ -179,4 +179,18 @@ test_expect_success 'a word in a scanned git config is reported' ' grep "Reading hide=true in $PWD/wordscan/foo.git/config line $line as 0, since it is not a whole number" err ' +# The error page names the repository alone, so the log gets the path that +# would not open, once for the request. +test_expect_success 'a repository that will not open is logged with its path' ' + cgit_rc gonerc "url=gone/log/" >tmp 2>err && + grep "^Status: 404 Not Found" tmp && + grep "Unable to open repository gone at $PWD/no/such/repo/.git: No such file or directory" err && + test_line_count = 1 err && + mkdir not-a-repo && + cgitrc_repo notreporc notrepo "repo.path=$PWD/not-a-repo" && + cgit_rc notreporc "url=notrepo/" >tmp 2>err && + grep "^Status: 404 Not Found" tmp && + grep "Unable to open repository notrepo at $PWD/not-a-repo: " err +' + test_done |
