Can't handle when Git Fetch and Push URL are different

Hello,

Because of a large repo size, I cloned a Git repo with a closet read-only Git mirror say "http://git-mirror-readonly.xx.com" and then use "git remote set-url origin http://git-master.xx.com".

Somehow when Eclipse TC Remote run has successfully, it will push to my first "fetch" URL rather than my PUSH url. I investigate the related code and found below wrong reference does the tricky, any plan to fix it? 

Class: jetbrains.teamcity.vcs.git.CompletePushStrategy

Method: push(@NotNull final ObjectId commitId, final IProgressMonitor monitor)

Error Log:

org.eclipse.jgit.errors.TransportException: http://git-mirror-readonly.xx.com/abc.git: 401 Unauthorized

at org.eclipse.jgit.transport.TransportHttp$Service.openResponse(TransportHttp.java:942)

at org.eclipse.jgit.transport.TransportHttp$MultiRequestService.execute(TransportHttp.java:1043)

at org.eclipse.jgit.transport.TransportHttp$Service$HttpExecuteStream.read(TransportHttp.java:969)

at org.eclipse.jgit.util.io.UnionInputStream.read(UnionInputStream.java:145)

at org.eclipse.jgit.util.IO.readFully(IO.java:247)

at org.eclipse.jgit.transport.PacketLineIn.readLength(PacketLineIn.java:212)

at org.eclipse.jgit.transport.SideBandInputStream.needDataPacket(SideBandInputStream.java:154)

at org.eclipse.jgit.transport.SideBandInputStream.read(SideBandInputStream.java:136)

at org.eclipse.jgit.util.IO.readFully(IO.java:247)

at org.eclipse.jgit.transport.PacketLineIn.readLength(PacketLineIn.java:212)

at org.eclipse.jgit.transport.PacketLineIn.readString(PacketLineIn.java:142)

at org.eclipse.jgit.transport.BasePackPushConnection.readStringLongTimeout(BasePackPushConnection.java:420)

at org.eclipse.jgit.transport.BasePackPushConnection.readStatusReport(BasePackPushConnection.java:367)

at org.eclipse.jgit.transport.BasePackPushConnection.doPush(BasePackPushConnection.java:219)

at org.eclipse.jgit.transport.TransportHttp$SmartHttpPushConnection.doPush(TransportHttp.java:870)

at org.eclipse.jgit.transport.BasePackPushConnection.push(BasePackPushConnection.java:168)

at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:172)

at org.eclipse.jgit.transport.Transport.push(Transport.java:1275)

at org.eclipse.jgit.transport.Transport.push(Transport.java:1321)

at jetbrains.teamcity.vcs.git.CompletePushStrategy.push(CompletePushStrategy.java:160)

at jetbrains.teamcity.vcs.git.CompletePushStrategy.push(CompletePushStrategy.java:169)

at jetbrains.teamcity.vcs.git.GitTeamProvider.commit(GitTeamProvider.java:545)

at jetbrains.teamcity.vcs.git.GitSubscriber.doDelayedCommit(GitSubscriber.java:452)

at jetbrains.teamcity.vcs.TCWorkspaceRemoteRunProvider.doCommit(TCWorkspaceRemoteRunProvider.java:216)

at jetbrains.teamcity.core.jobs.DelayedCommitJob.doCommit(DelayedCommitJob.java:134)

at jetbrains.teamcity.core.jobs.DelayedCommitJob.access$0(DelayedCommitJob.java:130)

at jetbrains.teamcity.core.jobs.DelayedCommitJob$1.run(DelayedCommitJob.java:82)

at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)

at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2262)

at jetbrains.teamcity.core.jobs.DelayedCommitJob.run(DelayedCommitJob.java:76)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

 

Thanks,

Tim

Please sign in to leave a comment.