AgeCommit message (Collapse)AuthorLines
Show a renamed file's diff as the renameBryce Kwon-2/+22
A diff limited to the new name cannot see the old one, so the diffstat's link for a renamed file, the commit page reached from that file's log, and the file's rawdiff and patch all showed every line as added. A path the old tree lacks is now diffed across the whole commit with rename detection aimed at it alone, the way git blame looks for a rename, so it is compared with the commit's deleted files and nothing else. Doing it in cgit_diff_tree keeps the log's counts for that commit in step with the page they link to. The rawdiff and patch pages leave the diff to git's own output, so for them that search finds the old name, and both names go into the limit with rename detection on.
Read the description file without repo.descBryce Kwon-0/+8
Only a scanned repository fell back to its description file, so one listed in cgitrc without repo.desc showed "[no description]" however its file read. repo.desc may follow repo.path, so the file is read where a page shows the description, which also spares every other request the reads.
Order shared.c the way shared.h declares itBryce Kwon-14/+13
The header's blob and pathspec checks move after the diff wrappers so each group reads as one, and each static helper now sits directly above its only user.
Free commit and tag records beside their parsersBryce Kwon-3/+0
With the frees gone from shared.h, five page files need nothing else from it, so they stop including it.
Keep the cache's trailing slash helper in cache.cBryce Kwon-1/+0
Move cgit.c's own helpers out of shared.cBryce Kwon-12/+0
Move the mimetype lookup into ui-plain.cBryce Kwon-2/+0
Move the ref list code into ui-refs.cBryce Kwon-8/+0
Move the die wrappers into filter.cBryce Kwon-8/+0
Build a literal pathspec in one placeBryce Kwon-0/+6
Git's pathspec item holds a const string now, so a path needs no writable copy to be matched.
Drop cgit_read_first_line's unread size outputBryce Kwon-1/+1
Sort with git's QSORTBryce Kwon-12/+0
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.
Sort an empty list without handing qsort a nullBryce Kwon-0/+12
Every list sorted here is null until its first entry, and C leaves a null base undefined even with nothing to sort. glibc declares it nonnull, and a UBSan build aborted the stats page of a repository with no commits in the window.
Pass over a notes ref that names no treeBryce Kwon-0/+7
A pusher can point refs/notes/commits or a signature notes ref at any object, and git dies loading one that is no tree, which ended every page of the repository, the dumb transport included.
Hold object sizes in size_t as git 2.55 doesBryce Kwon-2/+2
Git 2.55 moved object sizes from unsigned long to size_t. The two are the same type on 64-bit hosts, but not on a 32-bit one, where GCC 14 rejects the mismatched pointers, so cgit stopped compiling there.
Share the max-blob-size check and its refusalBryce Kwon-0/+7
Five copies of the test and four of the error page had to agree by hand. The new check pins the four refusals, which no test covered.
Pass callbacks to git by addressBryce Kwon-0/+5
ISO C has no conversion between a function pointer and void *, so the callbacks handed through git's data pointers and the write found by dlsym stopped the pedantic half of a DEVELOPER=1 build.
Keep string literals behind const pointersBryce Kwon-1/+1
Git's DEVELOPER=1 build turns on -Wwrite-strings as an error, and the literals stored through plain char pointers failed cgit's own objects there. The exec filter's argv takes the cast execvp needs once, the way git's run-command does.
Gate a readme ending in a colon like a disk pathBryce Kwon-0/+6
trust-scan-config passed any readme holding a colon as a tracked file, while the parser takes one only when a path follows the colon, so a scanned repository could still name a file on disk outside itself.
Replace the stray bytes of text that is not UTF-8Bryce Kwon-0/+12
A commit whose encoding header names something iconv cannot convert, or whose text is labelled UTF-8 without being it, reached a page declared UTF-8 with its bytes untouched. The atom feed already replaced them, so its UTF-8 reader moves to shared.c and every ident, subject, message and tag text passes through it.
Limit rawdiff to the requested pathBryce Kwon-0/+5
The diff and patch pages honour the path in the url, which the parameter table documents for every page, but rawdiff never handed it to git and answered with the whole diff.
Harden the request path, scan and error recoveryBryce Kwon-6/+20
Clean up the whole treeBryce Kwon-13/+8
Restyle the sources and fix the audit's findingsBryce Kwon-0/+92