Commit Briefs

Stefan Sperling

refresh cached list of pack index paths while searching a packed object

Previously, this list was only refreshed while trying to match an object ID prefix. Regular pack file access needs to refresh this list, too. In particular, future gotd(8) needs this to ensure that newly uploaded packfiles are picked up as expected.





Stefan Sperling

move pack indexing code into new file lib/pack_index.c

Prepares for sharing code between got-index-pack and future gotd(8).


Stefan Sperling

allow got_object_parse_tree to reuse entries buffer allocations for speed

ok millert@


Stefan Sperling

let callers of got_pack_create() configure rate-limiting of progress reporting

Needed by future gotd(8), where progress reports will be sent to a network socket, rather than a local terminal.



Stefan Sperling

move privsep code from pack_create.c into new file pack_create_privsep.c

Needed by future gotd(8). ok op@



Stefan Sperling

introduce got_path_move_file(); based on code from lib/patch.c

ok op@



Stefan Sperling

check for unlink(2) errors in got_opentempfd()

ok op@


Stefan Sperling

check for unlink(2) errors with the == -1 idiom, rather than != 0

ok op@


Stefan Sperling

move got_opentempfd() call out of got_pack_create()

Future gotd(8) needs to run got_pack_create() in a chroot environment, so we can no longer open new temporary files inside got_pack_create(). ok op@


Stefan Sperling

make got_pack_create() write to a file descriptor instead of a stdio FILE

The old code required a seekable output file. This conflicts with requirements of future gotd(8), which will write pack file data to network sockets. ok op@


Stefan Sperling

simplify the way 'got patch' opens a tempfile when reading from stdin

Also add basic test coverage for reading patches from stdin, while here. ok op@


Stefan Sperling

remove accidentally committed debug assertion




Stefan Sperling

move declaration of got_privsep_child out of got_lib_privsep.h

This declaration is the only reason why got_lib_privsep.h must be included in order to use got_lib_repository.h. Moving this declaration will allow for cleaning up unnecessary includes of got_lib_privsep.h.


Stefan Sperling

move code for reading Git's config file into new file read_gitconfig_privsep.c

The end goal here is to remove the dependency of repository.c on privsep.c during compilation.



Stefan Sperling

move functions which open objects into new file object_open_privsep.c

For the future, this will make it possible to provide alternative implementations of functions now stored in object_open_privsep.c. This will probably be needed by future gotd(8) which runs inside a chroot(2) environment and without the "exec" pledge(2) promise, making it impossible to run libexec helpers on the fly. Details of this design are not yet settled, but moving functions into a separate compilation unit won't hurt in any case.