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:
@@ -4,8 +4,10 @@
|
||||
##
|
||||
## Completely remove a git submodule.
|
||||
|
||||
local toplevel
|
||||
|
||||
# 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
|
||||
[[ $# -gt 0 ]] || return
|
||||
|
||||
Reference in New Issue
Block a user