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:
Philippe Miossec
2014-03-06 18:23:19 +01:00
parent bc810d22ae
commit dbcf1291c7
2 changed files with 13 additions and 2 deletions
+12 -1
View File
@@ -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)
+1 -1
View File
@@ -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)