diff --git a/plugins/git4idea/src/git4idea/changes/GitChangeUtils.java b/plugins/git4idea/src/git4idea/changes/GitChangeUtils.java index 7b2493558f13..00bc459f9637 100644 --- a/plugins/git4idea/src/git4idea/changes/GitChangeUtils.java +++ b/plugins/git4idea/src/git4idea/changes/GitChangeUtils.java @@ -3,7 +3,6 @@ package git4idea.changes; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vcs.FilePath; import com.intellij.openapi.vcs.FileStatus; @@ -22,7 +21,6 @@ import git4idea.GitVcs; import git4idea.commands.*; import git4idea.repo.GitRepository; import git4idea.util.StringScanner; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -74,28 +72,6 @@ public class GitChangeUtils { } } - public static Collection parseDiffForPaths(final String rootPath, final StringScanner s) throws VcsException { - final Collection result = new ArrayList<>(); - - while (s.hasMoreData()) { - if (s.isEol()) { - s.nextLine(); - continue; - } - if ("CADUMR".indexOf(s.peek()) == -1) { - // exit if there is no next character - break; - } - assert 'M' != s.peek() : "Moves are not yet handled"; - String[] tokens = s.line().split("\t"); - String path = tokens[tokens.length - 1]; - path = rootPath + File.separator + GitUtil.unescapePath(path); - path = FileUtil.toSystemDependentName(path); - result.add(path); - } - return result; - } - /** * Parse changes from lines * @@ -210,17 +186,6 @@ public class GitChangeUtils { return handler; } - /** - * Check if the exception means that HEAD is missing for the current repository. - * - * @param e the exception to examine - * @return true if the head is missing - */ - public static boolean isHeadMissing(final VcsException e) { - @NonNls final String errorText = "fatal: bad revision 'HEAD'\n"; - return e.getMessage().equals(errorText); - } - /** * Get list of changes. Because native Git non-linear revision tree structure is not * supported by the current IDEA interfaces some simplifications are made in the case @@ -500,12 +465,6 @@ public class GitChangeUtils { return Git.getInstance().runCommand(handler).getOutputOrThrow(); } - @NotNull - public static String getDiffOutput(@NotNull Project project, @NotNull VirtualFile root, - @NotNull String diffRange, @Nullable Collection dirtyPaths) throws VcsException { - return getDiffOutput(project, root, diffRange, dirtyPaths, false, true); - } - @NotNull private static GitLineHandler getDiffHandler(@NotNull Project project,