git: cleanup: remove useless code

The most low-level parseChanges() method parses while(sc.hasMoreData()), so there is no chance that it exists before parsing everything (apart of throwing an exception).

GitOrigin-RevId: 3ff8da24ddb7d83d98204d7f327b15a403b3055f
This commit is contained in:
Kirill Likhodedov
2019-07-31 13:03:52 +03:00
committed by intellij-monorepo-bot
parent fda6c393c4
commit 41710e600d
@@ -60,11 +60,7 @@ public class GitChangeUtils {
GitRevisionNumber parentRevision,
String s,
Collection<? super Change> changes) throws VcsException {
StringScanner sc = new StringScanner(s);
parseChanges(project, vcsRoot, thisRevision, parentRevision, sc, changes);
if (sc.hasMoreData()) {
throw new IllegalStateException("Unknown file status: " + sc.line());
}
parseChanges(project, vcsRoot, thisRevision, parentRevision, new StringScanner(s), changes);
}
/**
@@ -391,14 +387,10 @@ public class GitChangeUtils {
});
String output = Git.getInstance().runCommand(handler).getOutputOrThrow();
StringScanner sc = new StringScanner(output);
Collection<GitDiffChange> changes = new ArrayList<>();
parseChanges(root, sc, (status, beforePath, afterPath) -> {
parseChanges(root, new StringScanner(output), (status, beforePath, afterPath) -> {
changes.add(new GitDiffChange(status, beforePath, afterPath));
});
if (sc.hasMoreData()) {
throw new IllegalStateException("Unknown file status: " + sc.line());
}
return changes;
}