diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-07-02 09:59:00 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-07-02 09:59:00 -0700 |
| commit | 7b472da91541d672ee220896a3a7fd4508c378f3 (patch) | |
| tree | 2687a29530b4a8b50c7f99a394cc5b69f06d7adb /builtin/update-ref.c | |
| parent | ae447ed130ca5d78da68b9aa7943adc53bed3dad (diff) | |
| parent | dc89b7d5220d94a3d6555e4df6b7c458a82dc771 (diff) | |
| download | git-7b472da91541d672ee220896a3a7fd4508c378f3.tar.gz | |
Merge branch 'ps/use-the-repository'
A CPP macro USE_THE_REPOSITORY_VARIABLE is introduced to help
transition the codebase to rely less on the availability of the
singleton the_repository instance.
* ps/use-the-repository:
hex: guard declarations with `USE_THE_REPOSITORY_VARIABLE`
t/helper: remove dependency on `the_repository` in "proc-receive"
t/helper: fix segfault in "oid-array" command without repository
t/helper: use correct object hash in partial-clone helper
compat/fsmonitor: fix socket path in networked SHA256 repos
replace-object: use hash algorithm from passed-in repository
protocol-caps: use hash algorithm from passed-in repository
oidset: pass hash algorithm when parsing file
http-fetch: don't crash when parsing packfile without a repo
hash-ll: merge with "hash.h"
refs: avoid include cycle with "repository.h"
global: introduce `USE_THE_REPOSITORY_VARIABLE` macro
hash: require hash algorithm in `empty_tree_oid_hex()`
hash: require hash algorithm in `is_empty_{blob,tree}_oid()`
hash: make `is_null_oid()` independent of `the_repository`
hash: convert `oidcmp()` and `oideq()` to compare whole hash
global: ensure that object IDs are always padded
hash: require hash algorithm in `oidread()` and `oidclr()`
hash: require hash algorithm in `hasheq()`, `hashcmp()` and `hashclr()`
hash: drop (mostly) unused `is_empty_{blob,tree}_sha1()` functions
Diffstat (limited to 'builtin/update-ref.c')
| -rw-r--r-- | builtin/update-ref.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/update-ref.c b/builtin/update-ref.c index 471fa5c8d1..6a6a2ff55d 100644 --- a/builtin/update-ref.c +++ b/builtin/update-ref.c @@ -181,7 +181,7 @@ static int parse_next_oid(const char **next, const char *end, goto invalid; } else { /* Without -z, an empty value means all zeros: */ - oidclr(oid); + oidclr(oid, the_repository->hash_algo); } } else { /* With -z, read the next NUL-terminated line */ @@ -201,7 +201,7 @@ static int parse_next_oid(const char **next, const char *end, /* With -z, treat an empty value as all zeros: */ warning("%s %s: missing <new-oid>, treating as zero", command, refname); - oidclr(oid); + oidclr(oid, the_repository->hash_algo); } else { /* * With -z, an empty non-required value means @@ -464,7 +464,7 @@ static void parse_cmd_verify(struct ref_transaction *transaction, if (parse_next_oid(&next, end, &old_oid, "verify", refname, PARSE_SHA1_OLD)) - oidclr(&old_oid); + oidclr(&old_oid, the_repository->hash_algo); if (*next != line_termination) die("verify %s: extra input: %s", refname, next); @@ -777,7 +777,7 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix) * The empty string implies that the reference * must not already exist: */ - oidclr(&oldoid); + oidclr(&oldoid, the_repository->hash_algo); else if (repo_get_oid(the_repository, oldval, &oldoid)) die("%s: not a valid old SHA1", oldval); } |
