From 00a7760e81e067cdfb6113e02d141d508529ffc7 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 7 Jan 2019 03:37:02 -0500 Subject: sha1-file: modernize loose header/stream functions As with the open/map/close functions for loose objects that were recently converted, the functions for parsing the loose object stream use the name "sha1" and a bare "unsigned char *". Let's fix that so that unpack_sha1_header() becomes unpack_loose_header(), etc. These conversions are less clear-cut than the file access functions. You could argue that the they are parsing Git's canonical object format (i.e., "type size\0contents", over which we compute the hash), which is not strictly tied to loose storage. But in practice these functions are used only for loose objects, and using the term "loose_header" (instead of "object_header") distinguishes it from the object header found in packfiles (which contains the same information in a different format). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- cache.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cache.h') diff --git a/cache.h b/cache.h index 587512747b..653c36d0b7 100644 --- a/cache.h +++ b/cache.h @@ -1269,8 +1269,8 @@ extern char *xdg_cache_home(const char *filename); extern int git_open_cloexec(const char *name, int flags); #define git_open(name) git_open_cloexec(name, O_RDONLY) -extern int unpack_sha1_header(git_zstream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz); -extern int parse_sha1_header(const char *hdr, unsigned long *sizep); +extern int unpack_loose_header(git_zstream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz); +extern int parse_loose_header(const char *hdr, unsigned long *sizep); extern int check_object_signature(const struct object_id *oid, void *buf, unsigned long size, const char *type); -- cgit v1.3