Repository () { Repository result; if (myTarget.isUrl()) { // TODO: Also could still execute info when target is url - either to use info for authentication or to just get correct repository // TODO: url in case of "read" operations are allowed anonymously. result = new Repository(myTarget.getUrl()); } else { Info info = myVcs.getInfo(myTarget.getFile()); result = info != null ? new Repository(info.getRepositoryRootUrl()) : null; } return result; }