use of git4idea.commands.GitSimpleHandler in project intellij-community by JetBrains.
the class GitFileUtils method addPaths.
private static void addPaths(@NotNull Project project, @NotNull VirtualFile root, @NotNull List<List<String>> chunkedPaths) throws VcsException {
for (List<String> paths : chunkedPaths) {
paths = excludeIgnoredFiles(project, root, paths);
if (paths.isEmpty()) {
continue;
}
GitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.ADD);
handler.addParameters("--ignore-errors");
handler.endOptions();
handler.addParameters(paths);
handler.run();
}
}
use of git4idea.commands.GitSimpleHandler in project intellij-community by JetBrains.
the class GitTag method listAsStrings.
@Deprecated
public static void listAsStrings(final Project project, final VirtualFile root, final Collection<String> tags, @Nullable final String containingCommit) throws VcsException {
GitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.TAG);
handler.setSilent(true);
handler.addParameters("-l");
if (containingCommit != null) {
handler.addParameters("--contains");
handler.addParameters(containingCommit);
}
for (String line : handler.run().split("\n")) {
if (line.length() == 0) {
continue;
}
tags.add(new String(line));
}
}
use of git4idea.commands.GitSimpleHandler in project intellij-community by JetBrains.
the class GitMergeProvider method getAffectedBlobs.
@NotNull
private Trinity<String, String, String> getAffectedBlobs(@NotNull VirtualFile root, @NotNull VirtualFile file) {
try {
GitSimpleHandler h = new GitSimpleHandler(myProject, root, GitCommand.LS_FILES);
h.addParameters("--exclude-standard", "--unmerged", "-z");
h.endOptions();
h.addRelativeFiles(Collections.singleton(file));
String output = h.run();
StringScanner s = new StringScanner(output);
String lastBlob = null;
String currentBlob = null;
String originalBlob = null;
while (s.hasMoreData()) {
// permissions
s.spaceToken();
String blob = s.spaceToken();
// stage
int source = Integer.parseInt(s.tabToken());
// file name
s.boundedToken('