]> git.ipfire.org Git - thirdparty/git.git/commit - sha1-file.c
fill_sha1_file: write "boring" characters
authorJeff King <peff@peff.net>
Mon, 3 Oct 2016 20:35:55 +0000 (16:35 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Oct 2016 20:52:36 +0000 (13:52 -0700)
commitafbba2f09ab06424d8b38908f4d76a1503f49a25
tree345101f3da324d530ac0fe8ffc2cb9f0d164954e
parent597f9134ded20f882e2bf6bca8b0e1f03981b98d
fill_sha1_file: write "boring" characters

This function forms a sha1 as "xx/yyyy...", but skips over
the slot for the slash rather than writing it, leaving it to
the caller to do so. It also does not bother to put in a
trailing NUL, even though every caller would want it (we're
forming a path which by definition is not a directory, so
the only thing to do with it is feed it to a system call).

Let's make the lives of our callers easier by just writing
out the internal "/" and the NUL.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c