Fix a seriously bad interaction between .git caching and repo cloning
authorYann Dirson <ydirson@altern.org>
Sun, 16 Apr 2006 10:52:39 +0000 (12:52 +0200)
committerCatalin Marinas <catalin.marinas@gmail.com>
Tue, 2 May 2006 20:30:45 +0000 (21:30 +0100)
Testcase 2 exhibits a problem with caching the location of .git while
cloning a repository.  Since basedir.get() is called before the clone is
built, a value may get stored in the cache if we are within a
git-controlled tree already.  Then when constructing the object for the
clone, a bogus .git is used, which can lead, when running tests in t/trash,
to corruption of the stgit .git repository.

Testcase 1 does not show any problem by chance, because since we have a
./.git prepared for use by the testsuite, value ".git" get cached, and it
happens that this value will be still valid after chdir'ing into the
newborn clone.

Clearing the cache at the appropriate place fixes the problem.

Signed-off-by: Yann Dirson <ydirson@altern.org>

No differences found