AgeCommit message (Collapse)AuthorLines
Return nothing from html_includeBryce Kwon-15/+4
No caller reads the result, and a void html_include fits the Lua binding's callback as it is, so the wrapper that dropped it goes too.
Open and close each page through the layout callsBryce Kwon-51/+37
Sort with git's QSORTBryce Kwon-21/+9
QSORT skips a list of fewer than two entries, so an empty list's null base never reaches qsort, which is what cgit_qsort was written for.
Allocate formatted strings with git's xstrfmtBryce Kwon-30/+15
Spell non-zero the way the tree doesBryce Kwon-3/+3
Say the highlighter needs Scintillua's detect()Bryce Kwon-2/+3
Reuse the ids t0109 has already looked upBryce Kwon-2/+0
Drop the patch greps the comparisons already makeBryce Kwon-20/+0
The From, Date, Subject and signature lines are part of what the next test compares in full against git format-patch, for the single commit and for the range alike.
Put the valgrind comment above the loop it explainsBryce Kwon-3/+3
Drop two setup.sh lines that change nothingBryce Kwon-5/+3
The library has read TEST_RESULTS_SAN_DIR for the last time by the time it returns, and the trash directory it makes is empty, so there is no cache to remove.
Tighten the checks that match stray textBryce Kwon-8/+8
Every page holds foo in its footer element, the foo+bar row holds bar, the branch switcher holds master, and commit 1 and file-1 also match commits 10 to 19 and file-10 to file-19. A search page repeats its term in the search box. So these checks passed on pages that lacked what they look for, and each now matches the link itself.
Require a whole page when a filter exits earlyBryce Kwon-2/+3
When a filter cannot run, cgit dies mid-page with its Status line already out, so the check passed with no filter at all. That is the case wherever true lives only in /bin, as on busybox. true now comes from the PATH, and the page has to reach its end.
Make the main cgitrc filter check run the filterBryce Kwon-3/+6
The check asked for the summary page, which never runs an about filter, so it passed with exec:/bin/true on macOS, which has no such file, and with a filter that does not exist at all. Its first line read the stderr the previous test left behind. execvp searches the PATH, so a plain true runs the same on macOS, Debian and busybox.
Let go of a slot lock that cannot take its keyBryce Kwon-0/+18
A failed truncate or key write returned with the descriptor still open, so the lock was held while the page rendered uncached and the file was left behind. It is removed before its last close, as every holder does.
Keep lock contention out of the error logBryce Kwon-13/+45
process_slot logged every failure to lock, so each request that found its slot being filled left a line, while refresh_slot logged none, so an expired slot in a directory the server cannot write was served stale for good without a word. lock_slot now logs the step that failed, as the scan does, and leaves out only another request at work.
Lock the cached repolist with flockBryce Kwon-9/+42
The slot lock has to be an flock, since an exec filter drops a record lock when it closes the stdout a fill writes through. The scan only got by with fcntl because nothing reopens its file while it runs. One kind of lock lets the two share their code, and on Linux, where the kinds never see each other, an flock on the scan's file now holds a scan off like any other.
Open the lock files close-on-execBryce Kwon-2/+31
Each exec filter and snapshot compressor a fill runs inherited the slot's lock descriptor beside the stdout it writes into. An flock lasts until its last copy closes and nothing waits for a process a filter leaves behind, so a fill killed before its rename could leave the slot locked, and served stale or uncached, for as long as such a process lived. The scan holds its lock across no exec and opens the same way so that the two stay alike.
Tidy the cache test's helpers and outputsBryce Kwon-24/+18
The header's last sentence named two of the many later subjects, so it goes too. The second request's stderr is still kept, for the lock tests that come next.
Use test_dir_is_empty for the empty cache checksBryce Kwon-16/+8
The library's check also lists whatever was left behind when it fails.
Catch a lexer's failure in one placeBryce Kwon-12/+9
filter_close already runs highlight under pcall and serves the escaped text when it fails, so the pcalls around detect, load and lex inside it only turned a raise into the same fallback a step earlier.
Write a session's expiry in whole secondsBryce Kwon-0/+21
On Lua 5.3 and later a length worked out with a fraction, such as 1.5 * 24 * 60 * 60, is a float, so the signed expiry came out as 1793609024.0, which validate_value refuses, and every login failed. Max-Age took the same .0, which makes a browser ignore it.
Drop an auth prerequisite no test asks forBryce Kwon-4/+2
Set the Lua prerequisite once for every testBryce Kwon-87/+27
setup.sh already asks the binary, so the seven scripts that each turned the answer into a prerequisite now share one. test-lib names the missing prerequisite beside every test it skips, so the notes that cgit lacks Lua go, while the ones announcing a fallback stay. The list of standalone interpreters moves into lib.sh and matches the versions the extensions claim directly.
Move the highlighter fallback check into t0502Bryce Kwon-24/+12
t0502 owns the shipped highlighter and already writes a cgitrc naming it, so the check needs no config of its own there. t0204's header still called it the last case long after it stopped being one.
Share the request helpers in the auth checksBryce Kwon-77/+49
The two identical posts for an unknown user become one, and no two checks share a name, so a failure report points at a single check.
Let an unmirrored sink fail the way Lua wouldBryce Kwon-12/+0
Drop the auth stubs no check reachesBryce Kwon-20/+6
Every check replaces get_secret, the only caller of posix.sys.stat, link and unlink, and nothing outside the harness calls preload.
Collect an email filter's writes like the othersBryce Kwon-10/+12
Say what really differs between the auth filtersBryce Kwon-6/+8
The lookups were never the only difference, since the configuration and trim's place differ as well. The configuration is now set off by blank lines, as in the other extensions, instead of a heading.
Drop auth guards for input cgit never sendsBryce Kwon-21/+10
cgit names no repository with an empty string, never nil, so the check that the index stays up proved nothing, and auth-file in fact refuses the index too while its repos file cannot be read. A session_seconds of 0 signs a session that has expired by the time it comes back, so it needs no branch of its own in set_cookie.
Strip control characters from the location aloneBryce Kwon-20/+12
set_cookie only ever writes an empty value or a token secure_value built from url-encoded text, digits and hex, so stripping it changed nothing.
Drop the URL helpers' guards that cannot fireBryce Kwon-18/+2
Every caller hands the helpers a string, and a value with a line break is refused by validate_value whether or not CR LF is folded on the way.
Keep only the request fields the auth filters readBryce Kwon-42/+10
Seven of the twelve fields filter_open stored were never read. Naming all twelve parameters keeps the order cgit passes them in on record.
Take a signed cookie apart with one matchBryce Kwon-82/+11
The loop let a valid cookie through with a field appended, a doubled separator or a zero in front of its expiry. The payload now carries the expiry as written, so only the spelling secure_value issues verifies.
Drop a highlighter check that tested the harnessBryce Kwon-6/+0
The filter hands a NUL through untouched, and only the harness's copy of cgit's sink cut the text there, so the check would have failed the day the filter replaced NULs the way about-render does.
Drop the highlighter's extension fallbackBryce Kwon-61/+13
The table of extensions and the second lookup served only a Scintillua with no detect(), which now leaves every file uncoloured but escaped. The fake detect() names a lexer after the file's suffix, so every test lexer is reached through it.
Call string.match like the rest of the highlighterBryce Kwon-1/+1
Drop a stray blank line from the about-render testsBryce Kwon-1/+0
Carry a man page's text as plain stringsBryce Kwon-23/+16
lpeg's constant, query and numbered captures already do what the token helpers did, and nothing ever read the tokens of an escape that draws nothing.
Take a no fill line's plain text from its nodesBryce Kwon-7/+1
Wrap a man page's font runs with the macros' helperBryce Kwon-27/+11
Reuse the digit pattern where it is spelt outBryce Kwon-2/+2
Build the block start test from the line grammarsBryce Kwon-2/+1
Count a rule among the blocks that end a paragraphBryce Kwon-7/+4
Inline the list check before indented codeBryce Kwon-6/+2
Read a setext heading's level off its captureBryce Kwon-10/+4
Build every code block in one placeBryce Kwon-17/+11
Replace a readme's NUL bytes in one substitutionBryce Kwon-19/+3
Let the dispatch serve markdown without lpegBryce Kwon-5/+0
Without lpeg both renderers stay nil, and the handler lookup already falls back to plain text for a format it has no renderer for.
Render markdown and man pages through one functionBryce Kwon-28/+18
Everything that can raise already runs inside the parse and emit pcalls, so the outer one in filter_close could only ever have sent the page a second time. The size check moves to the dispatch with it.