* [JGIT PATCH] Egit move/delete bugfix, do not lose files when moving folders
@ 2008-07-08 21:51 Robin Rosenberg
0 siblings, 0 replies; only message in thread
From: Robin Rosenberg @ 2008-07-08 21:51 UTC (permalink / raw)
To: 'Shawn O. Pearce'; +Cc: git, 'Marek Zawirski'
We lied to Eclipse in the move/delete hook and told it we had already
moved a folder. That wasn't true so the original was lost. With this
patch Eclipse will move the code for us, but it is not added to the index.
This is an intermediate fix until we actually manipulate the index properly.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../org/spearce/egit/core/GitMoveDeleteHook.java | 20 +++++++-------------
1 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/GitMoveDeleteHook.java b/org.spearce.egit.core/src/org/spearce/egit/core/GitMoveDeleteHook.java
index 22a14c4..cc4059c 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/GitMoveDeleteHook.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/GitMoveDeleteHook.java
@@ -27,7 +27,6 @@ import org.spearce.jgit.lib.GitIndex;
import org.spearce.jgit.lib.Repository;
class GitMoveDeleteHook implements IMoveDeleteHook {
- private static final boolean NOT_ALLOWED = true;
private static final boolean I_AM_DONE = true;
private static final boolean FINISH_FOR_ME = false;
@@ -54,7 +53,7 @@ class GitMoveDeleteHook implements IMoveDeleteHook {
e.printStackTrace();
tree.failed(new Status(IStatus.ERROR, Activator.getPluginId(), 0,
CoreText.MoveDeleteHook_operationError, e));
- return NOT_ALLOWED;
+ return I_AM_DONE;
}
}
@@ -97,7 +96,7 @@ class GitMoveDeleteHook implements IMoveDeleteHook {
}
tree.failed(new Status(IStatus.ERROR, Activator.getPluginId(),
0, "Destination not in a git versioned project", null));
- return NOT_ALLOWED;
+ return FINISH_FOR_ME;
}
GitIndex index2 = map2.getRepository().getIndex();
tree.standardMoveFile(source, destination, updateFlags, monitor);
@@ -114,7 +113,7 @@ class GitMoveDeleteHook implements IMoveDeleteHook {
e.printStackTrace();
tree.failed(new Status(IStatus.ERROR, Activator.getPluginId(), 0,
CoreText.MoveDeleteHook_operationError, e));
- return NOT_ALLOWED;
+ return I_AM_DONE;
}
}
@@ -124,25 +123,20 @@ class GitMoveDeleteHook implements IMoveDeleteHook {
final IProgressMonitor monitor) {
// TODO: Implement this. Should be relatively easy, but consider that
// Eclipse thinks folders are real thinsgs, while Git does not care.
- return NOT_ALLOWED;
+ return FINISH_FOR_ME;
}
public boolean moveProject(final IResourceTree tree, final IProject source,
final IProjectDescription description, final int updateFlags,
final IProgressMonitor monitor) {
- // Never allow moving a project as it can complicate updating our
- // project data with the new repository mappings. To move a project
- // disconnect the GIT team provider, move the project, then reconnect
- // the GIT team provider.
- // We should be able to do this without too much effort when the
+ // TODO: We should be able to do this without too much effort when the
// projects belong to the same Git repository.
- //
- return NOT_ALLOWED;
+ return FINISH_FOR_ME;
}
private boolean cannotModifyRepository(final IResourceTree tree) {
tree.failed(new Status(IStatus.ERROR, Activator.getPluginId(), 0,
CoreText.MoveDeleteHook_cannotModifyFolder, null));
- return NOT_ALLOWED;
+ return I_AM_DONE;
}
}
\ No newline at end of file
--
1.5.6.2.220.g44701
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-07-08 21:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-08 21:51 [JGIT PATCH] Egit move/delete bugfix, do not lose files when moving folders Robin Rosenberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).