[Cryptech-Commits] [user/sra/build-tools] 02/02: Simplify directory walk loop (old change).
git at cryptech.is
git at cryptech.is
Thu May 5 21:49:07 UTC 2016
This is an automated email from the git hooks/post-receive script.
sra at hactrn.net pushed a commit to branch master
in repository user/sra/build-tools.
commit 6b1074775e5f62541a31240e8abf44b5cd95b700
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Thu Mar 3 14:09:46 2016 -0500
Simplify directory walk loop (old change).
---
what-branches.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/what-branches.py b/what-branches.py
index 4c90408..203b3d2 100755
--- a/what-branches.py
+++ b/what-branches.py
@@ -8,8 +8,7 @@ from sys import argv
for root in argv[1:] or listdir("."):
for head, dirs, files in walk(root):
- for dn in dirs:
- if dn == ".git" and not head.endswith("/gitolite"):
- print head
- for line in check_output(("git", "branch", "-a"), cwd = head).splitlines():
- print " ", line
+ if ".git" in dirs and not head.endswith("/gitolite"):
+ print head
+ for line in check_output(("git", "branch", "-a"), cwd = head).splitlines():
+ print " ", line
More information about the Commits
mailing list