boolean includeUntracked = requestPayload.optBoolean(GitConstants.KEY_STASH_INCLUDE_UNTRACKED, false);
try {
Git git = new Git(db);
StashCreateCommand stashCreate = git.stashCreate();
stashCreate.setPerson(new PersonIdent(db));
stashCreate.setIncludeUntracked(includeUntracked);
if (!indexMessage.isEmpty())
stashCreate.setIndexMessage(indexMessage);
if (!workingDirectoryMessage.isEmpty())
stashCreate.setWorkingDirectoryMessage(workingDirectoryMessage);
stashCreate.call();
return true;
} catch (Exception ex) {
String msg = "An error occured for stash command.";
return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg, ex));