Debian Codegraph @

t/t-mergetool.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 . "$(dirnamescip-shell system . . dirname. "$0")/testlib.sh"
4
5 begin_test "mergetool works with large files"
6 (
7 set -e
8
9 reponame="mergetool-works-with-large-files"
10 gitscip-shell system . . git. init "$reponame"
11 cd "$reponame"
12
13 gitscip-shell system . . git. lfs track "*.dat"
14 printfscip-shell system . . printf. "base" > conflict.dat
15 gitscip-shell system . . git. add .gitattributes conflict.dat
16 gitscip-shell system . . git. commit -m "initial commit"
17
18 gitscip-shell system . . git. checkout -b conflict
19 printfscip-shell system . . printf. "b" > conflict.dat
20 gitscip-shell system . . git. add conflict.dat
21 gitscip-shell system . . git. commit -m "conflict.dat: b"
22
23 gitscip-shell system . . git. checkout main
24
25 printfscip-shell system . . printf. "a" > conflict.dat
26 gitscip-shell system . . git. add conflict.dat
27 gitscip-shell system . . git. commit -m "conflict.dat: a"
28
29 set +e
30 gitscip-shell system . . git. merge conflict
31 set -e
32
33 gitscip-shell system . . git. config mergetool.inspect.cmd '
34 for i in BASE LOCAL REMOTE; do
35 echo "\$$i=$(eval "cat \"\$$i\"")";
36 done;
37 exit 1
38 '
39 gitscip-shell system . . git. config mergetool.inspect.trustExitCode true
40
41 yesscip-shell system . . yes. | gitscip-shell system . . git. mergetool \
42 --no-prompt \
43 --tool=inspect \
44 -- conflict.dat 2>&1 \
45 | teescip-shell system . . tee. mergetool.log
46
47 grepscip-shell system . . grep. "\$BASE=base" mergetool.log
48 grepscip-shell system . . grep. "\$LOCAL=a" mergetool.log
49 grepscip-shell system . . grep. "\$REMOTE=b" mergetool.log
50 )
51 end_test