Skip to content

Commit a6b0070

Browse files
committed
Merge branch 'bc/use-sha256-by-default-in-3.0' into kl/test-installed-fix
2 parents 16bd9f2 + c79bb70 commit a6b0070

25 files changed

+62
-32
lines changed

builtin/apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int cmd_apply(int argc,
2929
* cf. https://lore.kernel.org/git/[email protected]/
3030
*/
3131
if (!the_hash_algo)
32-
repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
32+
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
3333

3434
argc = apply_parse_options(argc, argv,
3535
&state, &force_apply, &options,

builtin/diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ int cmd_diff(int argc,
483483
* configurable via a command line option.
484484
*/
485485
if (nongit)
486-
repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
486+
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
487487

488488
init_diff_ui_defaults();
489489
git_config(git_diff_ui_config, NULL);

builtin/hash-object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ int cmd_hash_object(int argc,
104104
prefix = setup_git_directory_gently(&nongit);
105105

106106
if (nongit && !the_hash_algo)
107-
repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
107+
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
108108

109109
if (vpath && prefix) {
110110
vpath_free = prefix_filename(prefix, vpath);

builtin/index-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2034,7 +2034,7 @@ int cmd_index_pack(int argc,
20342034
* choice but to guess the object hash.
20352035
*/
20362036
if (!the_repository->hash_algo)
2037-
repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
2037+
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
20382038

20392039
opts.flags &= ~(WRITE_REV | WRITE_REV_VERIFY);
20402040
if (rev_index) {

builtin/ls-remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ int cmd_ls_remote(int argc,
112112
* depending on what object hash the remote uses.
113113
*/
114114
if (!the_repository->hash_algo)
115-
repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
115+
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
116116

117117
packet_trace_identity("ls-remote");
118118

builtin/patch-id.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ int cmd_patch_id(int argc,
254254
* the code that computes patch IDs to always use SHA1.
255255
*/
256256
if (!the_hash_algo)
257-
repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
257+
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
258258

259259
generate_id_list(opts ? opts > 1 : config.stable,
260260
opts ? opts == 3 : config.verbatim);

builtin/receive-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2136,7 +2136,7 @@ static struct command *read_head_info(struct packet_reader *reader,
21362136
use_push_options = 1;
21372137
hash = parse_feature_value(feature_list, "object-format", &len, NULL);
21382138
if (!hash) {
2139-
hash = hash_algos[GIT_HASH_SHA1].name;
2139+
hash = hash_algos[GIT_HASH_SHA1_LEGACY].name;
21402140
len = strlen(hash);
21412141
}
21422142
if (xstrncmpz(the_hash_algo->name, hash, len))

builtin/shortlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ int cmd_shortlog(int argc,
418418
* git/nongit so that we do not have to do this.
419419
*/
420420
if (nongit && !the_hash_algo)
421-
repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
421+
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
422422

423423
git_config(git_default_config, NULL);
424424
shortlog_init(&log);

builtin/show-index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ int cmd_show_index(int argc,
4747
* the index file passed in and use that instead.
4848
*/
4949
if (!the_hash_algo)
50-
repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
50+
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
5151

5252
hashsz = the_hash_algo->rawsz;
5353

bundle.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ int read_bundle_header_fd(int fd, struct bundle_header *header,
9595
* by an "object-format=" capability, which is being handled in
9696
* `parse_capability()`.
9797
*/
98-
header->hash_algo = &hash_algos[GIT_HASH_SHA1];
98+
header->hash_algo = &hash_algos[GIT_HASH_SHA1_LEGACY];
9999

100100
/* The bundle header ends with an empty line */
101101
while (!strbuf_getwholeline_fd(&buf, fd, '\n') &&
@@ -507,7 +507,7 @@ int create_bundle(struct repository *r, const char *path,
507507
* SHA1.
508508
* 2. @filter is required because we parsed an object filter.
509509
*/
510-
if (the_hash_algo != &hash_algos[GIT_HASH_SHA1] || revs.filter.choice)
510+
if (the_hash_algo != &hash_algos[GIT_HASH_SHA1_LEGACY] || revs.filter.choice)
511511
min_version = 3;
512512

513513
if (argc > 1) {

0 commit comments

Comments
 (0)