2 # This is a sample Git LFS test. See test/README.md and testhelpers.sh for
5 . "$(dirname "$0")/testlib.sh"
7 begin_test "batch error handling"
11 # This initializes a new bare git repository in test/remote.
12 # These remote repositories are global to every test, so keep the names
14 reponame="badbatch" # Server looks for the "badbatch" repo, returns a 203 status
15 setup_remote_repo "$reponame"
17 # Clone the repository from the test Git server. This is empty, and will be
18 # used to test a "git pull" below. The repo is cloned to $TRASHDIR/clone
19 clone_repo "$reponame" clone
21 # Clone the repository again to $TRASHDIR/repo. This will be used to commit
23 clone_repo "$reponame" repo
25 # This executes Git LFS from the local repo that was just cloned.
26 git lfs track "*.dat" 2>&1 | tee track.log
27 grep "Tracking \"\*.dat\"" track.log
30 contents_oid=$(calc_oid "$contents")
32 printf "$contents" > a.dat
34 git add .gitattributes
35 git commit -m "add a.dat" 2>&1 | tee commit.log
36 grep "master (root-commit)" commit.log
37 grep "2 files changed" commit.log
38 grep "create mode 100644 a.dat" commit.log
39 grep "create mode 100644 .gitattributes" commit.log
41 [ "a" = "$(cat a.dat)" ]
43 # This is a small shell function that runs several git commands together.
44 assert_pointer "master" "a.dat" "$contents_oid" 1
46 refute_server_object "$reponame" "$contents_oid"
48 # This pushes to the remote repository set up at the top of the test.
49 git push origin master 2>&1 | tee push.log
50 grep "Unable to parse HTTP response" push.log