aboutsummaryrefslogtreecommitdiff
path: root/util/lint/lint-stable-019-header-files
diff options
context:
space:
mode:
Diffstat (limited to 'util/lint/lint-stable-019-header-files')
-rwxr-xr-xutil/lint/lint-stable-019-header-files4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/lint/lint-stable-019-header-files b/util/lint/lint-stable-019-header-files
index 1ce6cc525f..11bc432679 100755
--- a/util/lint/lint-stable-019-header-files
+++ b/util/lint/lint-stable-019-header-files
@@ -23,7 +23,9 @@ EXCLUDED_FILES='src/include/kconfig.h'
HEADER_FILES="k*config"
# Use git grep if the code is in a git repo, otherwise use grep.
-if [ -n "$(command -v git)" ] && [ -d .git ]; then
+if [ -n "$(command -v git)" ] && \
+ [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]
+then
GREP_FILES="git grep -n"
else
GREP_FILES="grep -rn"