From: Jon Seymour Date: Tue, 10 Aug 2010 00:04:40 GMT Subject: [PATCH v4 1/9] stash: refactor - create pop_stash function Message-ID: <1281398688-21008-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 --- 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.6.5.rc3.8.g8ba5e