git_stash_apply

Apply a single stashed state from the stash list.

If local changes in the working directory conflict with changes in the stash then git_error_code.GIT_EMERGECONFLICT will be returned. In this case, the index will always remain unmodified and all files in the working directory will remain unmodified. However, if you are restoring untracked files or ignored files and there is a conflict when applying the modified files, then those files will remain in the working directory.

If passing the git_stash_apply_flags.GIT_STASH_APPLY_REINSTATE_INDEX flag and there would be conflicts when reinstating the index, the function will return git_error_code.GIT_EMERGECONFLICT and both the working directory and index will be left unmodified.

Note that a minimum checkout strategy of git_checkout_strategy_t.GIT_CHECKOUT_SAFE is implied.

@param repo The owning repository. @param index The position within the stash list. 0 points to the most recent stashed state. @param options Optional options to control how stashes are applied.

@return 0 on success, git_error_code.GIT_ENOTFOUND if there's no stashed state for the given index, git_error_code.GIT_EMERGECONFLICT if changes exist in the working directory, or an error code

extern (C) nothrow @nogc
int
git_stash_apply

Meta