summaryrefslogtreecommitdiff
path: root/diff.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 /diff.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 'diff.c')
-rw-r--r--diff.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/diff.c b/diff.c
index 0822ae4433..7f570ebdf9 100644
--- a/diff.c
+++ b/diff.c
@@ -6392,7 +6392,7 @@ static void diff_summary(struct diff_options *opt, struct diff_filepair *p)
}
struct patch_id_t {
- git_hash_ctx *ctx;
+ struct git_hash_ctx *ctx;
int patchlen;
};
@@ -6409,7 +6409,7 @@ static int remove_space(char *line, int len)
return dst - line;
}
-void flush_one_hunk(struct object_id *result, git_hash_ctx *ctx)
+void flush_one_hunk(struct object_id *result, struct git_hash_ctx *ctx)
{
unsigned char hash[GIT_MAX_RAWSZ];
unsigned short carry = 0;
@@ -6439,12 +6439,12 @@ static int patch_id_consume(void *priv, char *line, unsigned long len)
return 0;
}
-static void patch_id_add_string(git_hash_ctx *ctx, const char *str)
+static void patch_id_add_string(struct git_hash_ctx *ctx, const char *str)
{
the_hash_algo->update_fn(ctx, str, strlen(str));
}
-static void patch_id_add_mode(git_hash_ctx *ctx, unsigned mode)
+static void patch_id_add_mode(struct git_hash_ctx *ctx, unsigned mode)
{
/* large enough for 2^32 in octal */
char buf[12];
@@ -6457,7 +6457,7 @@ static int diff_get_patch_id(struct diff_options *options, struct object_id *oid
{
struct diff_queue_struct *q = &diff_queued_diff;
int i;
- git_hash_ctx ctx;
+ struct git_hash_ctx ctx;
struct patch_id_t data;
the_hash_algo->init_fn(&ctx);