Message ID | 18a41f2fe6f2219f16f998699394005bd57ac463.1734715194.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | pack-objects: Create an alternative name hash algorithm (recreated) | expand |
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index b19c3665003..4d10baf7ac9 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -276,6 +276,14 @@ static void validate_name_hash_version(void) static inline uint32_t pack_name_hash_fn(const char *name) { + static int seen_version = -1; + + if (seen_version < 0) + seen_version = name_hash_version; + else if (seen_version != name_hash_version) + BUG("name hash version changed from %d to %d mid-process", + seen_version, name_hash_version); + switch (name_hash_version) { case 1: