@Signature public Memory stashCreate(ArrayMemory settings) throws GitAPIException { StashCreateCommand command = getWrappedObject().stashCreate(); if (settings != null) { command.setIncludeUntracked(settings.valueOfIndex("includeUntracked").toBoolean()); Memory indexMessage = settings.valueOfIndex("indexMessage"); if (indexMessage.isNotNull()) { command.setIndexMessage(indexMessage.toString()); } Memory ref = settings.valueOfIndex("ref"); if (ref.isNotNull()) { command.setRef(ref.toString()); } Memory workingDirectoryMessage = settings.valueOfIndex("workingDirectoryMessage"); if (workingDirectoryMessage.isNotNull()) { command.setWorkingDirectoryMessage(workingDirectoryMessage.toString()); } } return GitUtils.valueOf(command.call()); }
RevCommit stash = git.stashCreate() .call(); stash = git.stashCreate() .call();
RevCommit stash = git.stashCreate() .call(); stash = git.stashCreate() .call();
private void autoStash() throws GitAPIException, IOException { if (repo.getConfig().getBoolean(ConfigConstants.CONFIG_REBASE_SECTION, ConfigConstants.CONFIG_KEY_AUTOSTASH, false)) { String message = MessageFormat.format( AUTOSTASH_MSG, Repository .shortenRefName(getHeadName(getHead()))); RevCommit stashCommit = Git.wrap(repo).stashCreate().setRef(null) .setWorkingDirectoryMessage( message) .call(); if (stashCommit != null) { FileUtils.mkdir(rebaseState.getDir()); rebaseState.createFile(AUTOSTASH, stashCommit.getName()); } } }
@Override public void stashCreate(final Git repo) throws GitAPIException { repo.stashCreate().call(); }
private void createStashIfNeeded() throws GitAPIException { if (!git.status().call().isClean()) { git.stashCreate().call(); } }
public static void stash(Path repositoryDirectory, String stashId) { Git git = null; try { log.debug("Stashing change from <" + repositoryDirectory + "> to stash <" + stashId + ">"); git = Git.open(repositoryDirectory.toFile()); Collection<RevCommit> stashes = git.stashList().call(); int stashIndex = 0; for (RevCommit stash : stashes) { if (stash.getFullMessage().equals(stashId)) { git.stashDrop().setStashRef(stashIndex).call(); log.warn("Stash <" + stashId + "> was already existing in <" + repositoryDirectory + ">. It has been deleted."); break; } stashIndex++; } git.stashCreate().setIncludeUntracked(true).setWorkingDirectoryMessage(stashId).call(); } catch (IOException | GitAPIException e) { throw new GitException("Failed to stash data", e); } finally { close(git); } }
git.stashCreate().setPerson(personIdent).setWorkingDirectoryMessage("Stash before a write").setRef("HEAD").call();
git.stashCreate().setPerson(personIdent).setWorkingDirectoryMessage("Stash before a write").setRef("HEAD").call(); } catch (Throwable e) { LOG.error("Failed to stash changes: " + e, e);
private void autoStash() throws GitAPIException, IOException { if (repo.getConfig().getBoolean(ConfigConstants.CONFIG_REBASE_SECTION, ConfigConstants.CONFIG_KEY_AUTOSTASH, false)) { String message = MessageFormat.format( AUTOSTASH_MSG, Repository .shortenRefName(getHeadName(getHead()))); RevCommit stashCommit = Git.wrap(repo).stashCreate().setRef(null) .setWorkingDirectoryMessage( message) .call(); if (stashCommit != null) { FileUtils.mkdir(rebaseState.getDir()); rebaseState.createFile(AUTOSTASH, stashCommit.getName()); } } }
private void autoStash() throws GitAPIException, IOException { if (repo.getConfig().getBoolean(ConfigConstants.CONFIG_REBASE_SECTION, ConfigConstants.CONFIG_KEY_AUTOSTASH, false)) { String message = MessageFormat.format( AUTOSTASH_MSG, Repository .shortenRefName(getHeadName(getHead()))); RevCommit stashCommit = Git.wrap(repo).stashCreate().setRef(null) .setWorkingDirectoryMessage( message) .call(); if (stashCommit != null) { FileUtils.mkdir(rebaseState.getDir()); rebaseState.createFile(AUTOSTASH, stashCommit.getName()); } } }
git.stashCreate().setPerson(personIdent).setWorkingDirectoryMessage("Stash before a write").setRef("HEAD").call(); } catch (Throwable e) { LOG.error("Failed to stash changes: " + e, e);
stash = git.stashCreate().call(); gitHelper.addRemoteUpstream(git, path); pullFromRemoteUpstream(git, stash, newBranch, userBranch);