summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-04-08 14:28:17 -0700
committerJunio C Hamano <gitster@pobox.com>2025-04-08 14:28:17 -0700
commit0dfca9888191bcea4fa00fb3c7abda787e06cf75 (patch)
treeb1aaec26bf06b5679e256e298ba389aaf0ca1b00 /diff.c
parent9d22ac51228304102deb62f30c3ecba6377e1237 (diff)
parent7d70b29c4f0b2fd3c6698956d9fb4026632d9c6e (diff)
Merge branch 'ps/object-wo-the-repository' into ps/object-file-cleanup
* ps/object-wo-the-repository: hash: stop depending on `the_repository` in `null_oid()` hash: fix "-Wsign-compare" warnings object-file: split out logic regarding hash algorithms delta-islands: stop depending on `the_repository` object-file-convert: stop depending on `the_repository` pack-bitmap-write: stop depending on `the_repository` pack-revindex: stop depending on `the_repository` pack-check: stop depending on `the_repository` environment: move access to "core.bigFileThreshold" into repo settings pack-write: stop depending on `the_repository` and `the_hash_algo` object: stop depending on `the_repository` csum-file: stop depending on `the_repository`
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/diff.c b/diff.c
index 08f5e00a2c..3bcf502883 100644
--- a/diff.c
+++ b/diff.c
@@ -4193,7 +4193,8 @@ int diff_populate_filespec(struct repository *r,
* is probably fine.
*/
if (check_binary &&
- s->size > big_file_threshold && s->is_binary == -1) {
+ s->size > repo_settings_get_big_file_threshold(the_repository) &&
+ s->is_binary == -1) {
s->is_binary = 1;
return 0;
}
@@ -4243,7 +4244,8 @@ object_read:
if (size_only || check_binary) {
if (size_only)
return 0;
- if (s->size > big_file_threshold && s->is_binary == -1) {
+ if (s->size > repo_settings_get_big_file_threshold(the_repository) &&
+ s->is_binary == -1) {
s->is_binary = 1;
return 0;
}
@@ -4344,7 +4346,7 @@ static struct diff_tempfile *prepare_temp_file(struct repository *r,
die_errno("readlink(%s)", one->path);
prep_temp_blob(r->index, one->path, temp, sb.buf, sb.len,
(one->oid_valid ?
- &one->oid : null_oid()),
+ &one->oid : null_oid(the_hash_algo)),
(one->oid_valid ?
one->mode : S_IFLNK));
strbuf_release(&sb);
@@ -4353,7 +4355,7 @@ static struct diff_tempfile *prepare_temp_file(struct repository *r,
/* we can borrow from the file in the work tree */
temp->name = one->path;
if (!one->oid_valid)
- oid_to_hex_r(temp->hex, null_oid());
+ oid_to_hex_r(temp->hex, null_oid(the_hash_algo));
else
oid_to_hex_r(temp->hex, &one->oid);
/* Even though we may sometimes borrow the
@@ -6647,8 +6649,8 @@ static void create_filepairs_for_header_only_notifications(struct diff_options *
one = alloc_filespec(e->key);
two = alloc_filespec(e->key);
- fill_filespec(one, null_oid(), 0, 0);
- fill_filespec(two, null_oid(), 0, 0);
+ fill_filespec(one, null_oid(the_hash_algo), 0, 0);
+ fill_filespec(two, null_oid(the_hash_algo), 0, 0);
p = diff_queue(q, one, two);
p->status = DIFF_STATUS_MODIFIED;
}