repository: add a helper function to perform repository format upgrade

In version 1 of repository format, "extensions" gained special meaning
and it is safer to avoid upgrading when there are pre-existing
extensions.

Make list-objects-filter to use the helper function instead of setting
repository version directly as a prerequisite of exposing the upgrade
capability.

Signed-off-by: Xin Li <delphij@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Xin Li
2020-06-05 02:10:01 -07:00
committed by Junio C Hamano
parent 2d5e9f31ac
commit 16af5f1abb
4 changed files with 38 additions and 1 deletions

View File

@ -1042,6 +1042,7 @@ struct repository_format {
int worktree_config;
int is_bare;
int hash_algo;
int has_extensions;
char *work_tree;
struct string_list unknown_extensions;
};