From: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
To: Jonas Fonseca <fonseca@diku.dk>
Cc: "Shawn O. Pearce" <spearce@spearce.org>, git@vger.kernel.org
Subject: Re: [PATCH JGIT] Ensure created test repositories use canonical paths
Date: Fri, 21 Aug 2009 00:35:10 +0200 [thread overview]
Message-ID: <200908210035.10825.robin.rosenberg.lists@dewire.com> (raw)
In-Reply-To: <1250687891-17916-1-git-send-email-fonseca@diku.dk>
onsdag 19 augusti 2009 15:18:11 skrev Jonas Fonseca <fonseca@diku.dk>:
> 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();
We use getCanonicalFile here and Repository.gitDir is initialized with getAbsoluteDir. Does this work on all platforms?
Seems linux normalized things when you do things like, but I'm not sure that happens everywhere.
ln -s JGIT x;cd x;pwd;jev 'System.out.println(System.getProperty("user.dir"));'
/home/me/SW/x
/home/me/SW/JGIT
-- robin
next prev parent reply other threads:[~2009-08-20 22:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-19 13:18 [PATCH JGIT] Ensure created test repositories use canonical paths Jonas Fonseca
2009-08-20 22:35 ` Robin Rosenberg [this message]
2009-08-22 3:32 ` Jonas Fonseca
2009-08-22 10:15 ` Robin Rosenberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200908210035.10825.robin.rosenberg.lists@dewire.com \
--to=robin.rosenberg.lists@dewire.com \
--cc=fonseca@diku.dk \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).