protected override void OnNotify(GitNotifyEventArgs e) { base.OnNotify(e); string path = e.FullPath; if (string.IsNullOrEmpty(path)) return; GitClientAction action; if (!_changes.TryGetValue(path, out action)) _changes.Add(path, action = new GitClientAction(path)); switch (e.Action) { case GitNotifyAction.CommitDeleted: case GitNotifyAction.Revert: case GitNotifyAction.TreeConflict: action.Recursive = true; break; case GitNotifyAction.UpdateDelete: action.Recursive = true; action.AddOrRemove = true; break; case GitNotifyAction.UpdateReplace: case GitNotifyAction.UpdateAdd: action.AddOrRemove = true; break; case GitNotifyAction.UpdateUpdate: // action.OldRevision = e.OldRevision; break; } }
protected override void OnCommitting(GitCommittingEventArgs e) { base.OnCommitting(e); if (e.CurrentCommandType != GitCommandType.Commit) return; foreach (GitCommitItem item in e.Items) { string fp = item.FullPath; if (fp == null) // Non local operation return; GitClientAction action; if (!_changes.TryGetValue(fp, out action)) _changes.Add(fp, action = new GitClientAction(fp)); } }