@@ -195,7 +195,8 @@ public static class WriterImpl<S extends WriterState>
195195 implements Writer <GitRevision > {
196196
197197 final boolean skipPush ;
198- private final String repoUrl ;
198+ private final String fetchRepoUrl ;
199+ private final String pushRepoUrl ;
199200 private final String remoteFetch ;
200201 private final String remotePush ;
201202 @ Nullable private final String tagNameTemplate ;
@@ -218,18 +219,34 @@ public static class WriterImpl<S extends WriterState>
218219 private final int visitChangePageSize ;
219220 private final boolean gitTagOverwrite ;
220221
222+ @ Deprecated
223+ WriterImpl (boolean skipPush , String repoUrl , String remoteFetch ,
224+ String remotePush , String tagNameTemplate , String tagMsgTemplate ,
225+ GeneralOptions generalOptions , WriteHook writeHook , S state ,
226+ boolean nonFastForwardPush , Iterable <GitIntegrateChanges > integrates ,
227+ boolean lastRevFirstParent , boolean ignoreIntegrationErrors , String localRepoPath ,
228+ String committerName , String committerEmail , boolean rebase , int visitChangePageSize ,
229+ boolean gitTagOverwrite ) {
230+ this (
231+ skipPush , repoUrl , repoUrl , remoteFetch , remotePush , tagNameTemplate , tagMsgTemplate ,
232+ generalOptions , writeHook , state , nonFastForwardPush , integrates , lastRevFirstParent ,
233+ ignoreIntegrationErrors , localRepoPath , committerName , committerEmail , rebase ,
234+ visitChangePageSize , gitTagOverwrite );
235+ }
236+
221237 /**
222238 * Create a new git.destination writer
223239 */
224- WriterImpl (boolean skipPush , String repoUrl , String remoteFetch ,
240+ WriterImpl (boolean skipPush , String fetchRepoUrl , String pushRepoUrl , String remoteFetch ,
225241 String remotePush , String tagNameTemplate , String tagMsgTemplate ,
226242 GeneralOptions generalOptions , WriteHook writeHook , S state ,
227243 boolean nonFastForwardPush , Iterable <GitIntegrateChanges > integrates ,
228244 boolean lastRevFirstParent , boolean ignoreIntegrationErrors , String localRepoPath ,
229245 String committerName , String committerEmail , boolean rebase , int visitChangePageSize ,
230246 boolean gitTagOverwrite ) {
231247 this .skipPush = skipPush ;
232- this .repoUrl = checkNotNull (repoUrl );
248+ this .fetchRepoUrl = checkNotNull (fetchRepoUrl );
249+ this .pushRepoUrl = checkNotNull (pushRepoUrl );
233250 this .remoteFetch = checkNotNull (remoteFetch );
234251 this .remotePush = checkNotNull (remotePush );
235252 this .tagNameTemplate = tagNameTemplate ;
@@ -284,7 +301,7 @@ public void visitChanges(@Nullable GitRevision start, ChangesVisitor visitor)
284301 private void fetchIfNeeded (GitRepository repo , Console console )
285302 throws RepoException , ValidationException {
286303 if (!state .alreadyFetched ) {
287- GitRevision revision = fetchFromRemote (console , repo , repoUrl , remoteFetch );
304+ GitRevision revision = fetchFromRemote (console , repo , fetchRepoUrl , remoteFetch );
288305 if (revision != null ) {
289306 repo .simpleCommand ("branch" , state .localBranch , revision .getSha1 ());
290307 }
@@ -344,7 +361,7 @@ private GitRevision getLocalBranchRevision(GitRepository gitRepository) throws R
344361 return null ;
345362 }
346363 throw new RepoException (String .format ("Could not find %s in %s and '%s' was not used" ,
347- remoteFetch , repoUrl , GeneralOptions .FORCE ));
364+ remoteFetch , fetchRepoUrl , GeneralOptions .FORCE ));
348365 }
349366 }
350367
@@ -436,7 +453,7 @@ public ImmutableList<DestinationEffect> write(TransformResult transformResult,
436453 Glob destinationFiles , Console console )
437454 throws ValidationException , RepoException , IOException {
438455 logger .atInfo ().log (
439- "Exporting from %s to: url=%s ref=%s" , transformResult .getPath (), repoUrl , remotePush );
456+ "Exporting from %s to: url=%s ref=%s" , transformResult .getPath (), pushRepoUrl , remotePush );
440457 String baseline = transformResult .getBaseline ();
441458
442459 GitRepository scratchClone = getRepository (console );
@@ -450,12 +467,12 @@ public ImmutableList<DestinationEffect> write(TransformResult transformResult,
450467
451468 if (state .firstWrite ) {
452469 String reference = baseline != null ? baseline : state .localBranch ;
453- configForPush (getRepository (console ), repoUrl , remotePush );
470+ configForPush (getRepository (console ), pushRepoUrl , remotePush );
454471 if (!force && localBranchRevision == null ) {
455472 throw new RepoException (String .format (
456473 "Cannot checkout '%s' from '%s'. Use '%s' if the destination is a new git repo or"
457474 + " you don't care about the destination current status" , reference ,
458- repoUrl ,
475+ pushRepoUrl ,
459476 GeneralOptions .FORCE ));
460477 }
461478 if (localBranchRevision != null ) {
@@ -468,7 +485,7 @@ public ImmutableList<DestinationEffect> write(TransformResult transformResult,
468485 } else if (!skipPush ) {
469486 // Should be a no-op, but an iterative migration could take several minutes between
470487 // migrations so lets fetch the latest first.
471- fetchFromRemote (console , scratchClone , repoUrl , remoteFetch );
488+ fetchFromRemote (console , scratchClone , fetchRepoUrl , remoteFetch );
472489 }
473490
474491 PathMatcher pathMatcher = destinationFiles .relativeTo (scratchClone .getWorkTree ());
@@ -505,7 +522,7 @@ public ImmutableList<DestinationEffect> write(TransformResult transformResult,
505522 commitMessage );
506523
507524 // Don't remove. Used internally in test
508- console .verboseFmt ("Integrates for %s: %s" , repoUrl , Iterables .size (integrates ));
525+ console .verboseFmt ("Integrates for %s: %s" , pushRepoUrl , Iterables .size (integrates ));
509526
510527 for (GitIntegrateChanges integrate : integrates ) {
511528 integrate .run (alternate , generalOptions , messageInfo ,
@@ -562,7 +579,7 @@ public ImmutableList<DestinationEffect> write(TransformResult transformResult,
562579 console .info (DiffUtil .colorize (
563580 console , scratchClone .simpleCommand ("show" , "HEAD" ).getStdout ()));
564581 if (!console .promptConfirmation (
565- String .format ("Proceed with push to %s %s?" , repoUrl , remotePush ))) {
582+ String .format ("Proceed with push to %s %s?" , pushRepoUrl , remotePush ))) {
566583 console .warn ("Migration aborted by user." );
567584 throw new ChangeRejectedException (
568585 "User aborted execution: did not confirm diff changes." );
@@ -588,15 +605,15 @@ public ImmutableList<DestinationEffect> write(TransformResult transformResult,
588605 new DestinationEffect .DestinationRef (head .getSha1 (), "commit" , /*url=*/ null )));
589606 }
590607 String push = writeHook .getPushReference (getCompleteRef (remotePush ), transformResult );
591- console .progress (String .format ("Git Destination: Pushing to %s %s" , repoUrl , push ));
608+ console .progress (String .format ("Git Destination: Pushing to %s %s" , pushRepoUrl , push ));
592609 checkCondition (!nonFastForwardPush
593610 || !Objects .equals (remoteFetch , remotePush ), "non fast-forward push is only"
594611 + " allowed when fetch != push" );
595612
596613 String serverResponse = generalOptions .repoTask (
597614 "push" ,
598615 () -> scratchClone .push ()
599- .withRefspecs (repoUrl ,
616+ .withRefspecs (pushRepoUrl ,
600617 tagName != null
601618 ? ImmutableList .of (scratchClone .createRefSpec (
602619 (nonFastForwardPush ? "+" : "" ) + "HEAD:" + push ),
@@ -665,7 +682,7 @@ private void updateLocalBranchToBaseline(GitRepository repo, String baseline)
665682 + (getLocalBranchRevision (repo ) != null
666683 ? "' from fetch reference '" + remoteFetch + "'"
667684 : "' and fetch reference '" + remoteFetch + "' itself" )
668- + " in " + repoUrl + "." );
685+ + " in " + fetchRepoUrl + "." );
669686 } else if (baseline != null ) {
670687 // Update the local branch to use the baseline
671688 repo .simpleCommand ("update-ref" , state .localBranch , baseline );
0 commit comments