git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH JGIT] Ensure created test repositories use canonical paths
@ 2009-08-19 13:18 Jonas Fonseca
  2009-08-20 22:35 ` Robin Rosenberg
  0 siblings, 1 reply; 4+ messages in thread
From: Jonas Fonseca @ 2009-08-19 13:18 UTC (permalink / raw)
  To: Robin Rosenberg, Shawn O. Pearce; +Cc: git

Fixes breakage in the RepositoryCacheTest when running tests using:

	mvn -f ./jgit-maven/jgit/pom.xml test

which in turn will lead to test repositories using paths, such as:

	/path/to/jgit/./jgit-maven/jgit/trash/trash1250647279819.186/.git

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
 .../org/spearce/jgit/lib/RepositoryTestCase.java   |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java
index b1adde9..d1aef78 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java
@@ -217,7 +217,7 @@ public void setUp() throws Exception {
 		final String name = getClass().getName() + "." + getName();
 		recursiveDelete(trashParent, true, name, false); // Cleanup old failed stuff
 		trash = new File(trashParent,"trash"+System.currentTimeMillis()+"."+(testcount++));
-		trash_git = new File(trash, ".git");
+		trash_git = new File(trash, ".git").getCanonicalFile();
 		if (shutdownhook == null) {
 			shutdownhook = new Thread() {
 				@Override
@@ -307,7 +307,7 @@ protected Repository createNewEmptyRepo() throws IOException {
 	protected Repository createNewEmptyRepo(boolean bare) throws IOException {
 		final File newTestRepo = new File(trashParent, "new"
 				+ System.currentTimeMillis() + "." + (testcount++)
-				+ (bare ? "" : "/") + ".git");
+				+ (bare ? "" : "/") + ".git").getCanonicalFile();
 		assertFalse(newTestRepo.exists());
 		final Repository newRepo = new Repository(newTestRepo);
 		newRepo.create();
-- 
1.6.4.rc3.195.g2b05f

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-22 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-19 13:18 [PATCH JGIT] Ensure created test repositories use canonical paths Jonas Fonseca
2009-08-20 22:35 ` Robin Rosenberg
2009-08-22  3:32   ` Jonas Fonseca
2009-08-22 10:15     ` Robin Rosenberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).