forked from git-lfs/git-lfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-post-commit.sh
More file actions
executable file
·50 lines (36 loc) · 1.1 KB
/
test-post-commit.sh
File metadata and controls
executable file
·50 lines (36 loc) · 1.1 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
. "test/testlib.sh"
begin_test "post-commit"
(
set -e
reponame="$(basename "$0" ".sh")"
setup_remote_repo "$reponame"
clone_repo "$reponame" "$reponame"
git lfs track --lockable "*.dat"
git lfs track "*.big" # not lockable
git add .gitattributes
git commit -m "add git attributes"
echo "Come with me" > pcfile1.dat
echo "and you'll be" > pcfile2.dat
echo "in a world" > pcfile3.big
echo "of pure imagination" > pcfile4.big
git add *.dat
git commit -m "Committed large files"
# New lockable files should have been made read-only now since not locked
refute_file_writable pcfile1.dat
refute_file_writable pcfile2.dat
assert_file_writable pcfile3.big
assert_file_writable pcfile4.big
git push -u origin master
# now lock files, then edit
git lfs lock pcfile1.dat
git lfs lock pcfile2.dat
echo "Take a look" > pcfile1.dat
echo "and you'll see" > pcfile2.dat
git add pcfile1.dat pcfile2.dat
git commit -m "Updated"
# files should remain writeable since locked
assert_file_writable pcfile1.dat
assert_file_writable pcfile2.dat
)
end_test