Debian Codegraph @

t/t-submodule-lfsconfig.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 . "$(dirnamescip-shell system . . dirname. "$0")/testlib.sh"
4 lfsname="submodule-config-test-lfs"
5 reponame="submodule-config-test-repo"
6 submodname="submodule-config-test-submodule"
7
8 begin_test "submodule env with .lfsconfig"
9 (
10 set -e
11
12 # setup dummy repo with lfs store
13 # no git data will be pushed, just lfs objects
14 setup_remote_repo "$lfsname"
15 echoscip-shell system . . echo. $GITSERVER/$lfsname.git/info/lfs
16
17 # setup submodule
18 setup_remote_repo "$submodname"
19 clone_repo "$submodname" submod
20 mkdirscip-shell system . . mkdir. dir
21 gitscip-shell system . . git. config -f .lfsconfig lfs.url "$GITSERVER/$lfsname.git/info/lfs"
22 gitscip-shell system . . git. lfs track "*.dat"
23 submodcontent="submodule lfs file"
24 submodoid=$(calc_oid "$submodcontent")
25 printfscip-shell system . . printf. "%s" "$submodcontent" > dir/test.dat
26 gitscip-shell system . . git. add .lfsconfig .gitattributes dir
27 gitscip-shell system . . git. commit -m "create submodule"
28 gitscip-shell system . . git. push origin main
29
30 assert_server_object "$lfsname" "$submodoid"
31
32 # setup repo with submodule
33 setup_remote_repo "$reponame"
34 clone_repo "$reponame" repo
35 gitscip-shell system . . git. config -f .lfsconfig lfs.url "$GITSERVER/$lfsname.git/info/lfs"
36 gitscip-shell system . . git. submodule add -b main "$GITSERVER/$submodname" sub
37 gitscip-shell system . . git. submodule update
38 gitscip-shell system . . git. lfs track "*.dat"
39 mkdirscip-shell system . . mkdir. dir
40 repocontent="repository lfs file"
41 repooid=$(calc_oid "$repocontent")
42 printfscip-shell system . . printf. "%s" "$repocontent" > dir/test.dat
43 gitscip-shell system . . git. add .gitattributes .lfsconfig .gitmodules dir sub
44 gitscip-shell system . . git. commit -m "create repo"
45 gitscip-shell system . . git. push origin main
46
47 assert_server_object "$lfsname" "$repooid"
48
49 echoscip-shell system . . echo. "repo"
50 gitscip-shell system . . git. lfs env | teescip-shell system . . tee. env.log
51 grepscip-shell system . . grep. "Endpoint=$GITSERVER/$lfsname.git/info/lfs (auth=basic)$" env.log
52
53 cd sub
54 echoscip-shell system . . echo. "./sub"
55 gitscip-shell system . . git. lfs env | teescip-shell system . . tee. env.log
56 grepscip-shell system . . grep. "Endpoint=$GITSERVER/$lfsname.git/info/lfs (auth=basic)$" env.log
57
58 cd dir
59 echoscip-shell system . . echo. "./sub/dir"
60 gitscip-shell system . . git. lfs env | teescip-shell system . . tee. env.log
61 grepscip-shell system . . grep. "Endpoint=$GITSERVER/$lfsname.git/info/lfs (auth=basic)$" env.log
62 )
63 end_test
64
65 begin_test "submodule update --init --remote with .lfsconfig"
66 (
67 set -e
68 clone_repo "$reponame" clone
69 grepscip-shell system . . grep. "$repocontent" dir/test.dat
70
71 gitscip-shell system . . git. submodule update --init --remote
72
73 grepscip-shell system . . grep. "$submodcontent" sub/dir/test.dat
74 )
75 end_test