b96721b98d2dbf1355d9d1d7a381c0f7c17ba289
[scm/test.git] / test / test-batch-unknown-oids.sh
1 #!/usr/bin/env bash
2
3 . "test/testlib.sh"
4
5 begin_test "transfer queue rejects unknown OIDs"
6 (
7   set -e
8
9   reponame="unknown-oids"
10   setup_remote_repo "$reponame"
11   clone_repo "$reponame" "$reponame"
12
13   git lfs track "*.dat"
14   git add .gitattributes
15   git commit -m "initial commit"
16
17   contents="unknown-oid"
18   printf "$contents" > a.dat
19
20   git add a.dat
21   git commit -m "add objects"
22
23   set +e
24   git push origin master 2>&1 | tee push.log
25   res="${PIPESTATUS[0]}"
26   set -e
27
28   refute_server_object "$reponame" "$(calc_oid "$contents")"
29   if [ "0" -eq "$res" ]; then
30     echo "push successful?"
31     exit 1
32   fi
33
34   grep "\[unknown-oid\] The server returned an unknown OID." push.log
35 )
36 end_test