mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Merge branch 'bc/use-sha256-by-default-in-3.0'
Prepare to flip the default hash function to SHA-256. * bc/use-sha256-by-default-in-3.0: Enable SHA-256 by default in breaking changes mode help: add a build option for default hash t5300: choose the built-in hash outside of a repo t4042: choose the built-in hash outside of a repo t1007: choose the built-in hash outside of a repo t: default to compile-time default hash if not set setup: use the default algorithm to initialize repo format Use legacy hash for legacy formats builtin: use default hash when outside a repository hash: add a constant for the legacy hash algorithm hash: add a constant for the default hash algorithm
This commit is contained in:
10
hash.h
10
hash.h
@@ -175,6 +175,16 @@ static inline void git_SHA256_Clone(git_SHA256_CTX *dst, const git_SHA256_CTX *s
|
||||
/* Number of algorithms supported (including unknown). */
|
||||
#define GIT_HASH_NALGOS (GIT_HASH_SHA256 + 1)
|
||||
|
||||
/* Default hash algorithm if unspecified. */
|
||||
#ifdef WITH_BREAKING_CHANGES
|
||||
# define GIT_HASH_DEFAULT GIT_HASH_SHA256
|
||||
#else
|
||||
# define GIT_HASH_DEFAULT GIT_HASH_SHA1
|
||||
#endif
|
||||
|
||||
/* Legacy hash algorithm. Implied for older data formats which don't specify. */
|
||||
#define GIT_HASH_SHA1_LEGACY GIT_HASH_SHA1
|
||||
|
||||
/* "sha1", big-endian */
|
||||
#define GIT_SHA1_FORMAT_ID 0x73686131
|
||||
|
||||
|
||||
Reference in New Issue
Block a user