diff options
author | Robin Stocker <robin@nibor.org> | 2012-07-27 11:53:51 +0200 |
---|---|---|
committer | Robin Stocker <robin@nibor.org> | 2012-07-27 12:05:13 +0200 |
commit | beee7b86afd5d4e1e9185c1f81640b83d74398f3 (patch) | |
tree | 0c9299f4a1bc6c8f857c50e24e1ef9f0a3c063dd /org.eclipse.jgit/src | |
parent | d47403ea941e38377425fe55c71c43a45ceef8ca (diff) | |
download | jgit-beee7b86afd5d4e1e9185c1f81640b83d74398f3.tar.gz jgit-beee7b86afd5d4e1e9185c1f81640b83d74398f3.zip |
Fix resolving of relative file URIs in TransportLocal
A configured remote url like "../repo" works with C Git.
In JGit, it only worked if Java's current working directory happened to
be the local repository working directory.
Change-Id: I33ba3f81b37d03cf17ca7ae25a90774a27e7e02b
Signed-off-by: Robin Stocker <robin@nibor.org>
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java index 8be940d9d0..5a23ae18d8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java @@ -118,10 +118,10 @@ class TransportLocal extends Transport implements PackTransport { @Override public Transport open(URIish uri, Repository local, String remoteName) throws NoRemoteRepositoryException { + File localPath = local.isBare() ? local.getDirectory() : local.getWorkTree(); + File path = local.getFS().resolve(localPath, uri.getPath()); // If the reference is to a local file, C Git behavior says // assume this is a bundle, since repositories are directories. - // - File path = local.getFS().resolve(new File("."), uri.getPath()); if (path.isFile()) return new TransportBundleFile(local, uri, path); |