2015-07-30 02:37:31 +00:00
|
|
|
#!/usr/bin/env bash
|
2015-05-21 17:52:08 +00:00
|
|
|
|
2018-07-10 18:48:02 +00:00
|
|
|
. "$(dirname "$0")/testlib.sh"
|
2015-05-26 17:48:24 +00:00
|
|
|
reponame="submodule-test-repo"
|
|
|
|
submodname="submodule-test-submodule"
|
2015-05-21 17:52:08 +00:00
|
|
|
|
|
|
|
begin_test "submodule local git dir"
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
|
|
|
|
setup_remote_repo "$reponame"
|
|
|
|
setup_remote_repo "$submodname"
|
|
|
|
|
|
|
|
clone_repo "$submodname" submod
|
|
|
|
mkdir dir
|
|
|
|
echo "sub module" > dir/README
|
|
|
|
git add dir/README
|
|
|
|
git commit -a -m "submodule readme"
|
|
|
|
git push origin master
|
|
|
|
|
|
|
|
clone_repo "$reponame" repo
|
|
|
|
git submodule add "$GITSERVER/$submodname" sub
|
2015-05-26 17:48:24 +00:00
|
|
|
git submodule update
|
|
|
|
git add .gitmodules sub
|
|
|
|
git commit -m "add submodule"
|
|
|
|
git push origin master
|
|
|
|
|
2015-05-27 21:26:03 +00:00
|
|
|
grep "sub module" sub/dir/README || {
|
2016-01-29 18:22:37 +00:00
|
|
|
echo "submodule not setup correctly?"
|
2015-05-27 21:26:03 +00:00
|
|
|
cat sub/dir/README
|
|
|
|
exit 1
|
|
|
|
}
|
2015-05-26 17:48:24 +00:00
|
|
|
)
|
|
|
|
end_test
|
|
|
|
|
|
|
|
begin_test "submodule env"
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# using the local clone from the above test
|
|
|
|
cd repo
|
2015-05-26 22:35:13 +00:00
|
|
|
|
|
|
|
git lfs env | tee env.log
|
2015-09-01 21:54:31 +00:00
|
|
|
grep "Endpoint=$GITSERVER/$reponame.git/info/lfs (auth=none)$" env.log
|
2019-08-30 19:19:24 +00:00
|
|
|
grep "LocalWorkingDir=$(canonical_path_escaped "$TRASHDIR/repo$")" env.log
|
|
|
|
grep "LocalGitDir=$(canonical_path_escaped "$TRASHDIR/repo/.git$")" env.log
|
|
|
|
grep "LocalGitStorageDir=$(canonical_path_escaped "$TRASHDIR/repo/.git$")" env.log
|
|
|
|
grep "LocalMediaDir=$(canonical_path_escaped "$TRASHDIR/repo/.git/lfs/objects$")" env.log
|
|
|
|
grep "TempDir=$(canonical_path_escaped "$TRASHDIR/repo/.git/lfs/tmp$")" env.log
|
2015-05-26 17:48:24 +00:00
|
|
|
|
|
|
|
cd .git
|
|
|
|
|
2015-05-26 22:35:13 +00:00
|
|
|
echo "./.git"
|
|
|
|
git lfs env | tee env.log
|
2015-10-22 13:34:44 +00:00
|
|
|
cat env.log
|
2015-09-01 21:54:31 +00:00
|
|
|
grep "Endpoint=$GITSERVER/$reponame.git/info/lfs (auth=none)$" env.log
|
2015-05-30 12:32:10 +00:00
|
|
|
grep "LocalWorkingDir=$" env.log
|
2019-08-30 19:19:24 +00:00
|
|
|
grep "LocalGitDir=$(canonical_path_escaped "$TRASHDIR/repo/.git$")" env.log
|
|
|
|
grep "LocalGitStorageDir=$(canonical_path_escaped "$TRASHDIR/repo/.git$")" env.log
|
|
|
|
grep "LocalMediaDir=$(canonical_path_escaped "$TRASHDIR/repo/.git/lfs/objects$")" env.log
|
|
|
|
grep "TempDir=$(canonical_path_escaped "$TRASHDIR/repo/.git/lfs/tmp$")" env.log
|
2015-05-26 17:48:24 +00:00
|
|
|
|
|
|
|
cd ../sub
|
|
|
|
|
2015-05-26 22:35:13 +00:00
|
|
|
echo "./sub"
|
|
|
|
git lfs env | tee env.log
|
2015-09-01 21:54:31 +00:00
|
|
|
grep "Endpoint=$GITSERVER/$submodname.git/info/lfs (auth=none)$" env.log
|
2019-08-30 19:19:24 +00:00
|
|
|
grep "LocalWorkingDir=$(canonical_path_escaped "$TRASHDIR/repo/sub$")" env.log
|
|
|
|
grep "LocalGitDir=$(canonical_path_escaped "$TRASHDIR/repo/.git/modules/sub$")" env.log
|
|
|
|
grep "LocalGitStorageDir=$(canonical_path_escaped "$TRASHDIR/repo/.git/modules/sub$")" env.log
|
|
|
|
grep "LocalMediaDir=$(canonical_path_escaped "$TRASHDIR/repo/.git/modules/sub/lfs/objects$")" env.log
|
|
|
|
grep "TempDir=$(canonical_path_escaped "$TRASHDIR/repo/.git/modules/sub/lfs/tmp$")" env.log
|
2015-05-29 22:49:34 +00:00
|
|
|
|
|
|
|
cd dir
|
|
|
|
|
2015-05-29 23:49:00 +00:00
|
|
|
echo "./sub/dir"
|
2015-05-29 22:49:34 +00:00
|
|
|
git lfs env | tee env.log
|
2015-09-01 21:54:31 +00:00
|
|
|
grep "Endpoint=$GITSERVER/$submodname.git/info/lfs (auth=none)$" env.log
|
2019-08-30 19:19:24 +00:00
|
|
|
grep "LocalWorkingDir=$(canonical_path_escaped "$TRASHDIR/repo/sub$")" env.log
|
|
|
|
grep "LocalGitDir=$(canonical_path_escaped "$TRASHDIR/repo/.git/modules/sub$")" env.log
|
|
|
|
grep "LocalGitStorageDir=$(canonical_path_escaped "$TRASHDIR/repo/.git/modules/sub$")" env.log
|
|
|
|
grep "LocalMediaDir=$(canonical_path_escaped "$TRASHDIR/repo/.git/modules/sub/lfs/objects$")" env.log
|
|
|
|
grep "TempDir=$(canonical_path_escaped "$TRASHDIR/repo/.git/modules/sub/lfs/tmp$")" env.log
|
2015-05-21 17:52:08 +00:00
|
|
|
)
|
|
|
|
end_test
|