9e006ac4e2
Currently, our default branch in tests is "master". This is the Git default, but the Git default will likely change in the future, so it makes sense to update our testsuite to be explicit about the branch name. We'll ensure this continues by building against older versions of Git as well as newer versions. We use "main" for the new branch name, since that's the proposed value upstream. This commit was made entirely by automated means using the following command: git grep -l master t | xargs sed -i -e 's/master/main/g'
55 lines
1.5 KiB
Bash
Executable File
55 lines
1.5 KiB
Bash
Executable File
#!/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
|