Commit Briefs


Omar Polo

rename sha1.c to hash.c



Omar Polo

sed -i s/sha1/hash

not exactly, some "hash" were changed back to "sha1" for the time being.




Omar Polo

change add_delta to take an off_t instead of size_t.

add_delta already calls got_delta_open casting the size_t to off_t, and all the add_delta callers pass an off_t anyway; fixes an implicit off_t truncation. ok stsp@



Omar Polo

check size before calling mmap(2)

It's only a preparatory step, as checking whether a size_t is less than SIZE_MAX is moot. In a follow-up commit, however, the `filesize' field of the struct got_pack will become off_t and these checks will kick in. This also makes consistent how we guard mmap(2) against empty files. ok and improvements stsp@



Christian Weisgerber

fix off_t type mismatch

off_t is a signed type and depending on the platform, it can be "long" or "long long", so cast to long long for printf().


Omar Polo

change got_pack_parse_offset_delta tslen argument to size_t

The tslen argument is always in the (1..9) range so `int' is technically fine (even int8_t would be!) but all the callers are passing a size_t, so change the type accordingly. ok stsp@


Stefan Sperling

close parent's end of imsg pipe before waiting for a child process to exit

Prevents a dead-lock in 'tog log' where tog wants to exit (e.g. because the user pressed Ctrl-C) while a got-read-pack child process wants to send more commits. Closing the parent's pipe descriptor makes writes to the pipe fail in the child process. The child then unwinds via an ERR_EOF error and exits, instead of forever polling its end of the pipe in order to write more data. ok jamsek