Example usage for org.eclipse.jgit.internal.storage.reftree Command getResult

List of usage examples for org.eclipse.jgit.internal.storage.reftree Command getResult

Introduction

In this page you can find the example usage for org.eclipse.jgit.internal.storage.reftree Command getResult.

Prototype

public Result getResult() 

Source Link

Document

Get result of executing this command.

Usage

From source file:org.uberfire.java.nio.fs.jgit.util.commands.RefTreeUpdateCommand.java

License:Apache License

private void update(final Repository _repo, final String _name, final RevCommit _commit) throws IOException {
    commit(_repo, _commit, (reader, refTree) -> {
        final Ref old = refTree.exactRef(reader, _name);
        final List<Command> n = new ArrayList<>(1);
        try (RevWalk rw = new RevWalk(_repo)) {
            n.add(new Command(old, toRef(rw, _commit, _name, true)));
            if (git.isKetchEnabled()) {
                proposeKetch(n, _commit);
            }//  w  w  w. j a  v a 2  s . c o  m
        } catch (final IOException | InterruptedException e) {
            String msg = JGitText.get().transactionAborted;
            for (Command cmd : n) {
                if (cmd.getResult() == NOT_ATTEMPTED) {
                    cmd.setResult(REJECTED_OTHER_REASON, msg);
                }
            }
            throw new GitException("Error");
            //log.error(msg, e);
        }
        return refTree.apply(n);
    });
}