simplify regex

This commit is contained in:
David Refoua
2025-11-09 01:48:05 +03:30
committed by GitHub
parent a0d085f93e
commit 304b8c7a05

View File

@@ -5,9 +5,9 @@ function getGitStatusSetting() {
# Get all git config entries for the current repository without pager # Get all git config entries for the current repository without pager
gitConfig=$(git --no-pager config -l 2>/dev/null) || return 0 # treat failure as enabled gitConfig=$(git --no-pager config -l 2>/dev/null) || return 0 # treat failure as enabled
# Check if git status for Cmder is disabled # Check if git status display for Cmder is disabled via config
if [[ $gitConfig =~ (^|$'\n')cmder\.status=false($|$'\n') ]] || \ # Matches: cmder.status=false or cmder.shstatus=false (Bash-specific)
[[ $gitConfig =~ (^|$'\n')cmder\.shstatus=false($|$'\n') ]] if [[ $gitConfig =~ (^|$'\n')cmder\.(sh)?status=false($|$'\n') ]]
then then
return 1 # disabled return 1 # disabled
fi fi