summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xgit-sonar15
1 files changed, 6 insertions, 9 deletions
diff --git a/git-sonar b/git-sonar
index fa2237e..1a73949 100755
--- a/git-sonar
+++ b/git-sonar
@@ -41,11 +41,6 @@ prepare_colors() {
}
-is_repo() {
- git-precheck --quiet
- [ $? -lt 4 ]
-}
-
fetch() {
FETCH_TIME="${GIT_RADAR_FETCH_TIME:-"$((5 * 60))"}"
TS_FILE="$(git rev-parse --git-path lastupdatetime 2>/dev/null)"
@@ -327,8 +322,7 @@ stash_status() {
}
repo_special_condition() {
- git-precheck --quiet --ignore-dirty --ignore-untracked \
- || printf "$COLOR_CONDITION!$RESET_COLOR_CONDITION"
+ [ "$precheck_status" -lt 3 ] || printf '%b' "$COLOR_CONDITION!$RESET_COLOR"
}
render_prompt() {
@@ -487,8 +481,11 @@ if [ $# -ne 0 ]; then
exit 1
fi
-# Guard all active operations by this is_repo check
-if is_repo; then
+git-precheck --quiet --ignore-dirty --ignore-untracked >/dev/null 2>&1
+precheck_status=$?
+
+# Guard all active operations by this "is in repo" check
+if [ "$precheck_status" -lt 4 ]; then
# Merge configuration from accepted RC files
[ -f "$HOME/.gitradarrc" ] && . "$HOME/.gitradarrc"
[ -f "$HOME/.gitradarrc.bash" ] && . "$HOME/.gitradarrc.bash"