Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: cpplint.py

Issue 1919483002: Revert of Convert cpplint.py to work with nested git repositories. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cpplint.py
diff --git a/cpplint.py b/cpplint.py
index 4b067d473b32970301ea1ad158aed24e452bea06..27def382726681d2a1254b1c6782a669482332f7 100755
--- a/cpplint.py
+++ b/cpplint.py
@@ -1014,13 +1014,12 @@
# Not SVN <= 1.6? Try to find a git, hg, or svn top level directory by
# searching up from the current path.
- root_dir = current_dir = os.path.dirname(fullname)
- while current_dir != os.path.dirname(current_dir):
- if (os.path.exists(os.path.join(current_dir, ".git")) or
- os.path.exists(os.path.join(current_dir, ".hg")) or
- os.path.exists(os.path.join(current_dir, ".svn"))):
- root_dir = current_dir
- current_dir = os.path.dirname(current_dir)
+ root_dir = os.path.dirname(fullname)
+ while (root_dir != os.path.dirname(root_dir) and
+ not os.path.exists(os.path.join(root_dir, ".git")) and
+ not os.path.exists(os.path.join(root_dir, ".hg")) and
+ not os.path.exists(os.path.join(root_dir, ".svn"))):
+ root_dir = os.path.dirname(root_dir)
if (os.path.exists(os.path.join(root_dir, ".git")) or
os.path.exists(os.path.join(root_dir, ".hg")) or
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698