diff options
author | Rob Austein <sra@hactrn.net> | 2016-03-03 14:09:46 -0500 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2016-03-03 14:09:46 -0500 |
commit | 6b1074775e5f62541a31240e8abf44b5cd95b700 (patch) | |
tree | 0bf8beedd420ab30c7870efb4e090be7e62f0e94 | |
parent | 396c1a1013e3c66355d623c105c34a2f1f00de6c (diff) |
Simplify directory walk loop (old change).
-rwxr-xr-x | what-branches.py | 9 |
1 files 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 |