diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2017-05-03 17:16:49 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-26 12:33:55 +0900 |
commit | 11dc1fcb3fa53f5a46486daa7cb38ed387153f2e (patch) | |
tree | 98bf996bbac5e5c0b85ee1673a83d14a8ae0fbab /t | |
parent | config.mak.uname: set FREAD_READS_DIRECTORIES for Darwin, too (diff) | |
download | tgif-11dc1fcb3fa53f5a46486daa7cb38ed387153f2e.tar.xz |
wrapper.c: add and use warn_on_fopen_errors()
In many places, Git warns about an inaccessible file after a fopen()
failed. To discern these cases from other cases where we want to warn
about inaccessible files, introduce a new helper specifically to test
whether fopen() failed because the current user lacks the permission to
open file in question.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t1308-config-set.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh index 72d5f1f931..df92fdcd40 100755 --- a/t/t1308-config-set.sh +++ b/t/t1308-config-set.sh @@ -195,7 +195,8 @@ test_expect_success POSIXPERM,SANITY 'proper error on non-accessible files' ' chmod -r .git/config && test_when_finished "chmod +r .git/config" && echo "Error (-1) reading configuration file .git/config." >expect && - test_expect_code 2 test-config configset_get_value foo.bar .git/config 2>actual && + test_expect_code 2 test-config configset_get_value foo.bar .git/config 2>output && + grep "^Error" output >actual && test_cmp expect actual ' |