Debian Codegraph @

t/t-submodule-recurse.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 . "$(dirnamescip-shell system . . dirname. "$0")/testlib.sh"
4 reponame="submodule-recurse-test-repo"
5 submodname="submodule-recurse-test-submodule"
6
7 begin_test "submodule with submodule.recurse = true"
8 (
9 set -e
10
11 setup_remote_repo "$reponame"
12 setup_remote_repo "$submodname"
13
14 clone_repo "$submodname" submodule
15
16 gitscip-shell system . . git. lfs track "*.dat" 2>&1 | teescip-shell system . . tee. track.log
17 grepscip-shell system . . grep. "Tracking \"\*.dat\"" track.log
18
19 echoscip-shell system . . echo. "foo" > file.dat
20 gitscip-shell system . . git. add .gitattributes file.dat
21 gitscip-shell system . . git. commit -a -m "add file"
22 gitscip-shell system . . git. push origin main
23 subcommit1=$(gitscip-shell system . . git. rev-parse HEAD)
24
25 echoscip-shell system . . echo. "bar" > file.dat
26 gitscip-shell system . . git. add file.dat
27 gitscip-shell system . . git. commit -a -m "update file"
28 gitscip-shell system . . git. push origin main
29 subcommit2=$(gitscip-shell system . . git. rev-parse HEAD)
30
31 clone_repo "$reponame" repo
32 gitscip-shell system . . git. submodule add "$GITSERVER/$submodname" submodule
33 gitscip-shell system . . git. submodule update --init --recursive
34 gitscip-shell system . . git. -C submodule reset --hard "$subcommit1"
35 gitscip-shell system . . git. add .gitmodules submodule
36 gitscip-shell system . . git. commit -m "add submodule"
37 gitscip-shell system . . git. push origin main
38
39 gitscip-shell system . . git. checkout -b feature
40 gitscip-shell system . . git. -C submodule reset --hard "$subcommit2"
41 gitscip-shell system . . git. add .gitmodules submodule
42 gitscip-shell system . . git. commit -m "update submodule"
43 gitscip-shell system . . git. push origin feature
44
45 clone_repo "$reponame" repo-no-recurse
46 gitscip-shell system . . git. submodule update --init --recursive
47 gitscip-shell system . . git. checkout feature
48
49 if [[ -d "submodule/lfs/logs" ]]
50 then
51 exit 1
52 fi
53
54 clone_repo "$reponame" repo-recurse
55 gitscip-shell system . . git. config submodule.recurse true
56 gitscip-shell system . . git. submodule update --init --recursive
57 gitscip-shell system . . git. checkout feature
58
59 if [[ -d "submodule/lfs/logs" ]]
60 then
61 exit 1
62 fi
63 )
64 end_test