diff options
| author | Matt Hunter <m@lfurio.us> | 2026-02-22 03:10:52 -0500 |
|---|---|---|
| committer | Matt Hunter <m@lfurio.us> | 2026-02-22 22:07:05 -0500 |
| commit | 58af2ba03119955948d9f16259151e60e9fb5765 (patch) | |
| tree | 39907760d77e689f6913163d8b96eebcf2087bc3 | |
| parent | 6c84dee68c857bfbf4a5025c5d3e21c295d6523e (diff) | |
| download | git-sonar-58af2ba03119955948d9f16259151e60e9fb5765.tar.gz git-sonar-58af2ba03119955948d9f16259151e60e9fb5765.zip | |
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 <m@lfurio.us>
| -rwxr-xr-x | git-sonar | 15 |
1 files changed, 1 insertions, 14 deletions
@@ -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 |
