Debian Codegraph @

t/t-batch-error-handling.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 . "$(dirnamescip-shell system . . dirname. "$0")/testlib.sh"
4
5 begin_test "batch error handling"
6 (
7 set -e
8
9 # This initializes a new bare git repository in test/remote.
10 # These remote repositories are global to every test, so keep the names
11 # unique.
12 reponame="badbatch" # Server looks for the "badbatch" repo, returns a 203 status
13 setup_remote_repo "$reponame"
14
15 # Clone the repository from the test Git server. This is empty, and will be
16 # used to test a "git pull" below. The repo is cloned to $TRASHDIR/clone
17 clone_repo "$reponame" clone
18
19 # Clone the repository again to $TRASHDIR/repo. This will be used to commit
20 # and push objects.
21 clone_repo "$reponame" repo
22
23 # This executes Git LFS from the local repo that was just cloned.
24 gitscip-shell system . . git. lfs track "*.dat" 2>&1 | teescip-shell system . . tee. track.log
25 grepscip-shell system . . grep. "Tracking \"\*.dat\"" track.log
26
27 contents="a"
28 contents_oid=$(calc_oid "$contents")
29
30 printfscip-shell system . . printf. "%s" "$contents" > a.dat
31 gitscip-shell system . . git. add a.dat
32 gitscip-shell system . . git. add .gitattributes
33 gitscip-shell system . . git. commit -m "add a.dat" 2>&1 | teescip-shell system . . tee. commit.log
34 grepscip-shell system . . grep. "main (root-commit)" commit.log
35 grepscip-shell system . . grep. "2 files changed" commit.log
36 grepscip-shell system . . grep. "create mode 100644 a.dat" commit.log
37 grepscip-shell system . . grep. "create mode 100644 .gitattributes" commit.log
38
39 [scip-shell system . . `[`. "a" = "$(catscip-shell system . . cat. a.dat)" ]
40
41 # This is a small shell function that runs several git commands together.
42 assert_pointer "main" "a.dat" "$contents_oid" 1
43
44 refute_server_object "$reponame" "$contents_oid"
45
46 # This pushes to the remote repository set up at the top of the test.
47 gitscip-shell system . . git. push origin main 2>&1 | teescip-shell system . . tee. push.log
48 grepscip-shell system . . grep. "Unable to parse HTTP response" push.log
49 )
50 end_test