diff options
author | Stefan Beller <sbeller@google.com> | 2015-05-18 14:10:26 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-05-18 15:22:49 -0700 |
commit | 66d2e04ec9856b5ef667f5241774749d079a5109 (patch) | |
tree | e2608ca7345308c0db20c0174c8159fa33d23b4b /t/t1020-subdirectory.sh | |
parent | 282616c72d1d08a77ca4fe1186cb708c38408d87 (diff) | |
download | git-66d2e04ec9856b5ef667f5241774749d079a5109.tar.gz |
subdirectory tests: code cleanup, uncomment testsb/t1020-cleanup
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>
Diffstat (limited to 't/t1020-subdirectory.sh')
-rwxr-xr-x | t/t1020-subdirectory.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh index 6902320e81..d1e5bb3d80 100755 --- a/t/t1020-subdirectory.sh +++ b/t/t1020-subdirectory.sh @@ -162,16 +162,20 @@ test_expect_success 'no file/rev ambiguity check inside .git' ' ) ' -test_expect_success 'no file/rev ambiguity check inside a bare repo' ' +test_expect_success 'no file/rev ambiguity check inside a bare repo (explicit GIT_DIR)' ' + test_when_finished "rm -fr foo.git" && git clone -s --bare .git foo.git && ( cd foo.git && + # older Git needed help by exporting GIT_DIR=. + # to realize that it is inside a bare repository. + # We keep this test around for regression testing. GIT_DIR=. git show -s HEAD ) ' -# This still does not work as it should... -: test_expect_success 'no file/rev ambiguity check inside a bare repo' ' +test_expect_success 'no file/rev ambiguity check inside a bare repo' ' + test_when_finished "rm -fr foo.git" && git clone -s --bare .git foo.git && ( cd foo.git && @@ -180,7 +184,6 @@ test_expect_success 'no file/rev ambiguity check inside a bare repo' ' ' test_expect_success SYMLINKS 'detection should not be fooled by a symlink' ' - rm -fr foo.git && git clone -s .git another && ln -s another yetanother && ( |