summaryrefslogtreecommitdiff
path: root/csum-file.c
AgeCommit message (Collapse)AuthorFilesLines
2005-12-19xread/xwrite: do not worry about EINTR at calling sites.Libravatar Junio C Hamano1-3/+1
We had errno==EINTR check after read(2)/write(2) sprinkled all over the places, always doing continue. Consolidate them into xread()/xwrite() wrapper routines. Credits for suggestion goes to HPA -- bugs are mine. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-08[PATCH] Plug memory leak in sha1close()Libravatar Sergey Vlasov1-0/+1
sha1create() and sha1fd() malloc the returned struct sha1file; sha1close() should free it. Signed-off-by: Sergey Vlasov <vsu@altlinux.ru> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-06[PATCH] Let umask do its work upon filesystem object creation.Libravatar Junio C Hamano1-1/+1
IIRC our strategy was to let the users' umask take care of the final mode bits. This patch fixes places that deviate from it. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-28csum-file: add "sha1fd()" to create a SHA1 csum file from an existing file ↵Libravatar Linus Torvalds1-0/+20
descriptor We'll use this soon to write pack-files to stdout.
2005-06-27csum-file: fix missing buf pointer updateLibravatar Linus Torvalds1-0/+1
This would create broken pack archives for anything nontrivial.
2005-06-26csum-file interface updates: return resulting SHA1Libravatar Linus Torvalds1-10/+16
Also, make the writing of the SHA1 as a end-header be conditional: not every user will necessarily want to write the SHA1 to the file itself, even though current users do (but we migh end up using the same helper functions for the object files themselves, that don't do this). This also makes the packed index file contain the SHA1 of the packed data file at the end (just before its own SHA1). That way you can validate the pairing of the two if you want to.
2005-06-26git-pack-objects: write the pack files with a SHA1 csumLibravatar Linus Torvalds1-0/+120
We want to be able to check their integrity later, and putting the sha1-sum of the contents at the end is a good thing. The writing routines are generic, so we could try to re-use them for the index file, instead of having the same logic duplicated. Update unpack-objects to know about the extra 20 bytes at the end of the index.