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