}
/* Case 2.4: If all the above failed, try a hash of the name as a last resort */
- header_len = snprintf(header, sizeof(header), "blob %zu", strlen(submodule_name));
+ header_len = snprintf(header, sizeof(header),
+ "blob %"PRIuMAX, (uintmax_t)strlen(submodule_name));
- the_hash_algo->init_fn(&ctx);
- the_hash_algo->update_fn(&ctx, header, header_len);
- the_hash_algo->update_fn(&ctx, "\0", 1);
- the_hash_algo->update_fn(&ctx, submodule_name, strlen(submodule_name));
- the_hash_algo->final_fn(raw_name_hash, &ctx);
+ git_hash_init(&ctx, the_hash_algo);
+ git_hash_update(&ctx, header, header_len);
+ git_hash_update(&ctx, "\0", 1);
+ git_hash_update(&ctx, submodule_name, strlen(submodule_name));
+ git_hash_final(raw_name_hash, &ctx);
hash_to_hex_algop_r(hex_name_hash, raw_name_hash, the_hash_algo);
strbuf_reset(&gitdir_path);
repo_git_path_append(the_repository, &gitdir_path, "modules/%s", hex_name_hash);