File: t-batch-unknown-oids.sh

package info (click to toggle)
git-lfs 3.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,808 kB
  • sloc: sh: 21,256; makefile: 507; ruby: 417
file content (36 lines) | stat: -rwxr-xr-x 704 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash

. "$(dirname "$0")/testlib.sh"

begin_test "transfer queue rejects unknown OIDs"
(
  set -e

  reponame="unknown-oids"
  setup_remote_repo "$reponame"
  clone_repo "$reponame" "$reponame"

  git lfs track "*.dat"
  git add .gitattributes
  git commit -m "initial commit"

  contents="unknown-oid"
  printf "%s" "$contents" > a.dat

  git add a.dat
  git commit -m "add objects"

  set +e
  git push origin main 2>&1 | tee push.log
  res="${PIPESTATUS[0]}"
  set -e

  refute_server_object "$reponame" "$(calc_oid "$contents")"
  if [ "0" -eq "$res" ]; then
    echo "push successful?"
    exit 1
  fi

  grep "\[unknown-oid\] The server returned an unknown OID." push.log
)
end_test