From 684e40f657ae004d60dfa833567bec4a409d78f9 Mon Sep 17 00:00:00 2001 From: Huynh Khoi Nguyen Nguyen Date: Fri, 22 Jun 2012 11:03:25 +0200 Subject: Let core.attributesfile default to $XDG_CONFIG_HOME/git/attributes This gives the default value for the core.attributesfile variable following the exact same logic of the previous change for the core.excludesfile setting. Signed-off-by: Huynh Khoi Nguyen Nguyen Signed-off-by: Valentin Duperray Signed-off-by: Franck Jonas Signed-off-by: Lucien Kong Signed-off-by: Thomas Nguy Signed-off-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t1306-xdg-files.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 't') diff --git a/t/t1306-xdg-files.sh b/t/t1306-xdg-files.sh index 05103f54ad..e8cd78a48d 100755 --- a/t/t1306-xdg-files.sh +++ b/t/t1306-xdg-files.sh @@ -96,4 +96,33 @@ test_expect_success 'Exclusion in a non-XDG global ignore file' ' ' +test_expect_success 'Checking attributes in the XDG attributes file' ' + echo foo >f && + git check-attr -a f >actual && + test_line_count -eq 0 actual && + echo "f attr_f" >"$HOME"/.config/git/attributes && + echo "f: attr_f: set" >expected && + git check-attr -a f >actual && + test_cmp expected actual +' + + +test_expect_success 'Checking attributes in both XDG and local attributes files' ' + echo "f -attr_f" >.gitattributes && + echo "f: attr_f: unset" >expected && + git check-attr -a f >actual && + test_cmp expected actual +' + + +test_expect_success 'Checking attributes in a non-XDG global attributes file' ' + test_might_fail rm .gitattributes && + echo "f attr_f=test" >"$HOME"/my_gitattributes && + git config core.attributesfile "$HOME"/my_gitattributes && + echo "f: attr_f: test" >expected && + git check-attr -a f >actual && + test_cmp expected actual +' + + test_done -- cgit v1.2.3