Re: [PATCH v3] show-index: fix uninitialized hash function
- From
Abhijeet Sonar <abhijeet.nkt@gmail.com>
- Date
- Oct 29, 2024, 10:30 UTC
- Message-ID
- <00094bf3-61df-44ec-a469-a3b33399a306@gmail.com>
- In-Reply-To
- <Zx7WaEn6nvtjhs/B@nand.local>
On 28/10/24 05:40, Taylor Blau wrote:
Show 10 quoted lines
> On Sat, Oct 26, 2024 at 05:39:50PM +0530, Abhijeet Sonar wrote: >> As stated in the docs, show-index should use SHA1 as the default hash algorithm >> when run outsize of a repository. However, 'the_hash_algo' is currently left >> uninitialized if we are not in a repository and no explicit hash function is >> specified, causing a crash. Fix it by falling back to SHA1 when it is found >> uninitialized. Also add test that verifies this behaviour. > > This commit description is good, and would benefit further from a > bisection showing where the regression began. I don't think that it is a > prerequisite for us moving this patch forward, though.
On bisecting, the offending commit appears to be c8aed5e8da (repository: stop setting SHA1 as the default object hash).
Another related commit is ab274909d4 (builtin/diff: explicitly set hash algo when there is no repo) which did something very similar to my patch.
Thanks