aboutsummaryrefslogtreecommitdiffstats
path: root/builtin
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 /builtin
parent52eef501e17078b369da571d7e6b72c7494bb779 (diff)
downloadgit-7346e340f147131ca32089f61f7d0f502f80d19d.tar.gz
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 'builtin')
-rw-r--r--builtin/fast-import.c4
-rw-r--r--builtin/index-pack.c6
-rw-r--r--builtin/patch-id.c2
-rw-r--r--builtin/receive-pack.c2
-rw-r--r--builtin/unpack-objects.c4
5 files changed, 9 insertions, 9 deletions
diff --git a/builtin/fast-import.c b/builtin/fast-import.c
index ccdada1810..9862704c62 100644
--- a/builtin/fast-import.c
+++ b/builtin/fast-import.c
@@ -953,7 +953,7 @@ static int store_object(
unsigned char hdr[96];
struct object_id oid;
unsigned long hdrlen, deltalen;
- git_hash_ctx c;
+ struct git_hash_ctx c;
git_zstream s;
hdrlen = format_object_header((char *)hdr, sizeof(hdr), type,
@@ -1095,7 +1095,7 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)
struct object_id oid;
unsigned long hdrlen;
off_t offset;
- git_hash_ctx c;
+ struct git_hash_ctx c;
git_zstream s;
struct hashfile_checkpoint checkpoint;
int status = Z_OK;
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 6ffbb7ce35..40e49868b1 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -151,7 +151,7 @@ static unsigned int input_offset, input_len;
static off_t consumed_bytes;
static off_t max_input_size;
static unsigned deepest_delta;
-static git_hash_ctx input_ctx;
+static struct git_hash_ctx input_ctx;
static uint32_t input_crc32;
static int input_fd, output_fd;
static const char *curr_pack;
@@ -475,7 +475,7 @@ static void *unpack_entry_data(off_t offset, unsigned long size,
int status;
git_zstream stream;
void *buf;
- git_hash_ctx c;
+ struct git_hash_ctx c;
char hdr[32];
int hdrlen;
@@ -1248,7 +1248,7 @@ static void parse_pack_objects(unsigned char *hash)
struct ofs_delta_entry *ofs_delta = ofs_deltas;
struct object_id ref_delta_oid;
struct stat st;
- git_hash_ctx tmp_ctx;
+ struct git_hash_ctx tmp_ctx;
if (verbose)
progress = start_progress(
diff --git a/builtin/patch-id.c b/builtin/patch-id.c
index f540d8daa7..923ff2bb77 100644
--- a/builtin/patch-id.c
+++ b/builtin/patch-id.c
@@ -70,7 +70,7 @@ static size_t get_one_patchid(struct object_id *next_oid, struct object_id *resu
int before = -1, after = -1;
int diff_is_binary = 0;
char pre_oid_str[GIT_MAX_HEXSZ + 1], post_oid_str[GIT_MAX_HEXSZ + 1];
- git_hash_ctx ctx;
+ struct git_hash_ctx ctx;
the_hash_algo->init_fn(&ctx);
oidclr(result, the_repository->hash_algo);
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 0fb0266cfd..d2360c453c 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -566,7 +566,7 @@ static void hmac_hash(unsigned char *out,
unsigned char k_ipad[GIT_MAX_BLKSZ];
unsigned char k_opad[GIT_MAX_BLKSZ];
int i;
- git_hash_ctx ctx;
+ struct git_hash_ctx ctx;
/* RFC 2104 2. (1) */
memset(key, '\0', GIT_MAX_BLKSZ);
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index f6b9825fb0..d72885510c 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -28,7 +28,7 @@ static unsigned char buffer[4096];
static unsigned int offset, len;
static off_t consumed_bytes;
static off_t max_input_size;
-static git_hash_ctx ctx;
+static struct git_hash_ctx ctx;
static struct fsck_options fsck_options = FSCK_OPTIONS_STRICT;
static struct progress *progress;
@@ -614,7 +614,7 @@ int cmd_unpack_objects(int argc,
{
int i;
struct object_id oid;
- git_hash_ctx tmp_ctx;
+ struct git_hash_ctx tmp_ctx;
disable_replace_refs();