diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-06-14 08:49:54 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-06-14 10:26:32 -0700 |
| commit | 9da95bda74cf10e1475384a71fd20914c3b99784 (patch) | |
| tree | fb145c3883d83c86ecf5bf7fa188937afe77b1e0 /builtin/pull.c | |
| parent | f4836570a7adbd8c70ad7a8edf6ae5a977647c06 (diff) | |
| download | git-9da95bda74cf10e1475384a71fd20914c3b99784.tar.gz | |
hash: require hash algorithm in `oidread()` and `oidclr()`
Both `oidread()` and `oidclr()` use `the_repository` to derive the hash
function that shall be used. Require callers to pass in the hash
algorithm to get rid of this implicit dependency.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pull.c')
| -rw-r--r-- | builtin/pull.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/pull.c b/builtin/pull.c index d622202bce..2a73e673f3 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -1038,7 +1038,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix) die_conclude_merge(); if (repo_get_oid(the_repository, "HEAD", &orig_head)) - oidclr(&orig_head); + oidclr(&orig_head, the_repository->hash_algo); if (opt_rebase) { if (opt_autostash == -1) @@ -1053,7 +1053,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix) _("Please commit or stash them."), 1, 0); if (get_rebase_fork_point(&rebase_fork_point, repo, *refspecs)) - oidclr(&rebase_fork_point); + oidclr(&rebase_fork_point, the_repository->hash_algo); } if (run_fetch(repo, refspecs)) @@ -1063,7 +1063,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix) return 0; if (repo_get_oid(the_repository, "HEAD", &curr_head)) - oidclr(&curr_head); + oidclr(&curr_head, the_repository->hash_algo); if (!is_null_oid(&orig_head) && !is_null_oid(&curr_head) && !oideq(&orig_head, &curr_head)) { |
