1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
#!/usr/bin/env bash
. "$(dirname "$0")/testlib.sh"
reponame="$(basename "$0" ".sh")"
begin_test "GIT_LFS_PROGRESS"
(
set -e
setup_remote_repo "$reponame"
clone_repo "$reponame" repo
git lfs track "*.dat"
echo "a" > a.dat
echo "b" > b.dat
echo "c" > c.dat
echo "d" > d.dat
echo "e" > e.dat
git add .gitattributes *.dat
git commit -m "add files"
git push origin main 2>&1 | tee push.log
grep "Uploading LFS objects: 100% (5/5), 10 B" push.log
cd ..
GIT_LFS_PROGRESS="$TRASHDIR/progress.log" git lfs clone "$GITSERVER/$reponame" clone
cat progress.log
grep "download 1/5" progress.log
grep "download 2/5" progress.log
grep "download 3/5" progress.log
grep "download 4/5" progress.log
grep "download 5/5" progress.log
GIT_LFS_SKIP_SMUDGE=1 git clone "$GITSERVER/$reponame" clone2
cd clone2
rm -rf "$TRASHDIR/progress.log" .git/lfs/objects
GIT_LFS_PROGRESS="$TRASHDIR/progress.log" git lfs fetch --all
cat ../progress.log
grep "download 1/5" ../progress.log
grep "download 2/5" ../progress.log
grep "download 3/5" ../progress.log
grep "download 4/5" ../progress.log
grep "download 5/5" ../progress.log
rm -rf "$TRASHDIR/progress.log"
GIT_LFS_PROGRESS="$TRASHDIR/progress.log" git lfs checkout
cat ../progress.log
grep "checkout 1/5" ../progress.log
grep "checkout 2/5" ../progress.log
grep "checkout 3/5" ../progress.log
grep "checkout 4/5" ../progress.log
grep "checkout 5/5" ../progress.log
)
end_test
|