Re: [RFC PATCH 2/4] rename all *_sha1 variables and make null_oid hash aware
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Oct 11, 2021, 20:07 UTC
- Message-ID
- <CAPig+cSJentAiOGhqKpgZgXDW9NAK3OMHhKyn6auYN7b=Vk74w@mail.gmail.com>
- In-Reply-To
- <20211011121757.627-3-carenas@gmail.com>
On Mon, Oct 11, 2021 at 8:18 AM Carlo Marcelo Arenas Belón <carenas@gmail.com> wrote:
Show 12 quoted lines
> Before this change, creating a branch in an SHA-256 repository would
> fail because the null_sha1 used was of the wrong size.
>
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
> diff --git a/git-gui.sh b/git-gui.sh
> @@ -1820,10 +1820,14 @@ proc short_path {path} {
> +if { [get_config extensions.objectformat] eq "sha256" } {
> + set null_oid [string repeat 0 64]
> +} else {
> + set null_oid [string repeat 0 40]
> +}Should this be using:
git rev-parse --show-object-format
rather than reading the configuration directly?