From c0b13b21b8daa4bfb222e9c4d335c8b340c511a0 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Thu, 4 Aug 2011 06:36:14 +0200 Subject: Disallow the empty string as an attribute name Previously, it was possible to have a line like "file.txt =foo" in a .gitattribute file, after which an invocation like "git check-attr '' -- file.txt" would succeed. This patch disallows both constructs. Please note that any existing .gitattributes file that tries to set an empty attribute will now trigger the error message "error: : not a valid attribute name" whereas previously the nonsense was allowed through. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- t/t0003-attributes.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 't') diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index ebbc7554a7..8c76b79bb0 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -42,6 +42,12 @@ test_expect_success 'setup' ' ' +test_expect_success 'command line checks' ' + + test_must_fail git check-attr "" -- f + +' + test_expect_success 'attribute test' ' attr_check f f && -- cgit v1.2.1