aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-03-16 12:16:28 +0800
committertypebrook <typebrook@gmail.com>2020-03-16 12:16:28 +0800
commit005f6cd10e2befd2899e455466d51b5803ad7849 (patch)
tree2fc00b1902efc4b3ce5b1230496a478086ee2a5b
parentc38dbe6717c4ccd60ec9b3207fc0f171f61de282 (diff)
Show 'working' when checkout to non-master branch
-rwxr-xr-xgist2
1 files changed, 1 insertions, 1 deletions
diff --git a/gist b/gist
index bb6a926..ce752f8 100755
--- a/gist
+++ b/gist
@@ -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"