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