summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-02-28 13:25:57 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-02-28 13:25:57 -0800
commit524ee675a36961c5b59302e84ffd08808f4f787e (patch)
treed64fc7d9b88c9be517e87fdf82f8a3fb31ee5f01 /t
parentMerge branch 'maint' (diff)
parentAdd a setting to require a filter to be successful (diff)
downloadtgif-524ee675a36961c5b59302e84ffd08808f4f787e.tar.xz
Merge branch 'jb/required-filter'
* jb/required-filter: Add a setting to require a filter to be successful Conflicts: convert.c
Diffstat (limited to 't')
-rwxr-xr-xt/t0021-conversion.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index f19e6510d0..e50f0f742f 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -153,4 +153,41 @@ test_expect_success 'filter shell-escaped filenames' '
:
'
+test_expect_success 'required filter success' '
+ git config filter.required.smudge cat &&
+ git config filter.required.clean cat &&
+ git config filter.required.required true &&
+
+ echo "*.r filter=required" >.gitattributes &&
+
+ echo test >test.r &&
+ git add test.r &&
+ rm -f test.r &&
+ git checkout -- test.r
+'
+
+test_expect_success 'required filter smudge failure' '
+ git config filter.failsmudge.smudge false &&
+ git config filter.failsmudge.clean cat &&
+ git config filter.failsmudge.required true &&
+
+ echo "*.fs filter=failsmudge" >.gitattributes &&
+
+ echo test >test.fs &&
+ git add test.fs &&
+ rm -f test.fs &&
+ test_must_fail git checkout -- test.fs
+'
+
+test_expect_success 'required filter clean failure' '
+ git config filter.failclean.smudge cat &&
+ git config filter.failclean.clean false &&
+ git config filter.failclean.required true &&
+
+ echo "*.fc filter=failclean" >.gitattributes &&
+
+ echo test >test.fc &&
+ test_must_fail git add test.fc
+'
+
test_done