@@ -191,7 +191,7 @@ test_expect_success 'setup' '
git add a &&
git commit -m"commit in submodule"
) &&
- git add a/submodule &&
+ git submodule add ./a/submodule ./a/submodule &&
cat <<-\EOF >.gitignore &&
one
ignored-*
@@ -10,7 +10,7 @@ test_expect_success 'setup' '
(cd submodule &&
git init &&
test_commit first) &&
- git add submodule &&
+ git submodule add ./submodule &&
test_tick &&
git commit -m superproject &&
(cd submodule &&
@@ -51,6 +51,7 @@ test_expect_success '"checkout <submodule>" honors submodule.*.ignore from .gitm
git config diff.ignoreSubmodules none &&
git config -f .gitmodules submodule.submodule.path submodule &&
git config -f .gitmodules submodule.submodule.ignore untracked &&
+ git commit -m "Update patterns in .gitmodules" .gitmodules &&
git checkout HEAD >actual 2>&1 &&
test_must_be_empty actual
'
@@ -59,6 +60,7 @@ test_expect_success '"checkout <submodule>" honors submodule.*.ignore from .git/
git config -f .gitmodules submodule.submodule.ignore none &&
git config submodule.submodule.path submodule &&
git config submodule.submodule.ignore all &&
+ git commit -m "Update patterns in .gitmodules" .gitmodules &&
git checkout HEAD >actual 2>&1 &&
test_must_be_empty actual
'
@@ -36,7 +36,7 @@ test_expect_success basics '
git add file &&
git commit -m "sub initial"
) &&
- git add xyzzy &&
+ git submodule add ./xyzzy &&
test_tick &&
git commit -m initial &&
@@ -49,7 +49,7 @@ test_expect_success '--cacheinfo does not accept blob null sha1' '
test_expect_success '--cacheinfo does not accept gitlink null sha1' '
git init submodule &&
(cd submodule && test_commit foo) &&
- git add submodule &&
+ git submodule add ./submodule &&
git rev-parse :submodule >expect &&
test_must_fail git update-index --cacheinfo 160000 $ZERO_OID submodule &&
git rev-parse :submodule >actual &&
@@ -69,7 +69,7 @@ test_expect_success 'check if clone works' '
test_expect_success 'removing and adding subproject' '
git update-index --force-remove -- sub2 &&
mv sub2 sub3 &&
- git add sub3 &&
+ git submodule add ./sub3 &&
git commit -q -m "renaming a subproject" &&
test_expect_code 1 git diff -M --name-status --exit-code HEAD^ HEAD
'
@@ -14,7 +14,8 @@ test_expect_success setup '
git commit -m "subproject commit #1"
) &&
>mainfile &&
- git add sub mainfile &&
+ git add mainfile &&
+ git submodule add ./sub &&
test_tick &&
git commit -m "superproject commit #1"
'
@@ -675,7 +675,8 @@ test_expect_success 'submodule rebase setup' '
git add elif && git commit -m "submodule initial"
) &&
echo 1 >file1 &&
- git add file1 sub &&
+ git add file1 &&
+ git submodule add ./sub &&
test_tick &&
git commit -m "One" &&
echo 2 >file1 &&
@@ -913,8 +913,9 @@ test_expect_success 'setup different kinds of dirty submodules' '
) &&
cp -R dirty-head dirty-otherwise &&
cp -R dirty-head dirty-both-ways &&
- git add dirty-head &&
- git add dirty-otherwise dirty-both-ways &&
+ git submodule add ./dirty-head &&
+ git submodule add ./dirty-otherwise &&
+ git submodule add ./dirty-both-ways &&
git commit -m initial &&
cd dirty-head &&
@@ -117,7 +117,7 @@ test_expect_success 'setup submodules' '
test_tick &&
git init submod &&
( cd submod && test_commit first ) &&
- git add submod &&
+ git submodule add ./submod &&
git commit -m first &&
( cd submod && test_commit second ) &&
git add submod &&
@@ -253,7 +253,7 @@ test_expect_success 'clean up crlf leftovers' '
test_expect_success 'submodule diff' '
git init sub &&
( cd sub && test_commit sub1 ) &&
- git add sub &&
+ git submodule add ./sub &&
test_tick &&
git commit -m "add submodule" &&
( cd sub && test_commit sub2 ) &&
@@ -66,6 +66,7 @@ test_expect_success 'git diff-index --cached HEAD^' '
test_expect_success 'git diff-index --cached HEAD^' '
echo text >>b &&
echo 3 >c &&
+ git submodule add ./test-outside/repo ./test-outside/repo &&
git add . &&
test_expect_code 1 git diff-index --quiet --cached HEAD^ >cnt &&
test_line_count = 0 cnt
@@ -28,7 +28,7 @@ test_expect_success setup '
git add junk &&
git commit -m "Initial junk"
) &&
- git add gar/bage &&
+ git submodule add ./gar/bage ./gar/bage &&
git commit -m "Initial superproject"
)
'
@@ -367,7 +367,7 @@ test_expect_success 'push succeeds if submodule has no remote and is on the firs
git add junk &&
git commit -m "initial"
) &&
- git add b &&
+ git submodule add ./b &&
git commit -m "added submodule" &&
git push --recurse-submodules=check origin main
)
@@ -1270,7 +1270,7 @@ test_expect_success 'setup submodule modify/modify' '
) &&
git -C submod reset --hard A &&
- git add submod &&
+ git submodule add ./submod &&
git commit -m A &&
git tag A &&
@@ -1303,7 +1303,7 @@ test_expect_merge_algorithm failure success 'check submodule modify/modify' '
test_must_fail git merge -s recursive E^0 &&
git ls-files -s >out &&
- test_line_count = 3 out &&
+ test_line_count = 4 out &&
git ls-files -u >out &&
test_line_count = 3 out &&
git ls-files -o >out &&
@@ -1364,12 +1364,12 @@ test_expect_success 'setup submodule add/add' '
git checkout -b B A &&
git -C submod reset --hard B &&
- git add submod &&
+ git submodule add ./submod &&
git commit -m B &&
git checkout -b C A &&
git -C submod reset --hard C &&
- git add submod &&
+ git submodule add ./submod &&
git commit -m C &&
git checkout -q B^0 &&
@@ -1391,7 +1391,7 @@ test_expect_merge_algorithm failure success 'check submodule add/add' '
test_must_fail git merge -s recursive E^0 &&
git ls-files -s >out &&
- test_line_count = 3 out &&
+ test_line_count = 4 out &&
git ls-files -u >out &&
test_line_count = 2 out &&
git ls-files -o >out &&
@@ -1439,7 +1439,7 @@ test_expect_success 'setup conflicting entry types (submodule vs symlink)' '
git checkout -b B A &&
git -C path reset --hard B &&
- git add path &&
+ git submodule add ./path &&
git commit -m B &&
git checkout -b C A &&
@@ -677,6 +677,7 @@ test_expect_success 'merging with triple rename across D/F conflict' '
echo content3 >sub2/file3 &&
mkdir simple &&
echo base >simple/bar &&
+ git -c protocol.file.allow=always submodule add ./sym &&
git add -A &&
test_tick &&
git commit -m base &&
@@ -30,7 +30,7 @@ test_expect_success setup '
git add file &&
test_tick &&
git commit -m sub-root) &&
- git add sub &&
+ git submodule add ./sub &&
test_tick &&
git commit -m root &&
@@ -85,7 +85,7 @@ test_expect_success 'setup for merge search' '
git branch sub-a) &&
git commit --allow-empty -m init &&
git branch init &&
- git add sub &&
+ git submodule add ./sub &&
git commit -m "a" &&
git branch a &&
@@ -132,7 +132,7 @@ test_expect_success 'finish setup for merge-search' '
git checkout -b g init &&
(cd sub &&
git checkout -b sub-g sub-c) &&
- git add sub &&
+ git submodule add ./sub &&
git commit -a -m "g")
'
@@ -296,7 +296,7 @@ test_expect_success 'setup for recursive merge with submodule' '
git checkout -b sub-cb sub-c &&
git merge sub-b &&
git checkout main) &&
- git add sub &&
+ git submodule add ./sub &&
git commit -m a &&
git checkout -b top-b main &&
(cd sub && git checkout sub-b) &&
@@ -520,7 +520,7 @@ test_expect_success 'setup for null merge base' '
git commit --allow-empty -m init &&
git branch init &&
git checkout -b a init &&
- git add sub &&
+ git submodule add ./sub &&
git commit -m "a" &&
git switch main &&
(cd sub &&
@@ -532,7 +532,7 @@ test_expect_success 'setup for null merge base' '
test_expect_success 'merging should fail with no merge base' '
(cd no-merge-base &&
git checkout -b b init &&
- git add sub &&
+ git submodule add ./sub &&
git commit -m "b" &&
test_must_fail git merge a >actual &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
@@ -45,7 +45,7 @@ add_file . foo >/dev/null
head1=$(add_file sm1 foo1 foo2)
test_expect_success 'added submodule' "
- git add sm1 &&
+ git submodule add ./sm1 &&
git submodule summary >actual &&
cat >expected <<-EOF &&
* sm1 0000000...$head1 (2):
@@ -253,7 +253,7 @@ test_expect_success 'deleted submodule' "
test_expect_success 'create second submodule' '
test_create_repo sm2 &&
head7=$(add_file sm2 foo8 foo9) &&
- git add sm2
+ git submodule add ./sm2
'
test_expect_success 'multiple submodules' "
@@ -14,7 +14,7 @@ test_expect_success setup '
test_tick &&
git commit -m initial &&
git clone . submodule &&
- git add submodule &&
+ git submodule add ./submodule &&
test_tick &&
git commit -m submodule &&
echo second line >> file &&