diff --git a/Library/Homebrew/cmd/update-reset.sh b/Library/Homebrew/cmd/update-reset.sh index 005fa9b5a1..008d6d691f 100644 --- a/Library/Homebrew/cmd/update-reset.sh +++ b/Library/Homebrew/cmd/update-reset.sh @@ -10,40 +10,40 @@ homebrew-update-reset() { for option in "$@" do - case "$option" in + case "${option}" in -\?|-h|--help|--usage) brew help update-reset; exit $? ;; --debug) HOMEBREW_DEBUG=1 ;; -*) - [[ "$option" = *d* ]] && HOMEBREW_DEBUG=1 + [[ "${option}" = *d* ]] && HOMEBREW_DEBUG=1 ;; *) - REPOS+=("$option") + REPOS+=("${option}") ;; esac done - if [[ -n "$HOMEBREW_DEBUG" ]] + if [[ -n "${HOMEBREW_DEBUG}" ]] then set -x fi if [[ -z "${REPOS[*]}" ]] then - REPOS+=("$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/*) + REPOS+=("${HOMEBREW_REPOSITORY}" "${HOMEBREW_LIBRARY}"/Taps/*/*) fi for DIR in "${REPOS[@]}" do - [[ -d "$DIR/.git" ]] || continue - ohai "Fetching $DIR..." - git -C "$DIR" fetch --force --tags origin - git -C "$DIR" remote set-head origin --auto >/dev/null + [[ -d "${DIR}/.git" ]] || continue + ohai "Fetching ${DIR}..." + git -C "${DIR}" fetch --force --tags origin + git -C "${DIR}" remote set-head origin --auto >/dev/null echo - ohai "Resetting $DIR..." - head="$(git -C "$DIR" symbolic-ref refs/remotes/origin/HEAD)" + ohai "Resetting ${DIR}..." + head="$(git -C "${DIR}" symbolic-ref refs/remotes/origin/HEAD)" head="${head#refs/remotes/origin/}" - git -C "$DIR" checkout --force -B "$head" origin/HEAD + git -C "${DIR}" checkout --force -B "${head}" origin/HEAD echo done }