Re: [PATCH v3 32/39] setup: add support for reading extensions.objectformat
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 23, 2020, 02:04 UTC
- Message-ID
- <xmqqblk73s1n.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200723010943.2329634-33-sandals@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 12 quoted lines
> @@ -613,6 +622,11 @@ int verify_repository_format(const struct repository_format *format,
> return -1;
> }
>
> + if (format->version <= 0 && format->hash_algo != GIT_HASH_SHA1) {
> + strbuf_addstr(err, _("extensions.objectFormat is not valid in repo v0"));
> + return -1;
> + }
> +
> return 0;
> }
> By declaring that the repository is invalid if its version is less than 1 and objectFormat extension defined, we prevent unwanted upgrading from happening by mistake.
OK.