]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-stash.sh
stash: convert pop to builtin
[thirdparty/git.git] / git-stash.sh
index 67db321a4cb24eaa73197c3062bdf876d2e75e90..8a9f907aa929caa033fabfed2a22e563bfb7a270 100755 (executable)
@@ -571,50 +571,6 @@ assert_stash_like() {
        }
 }
 
-is_stash_ref() {
-       is_stash_like "$@" && test -n "$IS_STASH_REF"
-}
-
-assert_stash_ref() {
-       is_stash_ref "$@" || {
-               args="$*"
-               die "$(eval_gettext "'\$args' is not a stash reference")"
-       }
-}
-
-apply_stash () {
-       cd "$START_DIR"
-       git stash--helper apply "$@"
-       res=$?
-       cd_to_toplevel
-       return $res
-}
-
-pop_stash() {
-       assert_stash_ref "$@"
-
-       if apply_stash "$@"
-       then
-               drop_stash "$@"
-       else
-               status=$?
-               say "$(gettext "The stash entry is kept in case you need it again.")"
-               exit $status
-       fi
-}
-
-drop_stash () {
-       assert_stash_ref "$@"
-
-       git reflog delete --updateref --rewrite "${REV}" &&
-               say "$(eval_gettext "Dropped \${REV} (\$s)")" ||
-               die "$(eval_gettext "\${REV}: Could not drop stash entry")"
-
-       # clear_stash if we just dropped the last stash entry
-       git rev-parse --verify --quiet "$ref_stash@{0}" >/dev/null ||
-       clear_stash
-}
-
 test "$1" = "-p" && set "push" "$@"
 
 PARSE_CACHE='--not-parsed'
@@ -672,7 +628,8 @@ drop)
        ;;
 pop)
        shift
-       pop_stash "$@"
+       cd "$START_DIR"
+       git stash--helper pop "$@"
        ;;
 branch)
        shift