summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDani Megert2012-02-26 08:53:51 (EST)
committer Matthias Sohn2012-02-26 08:53:51 (EST)
commitc7ec1f7caa9e27c89a7d09c5269e54ceab2f8a43 (patch)
tree250795672e3bcbdaa6e7235d186d2c94f5984b77
parenta19f92922b33e3b5ab8fb37f5d5af9d56b118e7a (diff)
downloadegit-c7ec1f7caa9e27c89a7d09c5269e54ceab2f8a43.zip
egit-c7ec1f7caa9e27c89a7d09c5269e54ceab2f8a43.tar.gz
egit-c7ec1f7caa9e27c89a7d09c5269e54ceab2f8a43.tar.bz2
Fix patch creation to file system and workspacerefs/changes/45/5145/2
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.java15
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 7b47f51..dc25eae 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);