From bc23d69257f1d5e317e78087b7a2dd1cbe958b27 Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Wed, 2 Nov 2016 17:07:35 -0600 Subject: [PATCH] test: test staging a file using the filter process --- test/test-filter-process.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/test-filter-process.sh b/test/test-filter-process.sh index 3c79a7e1..d58d2bc1 100755 --- a/test/test-filter-process.sh +++ b/test/test-filter-process.sh @@ -75,3 +75,32 @@ begin_test "filter process: checking out a branch" popd ) end_test + +begin_test "filter process: adding a file" +( + set -e + + reponame="filter_process_add" + setup_remote_repo "$reponame" + clone_repo "$reponame" "$reponame" + + git config --local "filter.lfs.process" "git-lfs filter" + git config --local --unset "filter.lfs.clean" + git config --local --unset "filter.lfs.smudge" + + git lfs track "*.dat" + git add .gitattributes + git commit -m "initial commit" + + contents="contents" + contents_oid="$(calc_oid "$contents")" + printf "$contents" > a.dat + + git add a.dat + + expected="$(pointer "$contents_oid" "${#contents}")" + got="$(git cat-file -p :a.dat)" + + diff -u <(echo "$expected") <(echo "$got") +) +end_test