diff options
-rwxr-xr-x | bin/find-german-comments | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/bin/find-german-comments b/bin/find-german-comments index 40b4c9baca51..13653d9e03de 100755 --- a/bin/find-german-comments +++ b/bin/find-german-comments @@ -226,16 +226,14 @@ class Parser: """ checks each _tracked_ file in a directory recursively """ + + # top-level project directory -> use whitelist. globalscan = False - if re.match(r'.*/core$', os.getcwd()) and directory == '.': - globalscan = True + if os.path.exists(directory + "/.git/config"): + globalscan = True # Change into the given dir, so "git ls-tree" does work. - # If we want to scan the current dir, we must not do so as we are already there. - if not globalscan and directory != '.': - currentdir = os.getcwd() - os.chdir(currentdir.split("core", 1)[0] + "core/") - os.chdir(directory) + os.chdir(directory) sock = os.popen(r"git ls-tree -r HEAD --name-only |egrep '\.(c|cc|cpp|cxx|h|hxx|mm)$'") lines = sock.readlines() |