Skip to content

Commit 4b0f50e

Browse files
committed
test/testhelpers: add corrupt_local_object helper
1 parent cf291e1 commit 4b0f50e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/testhelpers.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ delete_local_object() {
7272
rm "$f"
7373
}
7474

75+
# corrupt_local_object corrupts the local storage for an oid
76+
# $ corrupt_local_object "some-oid"
77+
corrupt_local_object() {
78+
local oid="$1"
79+
local cfg=`git lfs env | grep LocalMediaDir`
80+
local f="${cfg:14}/${oid:0:2}/${oid:2:2}/$oid"
81+
cp /dev/null "$f"
82+
}
83+
7584

7685
# check that the object does not exist in the git lfs server. HTTP log is
7786
# written to http.log. JSON output is written to http.json.

0 commit comments

Comments
 (0)