@@ -220,14 +220,23 @@ public void startMigration(final long migrationId, final boolean retry) {
220
220
}
221
221
222
222
// 4. Git push master based on SVN trunk
223
- if (migration .getTrunk () != null && migration . getTrunk (). equals ( "*" ) ) {
224
- history = historyMgr .startStep (migration , StepEnum .GIT_PUSH , "SVN trunk -> GitLab master" );
223
+ if (migration .getTrunk () != null ) {
224
+ history = historyMgr .startStep (migration , StepEnum .GIT_PUSH , format ( "SVN %s -> GitLab master" , migration . getTrunk ()) );
225
225
226
226
// Set origin
227
227
execCommand (commandManager , workUnit .directory ,
228
228
gitManager .buildRemoteCommand (workUnit , svn , false ),
229
229
gitManager .buildRemoteCommand (workUnit , svn , true ));
230
230
231
+ if (!migration .getTrunk ().equals ("trunk" )) {
232
+ gitCommand = format ("git checkout -b %s %s" , migration .getTrunk (), "refs/remotes/origin/" + migration .getTrunk ());
233
+ execCommand (workUnit .commandManager , workUnit .directory , gitCommand );
234
+ gitCommand = format ("git branch -D master" );
235
+ execCommand (workUnit .commandManager , workUnit .directory , gitCommand );
236
+ gitCommand = format ("git branch -m master" );
237
+ execCommand (workUnit .commandManager , workUnit .directory , gitCommand );
238
+ }
239
+
231
240
// if no history option set
232
241
if (migration .getSvnHistory ().equals ("nothing" )) {
233
242
gitManager .removeHistory (workUnit , MASTER , false , history );
@@ -246,8 +255,8 @@ public void startMigration(final long migrationId, final boolean retry) {
246
255
boolean warning = gitManager .applyMapping (workUnit , MASTER );
247
256
workUnit .warnings .set (workUnit .warnings .get () || warning );
248
257
} else {
249
- history = historyMgr .startStep (migration , StepEnum .GIT_PUSH , "Trunk" );
250
- historyMgr .endStep (history , StatusEnum .IGNORED , "Skip trunk" );
258
+ history = historyMgr .startStep (migration , StepEnum .GIT_PUSH , migration . getTrunk () );
259
+ historyMgr .endStep (history , StatusEnum .IGNORED , format ( "Skip %s" , migration . getTrunk ()) );
251
260
}
252
261
253
262
// 6. List branches & tags
@@ -308,7 +317,7 @@ public void startMigration(final long migrationId, final boolean retry) {
308
317
}
309
318
310
319
} else {
311
- history = historyMgr .startStep (migration , StepEnum .GIT_PUSH , "Trunk , Tags, Branches" );
320
+ history = historyMgr .startStep (migration , StepEnum .GIT_PUSH , format ( "%s , Tags, Branches", migration . getTrunk ()) );
312
321
historyMgr .endStep (history , StatusEnum .IGNORED , "Skipping Migration : No Files Available. No Push to Gitlab" );
313
322
}
314
323
0 commit comments