clone: verify if tfs path exists

This commit is contained in:
Philippe Miossec
2013-05-24 23:36:37 +02:00
parent df159384c5
commit 20f2eb6832
4 changed files with 15 additions and 0 deletions
+4
View File
@@ -653,5 +653,9 @@ namespace Sep.Git.Tfs.VsCommon
}
public bool IsExistingInTfs(string path)
{
return VersionControl.ServerItemExists(path, ItemType.Any);
}
}
}
+5
View File
@@ -375,6 +375,11 @@ namespace Sep.Git.Tfs.VsFake
{
throw new NotImplementedException();
}
public bool IsExistingInTfs(string path)
{
throw new NotImplementedException();
}
#endregion
}
}
+5
View File
@@ -102,6 +102,11 @@ namespace Sep.Git.Tfs.Commands
if (initBranch != null)
{
var remote = globals.Repository.ReadTfsRemote(GitTfsConstants.DefaultRepositoryId);
if (!remote.Tfs.IsExistingInTfs(tfsRepositoryPath))
throw new GitTfsException("error: the path " + tfsRepositoryPath + " you want to clone doesn't exist!")
.WithRecommendation("To discover which branch to clone, you could use the command :\ngit tfs list-remote-branches " + remote.TfsUrl);
if (!remote.Tfs.CanGetBranchInformation)
return;
var tfsTrunkRepository = remote.Tfs.GetRootTfsBranchForRemotePath(tfsRepositoryPath, false);
+1
View File
@@ -33,5 +33,6 @@ namespace Sep.Git.Tfs.Core.TfsInterop
IEnumerable<IBranchObject> GetBranches();
void EnsureAuthenticated();
void CreateBranch(string sourcePath, string targetPath, int changesetId, string comment = null);
bool IsExistingInTfs(string path);
}
}