diff options
| author | typebrook <typebrook@gmail.com> | 2020-03-16 12:16:28 +0800 |
|---|---|---|
| committer | typebrook <typebrook@gmail.com> | 2020-03-16 12:16:28 +0800 |
| commit | 005f6cd10e2befd2899e455466d51b5803ad7849 (patch) | |
| tree | 2fc00b1902efc4b3ce5b1230496a478086ee2a5b | |
| parent | c38dbe6717c4ccd60ec9b3207fc0f171f61de282 (diff) | |
Show 'working' when checkout to non-master branch
| -rwxr-xr-x | gist | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -239,7 +239,7 @@ _check_repo_status() { | |||
| 239 | fi | 239 | fi |
| 240 | else | 240 | else |
| 241 | cd "$1" || exit | 241 | cd "$1" || exit |
| 242 | if [[ -n $(git status --short) ]] &>/dev/null; then | 242 | if [[ -n $(git status --short) || $(git branch | sed -n '/\* / s///p') != 'master' ]] &>/dev/null; then |
| 243 | echo "\e[36m[working]\e[0m" | 243 | echo "\e[36m[working]\e[0m" |
| 244 | else | 244 | else |
| 245 | [[ $(_blob_code "$1") != "$2" ]] 2>/dev/null && echo "\e[31m[outdated]\e[0m" | 245 | [[ $(_blob_code "$1") != "$2" ]] 2>/dev/null && echo "\e[31m[outdated]\e[0m" |