From 07af2bba708c177e949b90c2d3e1527f6b9ff219 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Fri, 4 Sep 2009 08:59:46 -0400 Subject: [PATCH] GitInterceptor: Replace GitCommand.doRenameAfter calls with Exceptions This is a defensive measure, as I don't know if they are really needed. They are currently unimplemented, and thus this code should be equivalent to the old one. Signed-off-by: Jonas Fonseca --- src/org/nbgit/GitInterceptor.java | 8 +++----- src/org/nbgit/util/GitCommand.java | 4 ---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/org/nbgit/GitInterceptor.java b/src/org/nbgit/GitInterceptor.java index 13ec9f6..b106e65 100644 --- a/src/org/nbgit/GitInterceptor.java +++ b/src/org/nbgit/GitInterceptor.java @@ -247,10 +247,8 @@ public class GitInterceptor extends VCSInterceptor { public void run() { OutputLogger logger = OutputLogger.getLogger(root.getAbsolutePath()); try { - if (dstFile.isDirectory()) { - GitCommand.doRenameAfter(root, srcFile, dstFile, logger); - return; - } + if (dstFile.isDirectory()) + throw new IllegalStateException("Rename of directory " + dstFile); int status = GitCommand.getSingleStatus(root, srcFile).getStatus(); Git.LOG.log(Level.FINE, "gitMoveImplementation(): Status: {0} {1}", new Object[]{srcFile, status}); // NOI18N if (status == StatusInfo.STATUS_NOTVERSIONED_NEWLOCALLY || @@ -258,7 +256,7 @@ public class GitInterceptor extends VCSInterceptor { } else if (status == StatusInfo.STATUS_VERSIONED_ADDEDLOCALLY) { GitCommand.doMove(root, srcFile, dstFile, logger); } else { - GitCommand.doRenameAfter(root, srcFile, dstFile, logger); + throw new IllegalStateException("Rename with status " + status); } } catch (Exception e) { Git.LOG.log(Level.FINE, "Git failed to rename: File: {0} {1}", new Object[]{srcFile.getAbsolutePath(), dstFile.getAbsolutePath()}); // NOI18N diff --git a/src/org/nbgit/util/GitCommand.java b/src/org/nbgit/util/GitCommand.java index 246b1f6..6b7df10 100644 --- a/src/org/nbgit/util/GitCommand.java +++ b/src/org/nbgit/util/GitCommand.java @@ -372,10 +372,6 @@ public class GitCommand { } - public static void doRenameAfter(File root, File srcFile, File dstFile, OutputLogger logger) { - throw new UnsupportedOperationException("Not yet implemented"); - } - public static List getRevisions(File root, int limit) { return getRevisionsForFile(root, null, limit); } -- 2.11.4.GIT