diff --git a/bin/git-unstage b/bin/git-unstage index 5ad7046..243b351 100755 --- a/bin/git-unstage +++ b/bin/git-unstage @@ -21,14 +21,14 @@ gunstage() { # check whether we’re in a Git repository # https://stackoverflow.com/a/53809163 - if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + if command git rev-parse --is-inside-work-tree >/dev/null 2>&1; then case $1 in -A | --all) # unstage everything - git reset --quiet HEAD -- "$(git rev-parse --show-toplevel)" - git status + command git reset --quiet HEAD -- "$(command git rev-parse --show-toplevel)" + command git status ;; *) @@ -37,10 +37,10 @@ gunstage() { for file in "${@:-.}"; do # https://github.com/gggritso/site/commit/a07b620 - git reset --quiet HEAD -- "${file}" + command git reset --quiet HEAD -- "${file}" # perform a `git status` only if the loop was successful - done && git status + done && command git status ;; esac diff --git a/gunstage.plugin.zsh b/gunstage.plugin.zsh index c0ea9f3..f205f5e 100644 --- a/gunstage.plugin.zsh +++ b/gunstage.plugin.zsh @@ -21,7 +21,7 @@ # by adding `bin` directory to `PATH` # without adding an initial colon `:` to `PATH` # https://unix.stackexchange.com/a/415028 -PATH=${PATH:+${PATH}:}$(dirname "$0")/bin +PATH=${PATH:+${PATH}:}$(command dirname "$0")/bin export PATH # keep backwards compatibility