Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasey Fitzpatrick <kcghost@gmail.com>2018-05-03 13:53:46 +0300
committerJunio C Hamano <gitster@pobox.com>2018-05-22 06:22:42 +0300
commita0ef29341accafa51345e90225d87f6a0d297b7b (patch)
tree5c890ac6cf58f59f9946b4e75c288b2a561d1e51 /t/t7408-submodule-reference.sh
parent6d33e1c28210bacf2e664b55b2feb255991e0ad5 (diff)
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-xt/t7408-submodule-reference.sh17
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 &&