Beispiel #1
0
        public void MenuUndoGit_Click(object sende, RoutedEventArgs e)
        {
            var selectedFiles = FolderBrowser.GetSelectedItems();

            if (selectedFiles.Count < 1)
            {
                return;
            }

            var gh = new GitHelper();

            foreach (var selected in selectedFiles)
            {
                if (selected == null)
                {
                    continue;
                }

                if (selected.FileStatus != LibGit2Sharp.FileStatus.ModifiedInIndex &&
                    selected.FileStatus != LibGit2Sharp.FileStatus.ModifiedInWorkdir)
                {
                    continue;
                }

                gh.UndoChanges(selected.FullPath);
            }

            // force editors to update
            DocumentFileWatcher.CheckFileChangeInOpenDocuments();
        }
Beispiel #2
0
        public void MenuUndoGit_Click(object sende, RoutedEventArgs e)
        {
            var selected = TreeFolderBrowser.SelectedItem as PathItem;

            if (selected == null)
            {
                return;
            }

            if (selected.FileStatus != LibGit2Sharp.FileStatus.ModifiedInIndex &&
                selected.FileStatus != LibGit2Sharp.FileStatus.ModifiedInWorkdir)
            {
                return;
            }

            var gh = new GitHelper();

            gh.UndoChanges(selected.FullPath);


            // force editors to update
            DocumentFileWatcher.CheckFileChangeInOpenDocuments();
        }