Search in sources :

Example 1 with StashInfo

use of git4idea.ui.StashInfo in project intellij-community by JetBrains.

the class GitStashUtils method loadStashStack.

public static void loadStashStack(@NotNull Project project, @NotNull VirtualFile root, @NotNull Charset charset, final Consumer<StashInfo> consumer) {
    GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.STASH.readLockingCommand());
    h.setSilent(true);
    h.addParameters("list");
    String out;
    try {
        h.setCharset(charset);
        out = h.run();
    } catch (VcsException e) {
        GitUIUtil.showOperationError(project, e, h.printableCommandLine());
        return;
    }
    for (StringScanner s = new StringScanner(out); s.hasMoreData(); ) {
        consumer.consume(new StashInfo(s.boundedToken(':'), s.boundedToken(':'), s.line().trim()));
    }
}
Also used : GitSimpleHandler(git4idea.commands.GitSimpleHandler) VcsException(com.intellij.openapi.vcs.VcsException) StringScanner(git4idea.util.StringScanner) StashInfo(git4idea.ui.StashInfo)

Aggregations

VcsException (com.intellij.openapi.vcs.VcsException)1 GitSimpleHandler (git4idea.commands.GitSimpleHandler)1 StashInfo (git4idea.ui.StashInfo)1 StringScanner (git4idea.util.StringScanner)1