summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-01-31 13:55:29 +0100
committerJunio C Hamano <gitster@pobox.com>2025-01-31 10:06:10 -0800
commit7346e340f147131ca32089f61f7d0f502f80d19d (patch)
treec85e7270af3faa45fcc34afddac0e85a65731820 /read-cache.c
parent52eef501e17078b369da571d7e6b72c7494bb779 (diff)
hash: stop typedeffing the hash context
We generally avoid using `typedef` in the Git codebase. One exception though is the `git_hash_ctx`, likely because it used to be a union rather than a struct until the preceding commit refactored it. But now that it is a normal `struct` there isn't really a need for a typedef anymore. Drop the typedef and adapt all callers accordingly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/read-cache.c b/read-cache.c
index d54be2c172..5e765d9af5 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1717,7 +1717,7 @@ int verify_ce_order;
static int verify_hdr(const struct cache_header *hdr, unsigned long size)
{
- git_hash_ctx c;
+ struct git_hash_ctx c;
unsigned char hash[GIT_MAX_RAWSZ];
int hdr_version;
unsigned char *start, *end;
@@ -2002,7 +2002,7 @@ static struct index_entry_offset_table *read_ieot_extension(const char *mmap, si
static void write_ieot_extension(struct strbuf *sb, struct index_entry_offset_table *ieot);
static size_t read_eoie_extension(const char *mmap, size_t mmap_size);
-static void write_eoie_extension(struct strbuf *sb, git_hash_ctx *eoie_context, size_t offset);
+static void write_eoie_extension(struct strbuf *sb, struct git_hash_ctx *eoie_context, size_t offset);
struct load_index_extensions
{
@@ -2566,7 +2566,7 @@ int repo_index_has_changes(struct repository *repo,
}
static int write_index_ext_header(struct hashfile *f,
- git_hash_ctx *eoie_f,
+ struct git_hash_ctx *eoie_f,
unsigned int ext,
unsigned int sz)
{
@@ -2831,7 +2831,7 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
{
uint64_t start = getnanotime();
struct hashfile *f;
- git_hash_ctx *eoie_c = NULL;
+ struct git_hash_ctx *eoie_c = NULL;
struct cache_header hdr;
int i, err = 0, removed, extended, hdr_version;
struct cache_entry **cache = istate->cache;
@@ -3579,7 +3579,7 @@ static size_t read_eoie_extension(const char *mmap, size_t mmap_size)
uint32_t extsize;
size_t offset, src_offset;
unsigned char hash[GIT_MAX_RAWSZ];
- git_hash_ctx c;
+ struct git_hash_ctx c;
/* ensure we have an index big enough to contain an EOIE extension */
if (mmap_size < sizeof(struct cache_header) + EOIE_SIZE_WITH_HEADER + the_hash_algo->rawsz)
@@ -3650,7 +3650,7 @@ static size_t read_eoie_extension(const char *mmap, size_t mmap_size)
return offset;
}
-static void write_eoie_extension(struct strbuf *sb, git_hash_ctx *eoie_context, size_t offset)
+static void write_eoie_extension(struct strbuf *sb, struct git_hash_ctx *eoie_context, size_t offset)
{
uint32_t buffer;
unsigned char hash[GIT_MAX_RAWSZ];