From: Junio C Hamano Date: Tue, 14 May 2024 00:16:21 GMT Subject: Re: [PATCH 2/2] builtin/hash-object: fix uninitialized hash function Message-ID: In-Reply-To: <1e010f798ce50e51100bd46564a69ddbd31d29ea.1715582857.git.ps@pks.im> Patrick Steinhardt writes: > diff --git a/builtin/hash-object.c b/builtin/hash-object.c > index 82ca6d2bfd..0855f4f8aa 100644 > --- a/builtin/hash-object.c > +++ b/builtin/hash-object.c > @@ -123,6 +123,13 @@ int cmd_hash_object(int argc, const char **argv, const char *prefix) > else > prefix = setup_git_directory_gently(&nongit); > > + /* > + * TODO: Allow the hash algorithm to be configured by the user via a > + * command line option when not using `-w`. > + */ > + if (nongit) > + repo_set_hash_algo(the_repository, GIT_HASH_SHA1); This breaks t1007 when linux-sha256) export GIT_TEST_DEFAULT_HASH=sha256 is in effect.