diff options
author | Xin Li <delphij@google.com> | 2020-06-05 02:10:01 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-06-05 10:13:30 -0700 |
commit | 16af5f1abb2b3291f96a248698449c48c6a0ec36 (patch) | |
tree | d8bae1f1b88f0b6b6717b19de757075c90b2b1b4 /repository.h | |
parent | 2d5e9f31ac46017895ce6a183467037d29ceb9d3 (diff) | |
download | git-16af5f1abb2b3291f96a248698449c48c6a0ec36.tar.gz |
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>
Diffstat (limited to 'repository.h')
-rw-r--r-- | repository.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/repository.h b/repository.h index 6534fbb7b3..3c1f7d54bd 100644 --- a/repository.h +++ b/repository.h @@ -196,4 +196,10 @@ void repo_update_index_if_able(struct repository *, struct lock_file *); void prepare_repo_settings(struct repository *r); +/* + * Return 1 if upgrade repository format to target_version succeeded, + * 0 if no upgrade is necessary, and -1 when upgrade is not possible. + */ +int upgrade_repository_format(int target_version); + #endif /* REPOSITORY_H */ |