diff options
author | Casey Fitzpatrick <kcghost@gmail.com> | 2018-05-03 06:53:46 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-22 12:22:42 +0900 |
commit | a0ef29341accafa51345e90225d87f6a0d297b7b (patch) | |
tree | 5c890ac6cf58f59f9946b4e75c288b2a561d1e51 /t/t7408-submodule-reference.sh | |
parent | 6d33e1c28210bacf2e664b55b2feb255991e0ad5 (diff) | |
download | git-a0ef29341accafa51345e90225d87f6a0d297b7b.tar.gz |
submodule: add --dissociate option to add/update commands
Add --dissociate option to add and update commands, both clone helper commands
that already have the --reference option --dissociate pairs with.
Signed-off-by: Casey Fitzpatrick <kcghost@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7408-submodule-reference.sh')
-rwxr-xr-x | t/t7408-submodule-reference.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t7408-submodule-reference.sh b/t/t7408-submodule-reference.sh index e159fc5035..08d9add05e 100755 --- a/t/t7408-submodule-reference.sh +++ b/t/t7408-submodule-reference.sh @@ -59,6 +59,16 @@ test_expect_success 'submodule add --reference uses alternates' ' test_alternate_is_used super/.git/modules/sub/objects/info/alternates super/sub ' +test_expect_success 'submodule add --reference with --dissociate does not use alternates' ' + ( + cd super && + git submodule add --reference ../B --dissociate "file://$base_dir/A" sub-dissociate && + git commit -m B-super-added && + git repack -ad + ) && + test_path_is_missing super/.git/modules/sub-dissociate/objects/info/alternates +' + test_expect_success 'that reference gets used with add' ' ( cd super/sub && @@ -82,6 +92,13 @@ test_expect_success 'updating superproject keeps alternates' ' test_alternate_is_used super-clone/.git/modules/sub/objects/info/alternates super-clone/sub ' +test_expect_success 'updating superproject with --dissociate does not keep alternates' ' + test_when_finished "rm -rf super-clone" && + git clone super super-clone && + git -C super-clone submodule update --init --reference ../B --dissociate && + test_path_is_missing super-clone/.git/modules/sub/objects/info/alternates +' + test_expect_success 'submodules use alternates when cloning a superproject' ' test_when_finished "rm -rf super-clone" && git clone --reference super --recursive super super-clone && |