From: Jonathan Nieder Date: Thu, 21 Oct 2010 16:47:08 GMT Subject: Re: [PATCH] config: treat non-existent config files as empty Message-ID: <20101021164708.GD3732@burratino> In-Reply-To: <20101021144544.GA18901@sigill.intra.peff.net> Jeff King wrote: > 1. Does it still error on GIT_CONFIG=/nonexistent? I said then I > hadn't tested. I just did, and it does still produce an error. Maybe it would make sense to squash in something like this, then. Signed-off-by: Jonathan Nieder --- diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index c703257..d0e5546 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -844,6 +844,27 @@ test_expect_success SYMLINKS 'symlinked configuration' ' ' +test_expect_success 'nonexistent configuration' ' + ( + GIT_CONFIG=doesnotexist && + export GIT_CONFIG && + test_must_fail git config --list && + test_must_fail git config test.xyzzy + ) +' + +test_expect_success SYMLINKS 'symlink to nonexistent configuration' ' + ln -s doesnotexist linktonada && + ln -s linktonada linktolinktonada && + ( + GIT_CONFIG=linktonada && + export GIT_CONFIG && + test_must_fail git config --list && + GIT_CONFIG=linktolinktonada && + test_must_fail git config --list + ) +' + test_expect_success 'check split_cmdline return' " git config alias.split-cmdline-fix 'echo \"' && test_must_fail git split-cmdline-fix &&