Skip to content

Commit

Permalink
Merge pull request git-tfs#557 from pmiossec/prevent_crash_during_bra…
Browse files Browse the repository at this point in the history
…nch_verification

Prevent a crash during path verification
  • Loading branch information
spraints committed Mar 7, 2014
2 parents ed9d1a2 + dbcf129 commit 97518c1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion GitTfs/Commands/Clone.cs
Expand Up @@ -103,7 +103,9 @@ public int Run(string tfsUrl, string tfsRepositoryPath, string gitRepositoryPath

private void VerifyTfsPathToClone(string tfsRepositoryPath)
{
if (initBranch != null)
if (initBranch == null)
return;
try
{
var remote = globals.Repository.ReadTfsRemote(GitTfsConstants.DefaultRepositoryId);

Expand Down Expand Up @@ -145,6 +147,15 @@ private void VerifyTfsPathToClone(string tfsRepositoryPath)
+ " => 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)
Expand Down
2 changes: 1 addition & 1 deletion doc/release-notes/NEXT.md
Expand Up @@ -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)

0 comments on commit 97518c1

Please sign in to comment.