subdirectory tests: code cleanup, uncomment test

Back when these tests were written, we wanted to make sure that Git notices it is in a bare repository and "git show -s HEAD" would refrain from complaining that HEAD might mean a file it sees in its current working directory (because it does not). But the version of Git back then didn't behave well, without (doubly) being told that it is inside a bare repository by exporting "GIT_DIR=.". The form of the test we originally wanted to have was left commented out as a reminder. Nowadays the test as originally intended works, so add it to the test suite. We'll keep the old test that explicitly sets GIT_DIR=. to make sure that use case will not regress. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Beller committed May 18, 2015 at 14:10 UTC 66d2e04ec9856b5ef667f5241774749d079a5109
1 file changed +7 -4
t/t1020-subdirectory.sh
+7 -4
@@ -162,16 +162,20 @@ test_expect_success 'no file/rev ambiguity check inside .git' '
162 )
163 '
164
165 -test_expect_success 'no file/rev ambiguity check inside a bare repo' '
165 +test_expect_success 'no file/rev ambiguity check inside a bare repo (explicit GIT_DIR)' '
166 + test_when_finished "rm -fr foo.git" &&
167 git clone -s --bare .git foo.git &&
168 (
169 cd foo.git &&
170 + # older Git needed help by exporting GIT_DIR=.
171 + # to realize that it is inside a bare repository.
172 + # We keep this test around for regression testing.
173 GIT_DIR=. git show -s HEAD
174 )
175 '
176
173 -# This still does not work as it should...
174 -: test_expect_success 'no file/rev ambiguity check inside a bare repo' '
177 +test_expect_success 'no file/rev ambiguity check inside a bare repo' '
178 + test_when_finished "rm -fr foo.git" &&
179 git clone -s --bare .git foo.git &&
180 (
181 cd foo.git &&
@@ -180,7 +184,6 @@ test_expect_success 'no file/rev ambiguity check inside a bare repo' '
184 '
185
186 test_expect_success SYMLINKS 'detection should not be fooled by a symlink' '
183 - rm -fr foo.git &&
187 git clone -s .git another &&
188 ln -s another yetanother &&
189 (