| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | |
| 3 | . "$(dirnamescip-shell system . . dirname. "$0")/testlib.sh" |
| 4 | |
| 5 | begin_test "cherry-pick two commits without lfs cache" |
| 6 | ( |
| 7 | set -e |
| 8 | |
| 9 | reponame="$(basenamescip-shell system . . basename. "$0" ".sh")-cherry-pick-commits" |
| 10 | setup_remote_repo "$reponame" |
| 11 | clone_repo "$reponame" cherrypickcommits |
| 12 | |
| 13 | gitscip-shell system . . git. lfs track "*.dat" |
| 14 | gitscip-shell system . . git. add .gitattributes |
| 15 | gitscip-shell system . . git. commit -m "initial commit" |
| 16 | |
| 17 | gitscip-shell system . . git. branch secondbranch |
| 18 | |
| 19 | echoscip-shell system . . echo. "smudge a" > a.dat |
| 20 | gitscip-shell system . . git. add a.dat |
| 21 | gitscip-shell system . . git. commit -m "add a.dat" |
| 22 | commit1=$(gitscip-shell system . . git. log -n1 --format="%H") |
| 23 | |
| 24 | echoscip-shell system . . echo. "smudge b" > b.dat |
| 25 | gitscip-shell system . . git. add b.dat |
| 26 | gitscip-shell system . . git. commit -m "add a.dat" |
| 27 | commit2=$(gitscip-shell system . . git. log -n1 --format="%H") |
| 28 | |
| 29 | gitscip-shell system . . git. push origin main |
| 30 | |
| 31 | gitscip-shell system . . git. checkout secondbranch |
| 32 | rmscip-shell system . . rm. -rf .git/lfs/objects |
| 33 | |
| 34 | gitscip-shell system . . git. cherry-pick $commit1 $commit2 |
| 35 | ) |
| 36 | end_test |