aboutsummaryrefslogtreecommitdiff
path: root/t/lib-submodule-update.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/lib-submodule-update.sh')
-rwxr-xr-xt/lib-submodule-update.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh
index 5df528ea8..c0d632513 100755
--- a/t/lib-submodule-update.sh
+++ b/t/lib-submodule-update.sh
@@ -37,6 +37,17 @@
#
create_lib_submodule_repo () {
+ git init submodule_update_sub1 &&
+ (
+ cd submodule_update_sub1 &&
+ echo "expect" >>.gitignore &&
+ echo "actual" >>.gitignore &&
+ echo "x" >file1 &&
+ echo "y" >file2 &&
+ git add .gitignore file1 file2 &&
+ git commit -m "Base inside first submodule" &&
+ git branch "no_submodule"
+ ) &&
git init submodule_update_repo &&
(
cd submodule_update_repo &&
@@ -49,7 +60,7 @@ create_lib_submodule_repo () {
git branch "no_submodule" &&
git checkout -b "add_sub1" &&
- git submodule add ./. sub1 &&
+ git submodule add ../submodule_update_sub1 sub1 &&
git config -f .gitmodules submodule.sub1.ignore all &&
git config submodule.sub1.ignore all &&
git add .gitmodules &&
@@ -162,7 +173,7 @@ reset_work_tree_to () {
test_must_be_empty actual &&
sha1=$(git rev-parse --revs-only HEAD:sub1) &&
if test -n "$sha1" &&
- test $(cd "sub1" && git rev-parse --verify "$sha1^{commit}")
+ test $(cd "../submodule_update_sub1" && git rev-parse --verify "$sha1^{commit}")
then
git submodule update --init --recursive "sub1"
fi