mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user