Commits


fmt


plug some fd leaks in the fdopen{,dir} error paths There's also a memory leak fixed. ok stsp@


avoid opening objects in the gotd session process for no reason The session process opened an object as part of a sanity check and simply closed it again. Opening an object involves decompression and combination of deltas. Add a new interface which checks whether an object ID exists without such overhead and call it from gotd.


plug object id queue leak when iterating pack index files We need to free the matched object id queue on each pack index iteration--not only when the objects/pack dir modification time has changed--otherwise the ids are leaked when we reinitialise the queue in got_packidx_match_id_str_prefix(). tweaked by + ok op@


detect concurrent changes to the set of pack files while matching object IDs This should prevent a use-after-free crash I observed in gotwebd. ok op@


honor fetch_all_branches configuration again Fix a regression in db82695e31945b3ce001a5fb69674c3638622368 where the fetch_all_branches configuration setting from got.conf was dropped and always defaulted to "no". Add corresponding regression test. ok stsp


copy remote repo info out of work tree data before closing the work tree Fixes a crash regression introduced when fetch/send were made to close the work tree earlier.


ignore write errors to pack children while closing a repository If the child has exited for some reason then we won't be able to send a stop message on the pipe. Ignore such errors while we are tearing a repository data structure down. The error should be harmless but can trip up gotwebd when cycling repositories out of its repo cache: gotwebd[29683]: gotweb_render_index: got-portable.git: unexpected end of file


add got_repo_get_object_format() and use it to avoid hardcoding the digest type in a few places. ok stsp@


provide functions to parse/serialize different hashes it abstracts over the hash type and ensures that object ids are zero'ed before their sha1 digest is written. Needed by the incoming sha256 support. ok stsp@


rename lib/sha1.c to lib/hash.c It will soon grow functions to deal with sha256 too. stsp@ agrees.


include sha2.h too where sha1.h is included In preparation for wide sha256 support; stsp@ agrees. Change done mechanically with find . -iname \*.[cy] -exec sam {} + X ,x/<sha1\.h>/i/\n#include <sha2.h>


make 'got import' -I option match directory names with a trailing slash reported by Lucas on IRC, who sent a patch which this commit was based on ok jamsek


got-read-gitconfig: send key-value pairs for extensions Most extension allow only for a boolean value so the current behaviour of just sending the extension with a trueish value is fine. However, some extensions that we could eventually support (like "objectformat") have a string value. This is a preparatory step towards that. ok stsp@


replace got_repo_get_gitconfig_extensions with got_repo_has_extension got_repo_get_gitconfig_extensions is only used in gotadmin to check if the preciousObjects extension is active; let's replace it with a function that just checks whether a certain extension is active. It simplifies future changes to the extensions handling. ok stsp@