mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 15:26:16 -04:00
Fix: Early out from _forgit_stash_push when no files can be stashed (#376)
Previously when using _forgit_stash_push without any local changes an empty file picker would open. Exit early and show a message instead.
This commit is contained in:
parent
bc408f155c
commit
2903fef2af
|
|
@ -467,8 +467,8 @@ _forgit_stash_push() {
|
|||
while IFS='' read -r file; do
|
||||
files+=("$file")
|
||||
done < <(git ls-files --exclude-standard --modified --others |
|
||||
FZF_DEFAULT_OPTS="$opts" fzf)
|
||||
[[ "${#files[@]}" -eq 0 ]] && return 1
|
||||
FZF_DEFAULT_OPTS="$opts" fzf --exit-0)
|
||||
[[ "${#files[@]}" -eq 0 ]] && echo "Nothing to stash" && return 1
|
||||
_forgit_git_stash_push ${msg:+-m "$msg"} -u "${files[@]}"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue