"brian m. carlson" <sandals@xxxxxxxxxxxxxxxxxxxx> writes: > Can we maybe say something like this? > > switch (hash_algo_by_ptr(the_hash_algo)) { > case GIT_HASH_SHA1: > return 1; > case GIT_HASH_SHA256: > return 2; > default: > die(_("invalid hash version")); > } > > That way if SHA-256 gets broken and we switch to another 256-bit hash > (SHA-3-256?), we'll be forced to update this properly. Excellent.