Commit Briefs
gotwebd: avoid unnecessary strdup() (main)
It's fine to leave the owner set to NULL in case there is none. The template {{..}} construct accepts NULLs (rendering an empty string), and repo_dir->owner is only passed to that or to free().
gotwebd: refactor file load in its own routine
Split gotweb_load_file() out of gotweb_get_repo_description() and reuse it for gotweb_get_clone_url() too. Will be useful in the future for other tasks too.
run more tests in sha256 mode
Since we've been quickly expanded the support for sha256, instead of making the regress "opt-in", make them "opt-out". Basically, only the regress that are reaching the network protocol code needs to be disabled as of now in sha256 mode (until we add support for git protocol v2).
gotadmin: add flag to `init' to choose the hashing algorithm
Do the same for `got init' too obviously. Repositories created via `clone' are implicitly sha1 since we don't speak the v2 protocol (yet). ok stsp@
gotadmin: show hashing algorithm in `info' output
part of a larger diff that's ok stsp@
load: support bundle v3
The counterpart of generating v3 bundles is to load them.
generate bundles v3 when in sha256 repos
bundles v2 don't have a way to specify the object-format and so they can't work in sha256 mode; v3 adds a some "capabilities" so that it's possible to specify the object-format (and also other things that we aren't interested in actually.)
support to create/index sha256 packfiles
in a few cases, an array of SHA1_DIGEST_LENGTH has been converted to a struct got_object_id to simplify the handling.
fileindex: improve unexpected object-format error message
suggested by stsp
regress: run gotadmin pack/cleanup -r instead of cd'ing
This way core files will be left in the current directory instead that in the test one that is going to be immediately removed.
set the `algo' field in a few forgotten cases
These were a bit hard to find. We set the id to 0xff[...] so they sort later, but the algo also needs to be set correctly.
fix the patch code for sha256
extra (dumbiness) point for me to having chosen to use "41" instead of SHA1_DIGEST_STRING_LENGTH originally!
use memmove in got_fileinedx_entry_update
Some callers, like worktree.c:/^sync_timestamps, are passing the commit sha1 itself as an argument, so we shouldn't use memcpy but rather memmove.