public void CanRecordFailureForChange() { long changesetId = 123; ChangeType changeType = ChangeType.Rename; string serverPath = @"$\tfs\some\file.cs"; string reason = "unable to delete rename source"; TfsFailTracker sut = new TfsFailTracker(); sut.TrackFailureLoadingChange(changesetId, changeType, serverPath, reason); var results = sut.GetSummary(); var expectedResult = "Error loading changeset " + changesetId.ToString() + "\r\n" + " " + reason + " for Rename of " + serverPath + "\r\n"; Assert.AreEqual(expectedResult, results); }
void ApplyDelete(Change change, GitIndexInfo index, IDictionary<string, GitObject> initialTree, TfsFailTracker failTracker) { if (change.Item.DeletionId != 0) { string oldPath = null; try { oldPath = Summary.Remote.GetPathInGitRepo(GetPathBeforeRename(change.Item)); } catch (Exception e) { failTracker.TrackFailureLoadingChange(change.Item.ChangesetId, change.ChangeType, change.Item.ServerItem, "Unable to locate deleted item"); } if (oldPath != null) { Delete(oldPath, index, initialTree); } } }