Class StashCreateCommand

    • Field Detail

      • indexMessage

        private java.lang.String indexMessage
      • workingDirectoryMessage

        private java.lang.String workingDirectoryMessage
      • ref

        private java.lang.String ref
      • includeUntracked

        private boolean includeUntracked
    • Constructor Detail

      • StashCreateCommand

        public StashCreateCommand​(Repository repo)
        Create a command to stash changes in the working directory and index
        Parameters:
        repo - a Repository object.
    • Method Detail

      • setIndexMessage

        public StashCreateCommand setIndexMessage​(java.lang.String message)
        Set the message used when committing index changes

        The message will be formatted with the current branch, abbreviated commit id, and short commit message when used.

        Parameters:
        message - the stash message
        Returns:
        this
      • setWorkingDirectoryMessage

        public StashCreateCommand setWorkingDirectoryMessage​(java.lang.String message)
        Set the message used when committing working directory changes

        The message will be formatted with the current branch, abbreviated commit id, and short commit message when used.

        Parameters:
        message - the working directory message
        Returns:
        this
      • setPerson

        public StashCreateCommand setPerson​(PersonIdent person)
        Set the person to use as the author and committer in the commits made
        Parameters:
        person - the PersonIdent of the person who creates the stash.
        Returns:
        this
      • setRef

        public StashCreateCommand setRef​(java.lang.String ref)
        Set the reference to update with the stashed commit id If null, no reference is updated

        This value defaults to Constants.R_STASH

        Parameters:
        ref - the name of the Ref to update
        Returns:
        this
      • setIncludeUntracked

        public StashCreateCommand setIncludeUntracked​(boolean includeUntracked)
        Whether to include untracked files in the stash.
        Parameters:
        includeUntracked - whether to include untracked files in the stash
        Returns:
        this
        Since:
        3.4
      • updateStashRef

        private void updateStashRef​(ObjectId commitId,
                                    PersonIdent refLogIdent,
                                    java.lang.String refLogMessage)
                             throws java.io.IOException
        Throws:
        java.io.IOException