From: Jonas Fonseca <fonseca@diku.dk>
To: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
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 23:32:59 -0400 [thread overview]
Message-ID: <2c6b72b30908212032t39a4896x3308148c44692a80@mail.gmail.com> (raw)
In-Reply-To: <200908210035.10825.robin.rosenberg.lists@dewire.com>
[With correct CC list. Sorry for the resend Robin]
On Thu, Aug 20, 2009 at 18:35, Robin
Rosenberg<robin.rosenberg.lists@dewire.com> wrote:
> 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
>> [...]
>> @@ -217,7 +217,7 @@ public void setUp() throws Exception {
>> trash = new File(trashParent,"trash"+System.currentTimeMillis()+"."+(testcount++));
>> - trash_git = new File(trash, ".git");
>> + trash_git = new File(trash, ".git").getCanonicalFile();
>> @@ -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();
>
> We use getCanonicalFile here and Repository.gitDir is initialized with getAbsoluteDir.
BTW, a simpler fix would be to initialize trashParent to a canonical
path, which might be less intrusive.
> Does this work on all platforms?
I have only tested on Linux.
> Seems linux normalized things when you do things like, but I'm not sure that happens everywhere.
If you think it is a problem, let's drop the patch. It just seemed
like a simple way to increase robustness.
--
Jonas Fonseca
next prev parent reply other threads:[~2009-08-22 3:33 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
2009-08-22 3:32 ` Jonas Fonseca [this message]
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=2c6b72b30908212032t39a4896x3308148c44692a80@mail.gmail.com \
--to=fonseca@diku.dk \
--cc=git@vger.kernel.org \
--cc=robin.rosenberg.lists@dewire.com \
--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).