List of usage examples for org.eclipse.jgit.internal.storage.reftree Command setResult
public void setResult(Result result, @Nullable String why)
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); }// ww w . jav a2 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); }); }