diff options
| author | Dani Megert | 2012-02-26 13:53:51 +0000 |
|---|---|---|
| committer | Matthias Sohn | 2012-02-26 13:53:51 +0000 |
| commit | c7ec1f7caa9e27c89a7d09c5269e54ceab2f8a43 (patch) | |
| tree | 250795672e3bcbdaa6e7235d186d2c94f5984b77 | |
| parent | a19f92922b33e3b5ab8fb37f5d5af9d56b118e7a (diff) | |
| download | egit-c7ec1f7caa9e27c89a7d09c5269e54ceab2f8a43.tar.gz egit-c7ec1f7caa9e27c89a7d09c5269e54ceab2f8a43.tar.xz egit-c7ec1f7caa9e27c89a7d09c5269e54ceab2f8a43.zip | |
Fix patch creation to file system and workspace
Bug: 372371
Change-Id: Iba21e7431fe12fdff525818902a9ca60f6c4a38c
Signed-off-by: Dani Megert <Daniel_Megert@ch.ibm.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| -rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitCreatePatchWizard.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitCreatePatchWizard.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitCreatePatchWizard.java index 7b47f51c06..dc25eae07c 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitCreatePatchWizard.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitCreatePatchWizard.java @@ -24,7 +24,9 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.egit.core.op.CreatePatchOperation; @@ -158,8 +160,7 @@ public class GitCreatePatchWizard extends Wizard { operation.setContextLines(Integer.parseInt(optionsPage.contextLines.getText())); operation.setPathFilter(createPathFilter(resources)); - final File file = !locationPage.fsRadio.getSelection() ? locationPage - .getFile() : null; + final File file = locationPage.getFile(); if (!(file == null || validateFile(file))) return false; @@ -172,9 +173,15 @@ public class GitCreatePatchWizard extends Wizard { operation.execute(monitor); String content = operation.getPatchContent(); - if (file != null) + if (file != null) { writeToFile(file, content); - else + IFile[] files = ResourcesPlugin.getWorkspace() + .getRoot() + .findFilesForLocationURI(file.toURI()); + for (int i = 0; i < files.length; i++) + files[i].refreshLocal(IResource.DEPTH_ZERO, + monitor); + } else copyToClipboard(content); } catch (IOException e) { throw new InvocationTargetException(e); |
