Преглед на файлове

Tweak the handling of remote url in jgit repo.

This kind of reverted 31148. URI.resolve actually can handle the absolute URL
well, the problem is only the missing "/".

Change-Id: Iee5866c005cbc1430dc20ee7db321b8b51afed30
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
tags/v3.5.0.201409071800-rc1
Yuxuan 'fishy' Wang преди 9 години
родител
ревизия
38a24bc799
променени са 1 файла, в които са добавени 6 реда и са изтрити 11 реда
  1. 6
    11
      org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java

+ 6
- 11
org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java Целия файл

@@ -418,24 +418,19 @@ public class RepoCommand extends GitCommand<RevCommit> {
else
throw new SAXException(RepoText.get().errorNoDefault);
}
final String remoteUrl;
String remoteUrl;
try {
URI uri = new URI(remotes.get(defaultRemote));
if (uri.getHost() != null) {
// This is not relative path, no need for baseUrl.
remoteUrl = uri.toString();
} else {
uri = new URI(baseUrl);
remoteUrl = uri.resolve(
remotes.get(defaultRemote)).toString();
}
URI uri = new URI(baseUrl);
remoteUrl = uri.resolve(remotes.get(defaultRemote)).toString();
if (!remoteUrl.endsWith("/"))
remoteUrl = remoteUrl + "/";
} catch (URISyntaxException e) {
throw new SAXException(e);
}
removeNotInGroup();
removeOverlaps();
for (Project proj : projects) {
command.addSubmodule(remoteUrl + "/" + proj.name,
command.addSubmodule(remoteUrl + proj.name,
proj.path,
proj.revision == null
? defaultRevision : proj.revision,

Loading…
Отказ
Запис