From 58af2ba03119955948d9f16259151e60e9fb5765 Mon Sep 17 00:00:00 2001 From: Matt Hunter Date: Sun, 22 Feb 2026 03:10:52 -0500 Subject: Remove in_current_dir check during dot_git() The working directory is never changed by this script, so the cached path to the git dir should never become invalidated. Signed-off-by: Matt Hunter --- git-sonar | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/git-sonar b/git-sonar index 1978856..d097e12 100755 --- a/git-sonar +++ b/git-sonar @@ -10,7 +10,6 @@ GIT_SONAR_VERSION="v0.8.1" # Original sonar-base ################################################################################ dot_git="" -cwd="" remote="" rcfile_path="$HOME" @@ -67,20 +66,8 @@ prepare_colors() { } -in_current_dir() { - local wd - wd="$(pwd)" - if [[ "$wd" == "$cwd" ]]; then - cwd="$wd" - return 0 - else - cwd="$wd" - return 1 - fi -} - dot_git() { - if in_current_dir && [[ -n "$dot_git" ]]; then + if [ -n "$dot_git" ]; then # cache dot_git to save calls to rev-parse printf '%s' "$dot_git" elif [ -d .git ]; then -- cgit v1.2.3