3 . "$(dirname "$0")/testlib.sh"
4 lfsname="submodule-config-test-lfs"
5 reponame="submodule-config-test-repo"
6 submodname="submodule-config-test-submodule"
8 begin_test "submodule env with .lfsconfig"
12 # setup dummy repo with lfs store
13 # no git data will be pushed, just lfs objects
14 setup_remote_repo "$lfsname"
15 echo $GITSERVER/$lfsname.git/info/lfs
18 setup_remote_repo "$submodname"
19 clone_repo "$submodname" submod
21 git config -f .lfsconfig lfs.url "$GITSERVER/$lfsname.git/info/lfs"
23 submodcontent="submodule lfs file"
24 submodoid=$(calc_oid "$submodcontent")
25 printf "$submodcontent" > dir/test.dat
26 git add .lfsconfig .gitattributes dir
27 git commit -m "create submodule"
28 git push origin master
30 assert_server_object "$lfsname" "$submodoid"
32 # setup repo with submodule
33 setup_remote_repo "$reponame"
34 clone_repo "$reponame" repo
35 git config -f .lfsconfig lfs.url "$GITSERVER/$lfsname.git/info/lfs"
36 git submodule add "$GITSERVER/$submodname" sub
40 repocontent="repository lfs file"
41 repooid=$(calc_oid "$repocontent")
42 printf "$repocontent" > dir/test.dat
43 git add .gitattributes .lfsconfig .gitmodules dir sub
44 git commit -m "create repo"
45 git push origin master
47 assert_server_object "$lfsname" "$repooid"
50 git lfs env | tee env.log
51 grep "Endpoint=$GITSERVER/$lfsname.git/info/lfs (auth=basic)$" env.log
55 git lfs env | tee env.log
56 grep "Endpoint=$GITSERVER/$lfsname.git/info/lfs (auth=basic)$" env.log
60 git lfs env | tee env.log
61 grep "Endpoint=$GITSERVER/$lfsname.git/info/lfs (auth=basic)$" env.log
65 begin_test "submodule update --init --remote with .lfsconfig"
68 clone_repo "$reponame" clone
69 grep "$repocontent" dir/test.dat
71 git submodule update --init --remote
73 grep "$submodcontent" sub/dir/test.dat