Prevent a crash during path verification
Swallow TFS exceptions for this non critical part of the clone process... Permit to clone a branch and use git-tfs even when, due to a bug in TFS, TFS is broken and return an error TF14045 when asking for branches.
This commit is contained in:
@@ -103,7 +103,9 @@ namespace Sep.Git.Tfs.Commands
|
||||
|
||||
private void VerifyTfsPathToClone(string tfsRepositoryPath)
|
||||
{
|
||||
if (initBranch != null)
|
||||
if (initBranch == null)
|
||||
return;
|
||||
try
|
||||
{
|
||||
var remote = globals.Repository.ReadTfsRemote(GitTfsConstants.DefaultRepositoryId);
|
||||
|
||||
@@ -145,6 +147,15 @@ namespace Sep.Git.Tfs.Commands
|
||||
+ " => If you want to manage branches with git-tfs, clone " + tfsTrunkRepositoryPath + " with '--with-branches' option instead...)");
|
||||
}
|
||||
}
|
||||
catch (GitTfsException)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
stdout.WriteLine("warning: a server error occurs when trying to verify the tfs path cloned:\n " + ex.Message
|
||||
+ "\n try to continue anyway...");
|
||||
}
|
||||
}
|
||||
|
||||
private static bool InitGitDir(string gitRepositoryPath)
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
* Use LibGit2Sharp to create commits (#534, #546)
|
||||
* Correct Tfs remote returned when using option `rcheckin -I` in the case of a merge commit
|
||||
and fix #543 where unable to fetch after deleting a tfs branch (#548)
|
||||
* Other documentation and bug fixes (#487, #521, #523, #527)
|
||||
* Other documentation and bug fixes (#487, #521, #523, #527, #557)
|
||||
|
||||
Reference in New Issue
Block a user