summaryrefslogtreecommitdiff
path: root/util/lint/lint-stable-017-configs
diff options
context:
space:
mode:
Diffstat (limited to 'util/lint/lint-stable-017-configs')
-rwxr-xr-xutil/lint/lint-stable-017-configs4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/lint/lint-stable-017-configs b/util/lint/lint-stable-017-configs
index 782c183c24..6d7393db81 100755
--- a/util/lint/lint-stable-017-configs
+++ b/util/lint/lint-stable-017-configs
@@ -19,7 +19,9 @@ LC_ALL=C export LC_ALL
SYMBOLS='CONFIG_ARCH_\|CONFIG_MAINBOARD_HAS_'
# 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="git grep -l"
else
GREP="grep -rl"