diff --git a/src/GitTfs/Core/DerivedGitTfsRemote.cs b/src/GitTfs/Core/DerivedGitTfsRemote.cs index 7dd0d3fd..25d4e42a 100644 --- a/src/GitTfs/Core/DerivedGitTfsRemote.cs +++ b/src/GitTfs/Core/DerivedGitTfsRemote.cs @@ -74,7 +74,6 @@ namespace GitTfs.Core public string TfsRepositoryPath { get { return _tfsRepositoryPath; } - set { throw DerivedRemoteException; } } public string[] TfsSubtreePaths diff --git a/src/GitTfs/Core/GitTfsRemote.cs b/src/GitTfs/Core/GitTfsRemote.cs index 289a728d..0c997a10 100644 --- a/src/GitTfs/Core/GitTfsRemote.cs +++ b/src/GitTfs/Core/GitTfsRemote.cs @@ -133,7 +133,7 @@ namespace GitTfs.Core set { Tfs.Password = value; } } - public string TfsRepositoryPath { get; set; } + public string TfsRepositoryPath { get; } /// /// Gets the TFS server-side paths of all subtrees of this remote. diff --git a/src/GitTfs/Core/IGitTfsRemote.cs b/src/GitTfs/Core/IGitTfsRemote.cs index 2ec37cd9..a7b4380b 100644 --- a/src/GitTfs/Core/IGitTfsRemote.cs +++ b/src/GitTfs/Core/IGitTfsRemote.cs @@ -32,7 +32,7 @@ namespace GitTfs.Core RemoteInfo RemoteInfo { get; } string Id { get; } string TfsUrl { get; set; } - string TfsRepositoryPath { get; set; } + string TfsRepositoryPath { get; } /// /// Gets the TFS server-side paths of all subtrees of this remote. /// Valid if the remote has subtrees, which occurs when is null. diff --git a/src/GitTfsTest/Commands/InitBranchTest.cs b/src/GitTfsTest/Commands/InitBranchTest.cs index 18da3d80..09bdb306 100644 --- a/src/GitTfsTest/Commands/InitBranchTest.cs +++ b/src/GitTfsTest/Commands/InitBranchTest.cs @@ -44,7 +44,7 @@ namespace GitTfs.Test.Commands var trunkGitTfsRemote = trunkGitTfsRemoteMock.Object; trunkGitTfsRemote.TfsUsername = "user"; trunkGitTfsRemote.TfsPassword = "pwd"; - trunkGitTfsRemote.TfsRepositoryPath = "$/MyProject/Trunk"; + trunkGitTfsRemoteMock.SetupGet(x => x.TfsRepositoryPath).Returns("$/MyProject/Trunk"); trunkGitTfsRemote.TfsUrl = "http://myTfsServer:8080/tfs"; newBranchRemoteMock = Mock.Get(mocks.Get()).SetupAllProperties(); @@ -115,7 +115,7 @@ namespace GitTfs.Test.Commands IGitTfsRemote existingBranchRemote = gitTfsRemoteMock.Object; existingBranchRemote.TfsUsername = "user"; existingBranchRemote.TfsPassword = "pwd"; - existingBranchRemote.TfsRepositoryPath = "$/MyProject/MyBranch"; + gitTfsRemoteMock.SetupGet(x => x.TfsRepositoryPath).Returns("$/MyProject/MyBranch"); existingBranchRemote.TfsUrl = "http://myTfsServer:8080/tfs"; gitRepository.Name = nameof(gitRepository); @@ -366,7 +366,7 @@ namespace GitTfs.Test.Commands var remote = remoteMock.Object; remote.TfsUsername = "user"; remote.TfsPassword = "pwd"; - remote.TfsRepositoryPath = "$/MyProject/Trunk"; + remoteMock.SetupGet(x => x.TfsRepositoryPath).Returns("$/MyProject/Trunk"); remote.TfsUrl = "http://myTfsServer:8080/tfs"; remoteMock.SetupGet(x => x.Tfs).Returns(new TfsHelper(mocks.Container, null));