[PATCH v3 1/9] stash: refactor - create pop_stash function
- From
Jon Seymour <jon.seymour@gmail.com>
- Date
- Aug 8, 2010, 04:46 UTC
- Message-ID
- <1281242771-24764-2-git-send-email-jon.seymour@gmail.com>
- In-Reply-To
- <1281242771-24764-1-git-send-email-jon.seymour@gmail.com>
We plan to edit pop_stash later, so let's make it a first class command by giving its own implementation function.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com> --- git-stash.sh | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/git-stash.sh b/git-stash.sh index 1d95447..31ea333 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -323,6 +323,13 @@ apply_stash () { fi } +pop_stash() { + if apply_stash "$@" + then + drop_stash "$applied_stash" + fi +} + drop_stash () { have_stash || die 'No stash entries to drop' @@ -422,10 +429,7 @@ drop) ;; pop) shift - if apply_stash "$@" - then - drop_stash "$applied_stash" - fi + pop_stash "$@" ;; branch) shift
-- 1.7.2.1.51.g82c0c0