From bc5a68910221b135d3d9cac179df3e956aa79743 Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Mon, 28 Aug 2017 17:57:17 -0400 Subject: [PATCH] test: add an integration test for git-lfs-post-commit --- test/test-post-commit.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/test-post-commit.sh b/test/test-post-commit.sh index 9300499f..ba489e1f 100755 --- a/test/test-post-commit.sh +++ b/test/test-post-commit.sh @@ -48,3 +48,29 @@ begin_test "post-commit" ) end_test + +begin_test "post-commit (locked file outside of LFS)" +( + set -e + + reponame="post-commit-external" + setup_remote_repo "$reponame" + clone_repo "$reponame" "$reponame" + + git lfs install + + # This step is intentionally done in two commits, due to a known bug bug in + # the post-checkout process LFS performs. It compares changed files from HEAD, + # which is an invalid previous state for the initial commit of a repository. + echo "*.dat lockable" > .gitattributes + git add .gitattributes + git commit -m "initial commit" + + echo "hello" > a.dat + git add a.dat + assert_file_writeable a.dat + git commit -m "add a.dat" + + refute_file_writeable a.dat +) +end_test