zsh:auto:git-submodule-rm: Keep git exit code

Split `toplevel` definition and assignment as the `local` builtin has
it's own exit code. Thus the function previously did not return if the
`PWD` was not in a git repo.
This commit is contained in:
2022-03-30 02:00:51 +02:00
parent 2495dc7b2d
commit d4350dbd7c

View File

@@ -4,8 +4,10 @@
## ##
## Completely remove a git submodule. ## Completely remove a git submodule.
local toplevel
# Exit if not in git repo # Exit if not in git repo
local toplevel="$(git rev-parse --show-toplevel)" || return toplevel="$(git rev-parse --show-toplevel)" || return
# Exit if no arguements were given # Exit if no arguements were given
[[ $# -gt 0 ]] || return [[ $# -gt 0 ]] || return