Merge branch 'jt/promisor-pack-fix'
Updates into a lazy/partial clone with a submodule did not work well with transfer.fsckobjects set. * jt/promisor-pack-fix: fetch-pack: in partial clone, pass --promisor
This commit is contained in:
commit
63728e4814
17
fetch-pack.c
17
fetch-pack.c
@ -866,13 +866,16 @@ static int get_pack(struct fetch_pack_args *args,
|
|||||||
* have this responsibility.
|
* have this responsibility.
|
||||||
*/
|
*/
|
||||||
args->check_self_contained_and_connected = 0;
|
args->check_self_contained_and_connected = 0;
|
||||||
/*
|
|
||||||
* If we're obtaining the filename of a lockfile, we'll use
|
if (args->from_promisor)
|
||||||
* that filename to write a .promisor file with more
|
/*
|
||||||
* information below. If not, we need index-pack to do it for
|
* write_promisor_file() may be called afterwards but
|
||||||
* us.
|
* we still need index-pack to know that this is a
|
||||||
*/
|
* promisor pack. For example, if transfer.fsckobjects
|
||||||
if (!(do_keep && pack_lockfiles) && args->from_promisor)
|
* is true, index-pack needs to know that .gitmodules
|
||||||
|
* is a promisor object (so that it won't complain if
|
||||||
|
* it is missing).
|
||||||
|
*/
|
||||||
strvec_push(&cmd.args, "--promisor");
|
strvec_push(&cmd.args, "--promisor");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -163,6 +163,22 @@ test_expect_success 'manual prefetch of missing objects' '
|
|||||||
test_line_count = 0 observed.oids
|
test_line_count = 0 observed.oids
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'partial clone with transfer.fsckobjects=1 works with submodules' '
|
||||||
|
test_create_repo submodule &&
|
||||||
|
test_commit -C submodule mycommit &&
|
||||||
|
|
||||||
|
test_create_repo src_with_sub &&
|
||||||
|
test_config -C src_with_sub uploadpack.allowfilter 1 &&
|
||||||
|
test_config -C src_with_sub uploadpack.allowanysha1inwant 1 &&
|
||||||
|
|
||||||
|
git -C src_with_sub submodule add "file://$(pwd)/submodule" mysub &&
|
||||||
|
git -C src_with_sub commit -m "commit with submodule" &&
|
||||||
|
|
||||||
|
git -c transfer.fsckobjects=1 \
|
||||||
|
clone --filter="blob:none" "file://$(pwd)/src_with_sub" dst &&
|
||||||
|
test_when_finished rm -rf dst
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'partial clone with transfer.fsckobjects=1 uses index-pack --fsck-objects' '
|
test_expect_success 'partial clone with transfer.fsckobjects=1 uses index-pack --fsck-objects' '
|
||||||
git init src &&
|
git init src &&
|
||||||
test_commit -C src x &&
|
test_commit -C src x &&
|
||||||
|
Loading…
Reference in New Issue
Block a user