zim/modules/git/functions/git-stash-clear-interactive
Eric Nielsen 451e51bd88 [git] Add git-branch-delete-interactive
that prompts if upstream remote branch(es) should be deleted too. As
with `git branch`, the function supports multiple branches as params,
and also the `-r`/`--remotes` param. Update `gbx` and `gbX` to use this
function.

Also update `git-stash-clear-interactive` to have multiple tests instead
of multiple nested `if`/`then`/`fi`. (Simpler syntax, IMHO)
2018-02-05 10:44:59 -05:00

10 lines
252 B
Bash

# vim:et sts=2 sw=2 ft=zsh
setopt LOCAL_OPTIONS PIPE_FAIL
local -i stashed
stashed=$(command git stash list | wc -l) || return 1
if (( stashed )) && \
read -q "?Clear ${stashed} stashed state(s) [y/N]? "; then
print
command git stash clear
fi