test/lock: test the git lfs lock
command
This commit is contained in:
parent
4b172af5f7
commit
c78356173c
33
test/test-lock.sh
Executable file
33
test/test-lock.sh
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
. "test/testlib.sh"
|
||||||
|
|
||||||
|
begin_test "creating a lock"
|
||||||
|
(
|
||||||
|
set -e
|
||||||
|
|
||||||
|
setup_remote_repo_with_file "lock_create_simple" "a.dat"
|
||||||
|
|
||||||
|
git lfs lock "a.dat" | tee lock.log
|
||||||
|
grep "'a.dat' was locked" lock.log
|
||||||
|
|
||||||
|
id=$(grep -oh "\((.*)\)" lock.log | tr -d "()")
|
||||||
|
assert_server_lock $id
|
||||||
|
)
|
||||||
|
end_test
|
||||||
|
|
||||||
|
begin_test "locking a previously locked file"
|
||||||
|
(
|
||||||
|
set -e
|
||||||
|
|
||||||
|
setup_remote_repo_with_file "lock_create_previously_created" "a.dat"
|
||||||
|
|
||||||
|
git lfs lock "a.dat" | tee lock.log
|
||||||
|
grep "'a.dat' was locked" lock.log
|
||||||
|
|
||||||
|
id=$(grep -oh "\((.*)\)" lock.log | tr -d "()")
|
||||||
|
assert_server_lock $id
|
||||||
|
|
||||||
|
grep "lock already created" <(git lfs lock "a.dat" 2>&1)
|
||||||
|
)
|
||||||
|
end_test
|
Loading…
Reference in New Issue
Block a user