protected void doGitRemote( String remoteName, CloudGitApplication application, String subCommand, String failMessage) throws ServerRuntimeException { try { final GitSimpleHandler handler = new GitSimpleHandler(myProject, myContentRoot, GitCommand.REMOTE); handler.setSilent(false); handler.addParameters(subCommand, remoteName, application.getGitUrl()); handler.run(); getRepository().update(); if (handler.getExitCode() != 0) { throw new ServerRuntimeException(failMessage); } } catch (VcsException e) { throw new ServerRuntimeException(e); } }