aboutsummaryrefslogtreecommitdiffstats
path: root/ui-blob.c
Commit message (Collapse)AuthorAgeLines
* Switch to exclusively using global ctxGravatar Lukas Fleischer2014-01-17-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop the context parameter from the following functions (and all static helpers used by them) and use the global context instead: * cgit_print_http_headers() * cgit_print_docstart() * cgit_print_pageheader() Remove context parameter from all commands Drop the context parameter from the following functions (and all static helpers used by them) and use the global context instead: * cgit_get_cmd() * All cgit command functions. * cgit_clone_info() * cgit_clone_objects() * cgit_clone_head() * cgit_print_plain() * cgit_show_stats() In initialization routines, use the global context variable instead of passing a pointer around locally. Remove callback data parameter for cache slots This is no longer needed since the context is always read from the global context variable. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
* Update copyright informationGravatar Lukas Fleischer2014-01-08-2/+1
| | | | | | | | | * Name "cgit Development Team" as copyright holder to avoid listing every single developer. * Update copyright ranges. Signed-off-by: Lukas Fleischer <cgit@crytocrack.de>
* readme: use string_list instead of space deliminationsGravatar Jason A. Donenfeld2013-05-26-27/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | Now this is possible in cgitrc - readme=:README.md readme=:readme.md readme=:README.mkd readme=:readme.mkd readme=:README.rst readme=:readme.rst readme=:README.html readme=:readme.html readme=:README.htm readme=:readme.htm readme=:README.txt readme=:readme.txt readme=:README readme=:readme readme=:INSTALL.txt readme=:install.txt readme=:INSTALL readme=:install Suggested-by: John Keeping <john@keeping.me.uk> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* readme: Accept multiple candidates and test them.Gravatar Jason A. Donenfeld2013-05-26-1/+27
| | | | | | | | | | | The readme variable may now contain multiple space deliminated entries, which per usual are either a filepath or a git ref filepath. If multiple are specified, cgit will now select the first one in the list that exists. This is to make it easier to specify multiple default readme types in the main cgitrc file and have them automatically get applied to each repo based on what exists. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Convert cgit_print_error to a variadic functionGravatar John Keeping2013-04-08-4/+4
| | | | | | | | | This removes many uses of "fmt" which uses a fixed size static pool of fixed size buffers. Instead of relying on these, we now pass around argument lists for as long as possible before using a strbuf to render content of an arbitrary size. Signed-off-by: John Keeping <john@keeping.me.uk>
* Always #include corresponding .h in .c filesGravatar John Keeping2013-04-08-0/+1
| | | | | | | | | | | | While doing this, remove declarations from header files where the corresponding definition is declared "static" in order to avoid build errors. Also re-order existing headers in ui-*.c so that the file-specific header always comes immediately after "cgit.h", helping with future consistency. Signed-off-by: John Keeping <john@keeping.me.uk>
* ui-blob: don't segfault when no path is givenGravatar John Keeping2013-04-07-1/+1
| | | | | | | | | | | | It it possible to inspect blobs by specifying only the SHA-1, and CGit provides links to do so, for example if a tag points directly at a blob. In this case the path_items structure is never used, but creating it still causes strlen to be run on a null pointer. Fix this. This error was introduced by commit c1633c6 (Update git to v1.7.6.5 - 2013-03-02). Signed-off-by: John Keeping <john@keeping.me.uk>
* ui-blob.c: Use a context structure in walk_tree()Gravatar Lukas Fleischer2013-03-04-16/+26
| | | | | | | | | | | | Do not misuse global variables to save the context. Instead, use the context pointer which was designed to share information between a read_tree_fn and the caller. This also prevents from potential misuse of the global pointers match_path and matched_sha1 after the referenced values have been overwritten on the stack. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
* White space around control verbs.Gravatar Jason A. Donenfeld2013-03-04-4/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Fix several whitespace errorsGravatar Lukas Fleischer2013-03-04-5/+5
| | | | | | | | | | * Remove whitespace at the end of lines. * Replace space indentation by tabs. * Add whitespace before/after several operators ("+", "-", "*", ...) * Add whitespace to assignments ("foo = bar;"). * Fix whitespace in parameter lists ("foobar(foo, bar, 42)"). Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
* Update git to v1.7.6.5Gravatar John Keeping2013-03-03-4/+18
| | | | | | struct pathspec is now used in more places. Signed-off-by: John Keeping <john@keeping.me.uk>
* prefer html_raw() to write()Gravatar Mark Lodato2010-09-05-2/+2
| | | | | | | To make the code more consistent, and to not rely on the implementation of html(), always use html_raw(...) instead of write(htmlfd, ...). Signed-off-by: Mark Lodato <lodatom@gmail.com>
* Support refspecs in about-filter.Gravatar Jason A. Donenfeld2010-08-21-1/+34
| | | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Fix segfault on ppc when browsing treeGravatar Martins Polakovs2009-12-12-1/+1
|
* ui-blob: return 'application/octet-stream' for binary blobsGravatar Lars Hjemli2009-07-25-1/+7
| | | | Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Adjust to new calling convention for read_tree_recursive()Gravatar Lars Hjemli2008-07-21-2/+3
| | | | | | | | In GIT-1.6.0, read_tree_recursive takes an extra void pointer for callback data. We might want to use this to avoid some global variables, but for now lets just make sure that we can still compile. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* allow specification of directly linked blobs mimetypesGravatar Michael Krelin2008-06-25-1/+1
| | | | Signed-off-by: Michael Krelin <hacker@klever.net>
* allow blob extract blobs by head/path combinationGravatar Michael Krelin2008-06-25-4/+33
| | | | | | | If blob is invoked with no id=, it tries to look up h= and search for path= in there. Once found, proceed as normal, otherwise, fail as normal. Signed-off-by: Michael Krelin <hacker@klever.net>
* Don't specify mimetype in ui-blob.cGravatar Lars Hjemli2008-04-09-1/+1
| | | | | | | | But be sure to specify correct filename. This way, the client can hopefully guess a sensible mimetype based on the filename suffix, and cgit can ignore the issue altogether. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Add ui-shared.hGravatar Lars Hjemli2008-03-25-0/+1
| | | | | | | This is finally a proper headerfile for the shared ui-functions which used to reside in cgit.h Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Remove obsolete cacheitem parameter to ui-functionsGravatar Lars Hjemli2008-03-24-1/+1
| | | | | | This parameter hasn't been used for a very long time... Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Add struct cgit_page to cgit_contextGravatar Lars Hjemli2008-03-24-1/+3
| | | | | | | | This struct is used when generating http headers, and as such is another small step towards the goal of the whole cleanup series; to invoke each page/view function with a function pointer. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Introduce html.hGravatar Lars Hjemli2008-03-18-0/+9
| | | | | | | | All html-functions can be quite easily separated from the rest of cgit, so lets do it; the only issue was html_filemode which uses some git-defined macros so the function is moved into ui-shared.c::cgit_print_filemode(). Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Add support for downloading single blobsGravatar Lars Hjemli2007-05-09-0/+31
Signed-off-by: Lars Hjemli <hjemli@gmail.com>