From 14c7fa269e42df4133edd9ae7763b678ed6594cd Mon Sep 17 00:00:00 2001 From: Xin Li Date: Fri, 5 Jun 2020 02:10:04 -0700 Subject: check_repository_format_gently(): refuse extensions for old repositories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, extensions were recognized regardless of repository format version.  If the user sets an undefined "extensions" value on a repository of version 0 and that value is used by a future git version, they might get an undesired result. Because all extensions now also upgrade repository versions, tightening the check would help avoid this for future extensions. Signed-off-by: Xin Li Signed-off-by: Junio C Hamano --- t/t0410-partial-clone.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 't/t0410-partial-clone.sh') diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh index 16ad000382..463dc3a8be 100755 --- a/t/t0410-partial-clone.sh +++ b/t/t0410-partial-clone.sh @@ -42,6 +42,17 @@ test_expect_success 'convert shallow clone to partial clone' ' test_cmp_config -C client 1 core.repositoryformatversion ' +test_expect_success 'convert shallow clone to partial clone must fail with any extension' ' + rm -fr server client && + test_create_repo server && + test_commit -C server my_commit 1 && + test_commit -C server my_commit2 1 && + git clone --depth=1 "file://$(pwd)/server" client && + test_cmp_config -C client 0 core.repositoryformatversion && + git -C client config extensions.partialclone origin && + test_must_fail git -C client fetch --unshallow --filter="blob:none" +' + test_expect_success 'missing reflog object, but promised by a commit, passes fsck' ' rm -rf repo && test_create_repo repo && -- cgit v1.2.3