@@ -122,6 +122,7 @@ public SysMLRepositoryLoadUtil(String repositoryURL, String project, String bran
122122 }
123123
124124 public void load () throws UnsupportedOperationException , ApiException {
125+
125126 ProjectRepository projectRepository = new ProjectRepository (repositoryURL );
126127 RemoteProject repositoryProject = isReferencedById ? projectRepository .getProjectById (project ):
127128 projectRepository .getProjectByName (project );
@@ -137,21 +138,24 @@ public void load() throws UnsupportedOperationException, ApiException {
137138 } else {
138139 branch = repositoryProject .getBranch (branchName );
139140 }
140- Revision headRevision = branch .getHeadRevision ();
141- APIModel remote = headRevision .fetchRemote ();
142141
143- System .out .println ("Reading library..." );
142+ if (branch == null ) {
143+ System .err .println ("Branch does not exist." );
144+ return ;
145+ }
144146
147+ System .out .println ("Reading library..." );
145148 readAll (localLibraryPath , false );
146149
147150 //collect ids from library
148151 System .out .println ("Tracking library UUIDs..." );
149152 EObjectUUIDTracker tracker = new EObjectUUIDTracker ();
150153 tracker .trackLibraryUUIDs (getLibraryResources ());
151154
152-
155+ System .out .println ("Downloading project..." );
156+ Revision headRevision = branch .getHeadRevision ();
157+ APIModel remote = headRevision .fetchRemote ();
153158 EMFModelRefresher modelRefresher = new EMFModelRefresher (remote , tracker );
154- System .out .println ("Fetching project..." );
155159 EMFModelDelta delta = modelRefresher .create ();
156160 modelRefresher .getIssues ().forEach (System .out ::println );
157161 ResourceSet resourceSet = getResourceSet ();
0 commit comments