bin/find-german-comments | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
New commits: commit 294c78fd65e62f8061dc2d54a4c8b1baa554e407 Author: Michael Meeks <[email protected]> Date: Thu Jan 26 17:47:45 2017 +0000 German comment finding - simplify top-level detection. Change-Id: Ic75b4fbb84687a86f7eca52f82dd337244339c42 Reviewed-on: https://gerrit.libreoffice.org/33595 Tested-by: Jenkins <[email protected]> Reviewed-by: Michael Meeks <[email protected]> diff --git a/bin/find-german-comments b/bin/find-german-comments index 40b4c9b..13653d9 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() _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
