Fixing OS X compatibility with merge feature

* OS X utilizes an older version of GNU Bash. As such, certain features
  such as lowercase expansion can fail. This commit removes the Bash 4.0
  syntax in favor of a POSIX syntax with awk.
This commit is contained in:
Tom Ice
2020-02-11 08:25:44 -05:00
parent 9f54b87ed5
commit 46a771138e

View File

@@ -23,9 +23,10 @@ _pathspec=${_GIT_PATHSPEC:-}
# Exclusive shows only merge commits
# Enable shows regular commits together with normal commits
_merges=${_GIT_MERGE_VIEW:-}
if [[ "${_merges,,}" == "exclusive" ]]; then
_merges=$(echo "$_merges" | awk '{print tolower($0)}')
if [[ "${_merges}" == "exclusive" ]]; then
_merges="--merges"
elif [[ "${_merges,,}" == "enable" ]]; then
elif [[ "${_merges}" == "enable" ]]; then
_merges=""
else
_merges="--no-merges"