]> source.dussan.org Git - jgit.git/commitdiff
Handles repo manifest file without default remote. 44/32444/1
authorYuxuan 'fishy' Wang <fishywang@google.com>
Wed, 27 Aug 2014 23:28:43 +0000 (16:28 -0700)
committerYuxuan 'fishy' Wang <fishywang@google.com>
Wed, 27 Aug 2014 23:29:19 +0000 (16:29 -0700)
Change-Id: Ic45919a0b695e8a6f4ed47cc060e0c41f1d7e7ea
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java

index 6ff39a49e5a27935a4d572376a167c9842d00ccd..ca154961632781c84fef881cb7a2dbc41fa1fbfc 100644 (file)
@@ -473,14 +473,8 @@ public class RepoCommand extends GitCommand<RevCommit> {
                        xmlInRead--;
                        if (xmlInRead != 0)
                                return;
+
                        // Only do the following after we finished reading everything.
-                       if (defaultRemote == null) {
-                               if (filename != null)
-                                       throw new SAXException(MessageFormat.format(
-                                                       RepoText.get().errorNoDefaultFilename, filename));
-                               else
-                                       throw new SAXException(RepoText.get().errorNoDefault);
-                       }
                        removeNotInGroup();
                        removeOverlaps();
 
@@ -493,8 +487,18 @@ public class RepoCommand extends GitCommand<RevCommit> {
                        }
                        for (Project proj : projects) {
                                String remote = proj.remote;
-                               if (remote == null)
+                               if (remote == null) {
+                                       if (defaultRemote == null) {
+                                               if (filename != null)
+                                                       throw new SAXException(MessageFormat.format(
+                                                                       RepoText.get().errorNoDefaultFilename,
+                                                                       filename));
+                                               else
+                                                       throw new SAXException(
+                                                                       RepoText.get().errorNoDefault);
+                                       }
                                        remote = defaultRemote;
+                               }
                                String remoteUrl = remoteUrls.get(remote);
                                if (remoteUrl == null) {
                                        remoteUrl = baseUri.resolve(remotes.get(remote)).toString();