Merge "The --why parameter in whichgit should be optional"

This commit is contained in:
Treehugger Robot
2022-10-25 20:08:59 +00:00
committed by Gerrit Code Review

View File

@@ -95,11 +95,12 @@ def main(argv):
# Print the list of git directories that has one or more of the sources in it # Print the list of git directories that has one or more of the sources in it
for project in sorted(get_referenced_projects(get_git_dirs(), sources)): for project in sorted(get_referenced_projects(get_git_dirs(), sources)):
print(project) print(project)
if "*" in args.why or project in args.why: if args.why:
prefix = project + "/" if "*" in args.why or project in args.why:
for f in sources: prefix = project + "/"
if f.startswith(prefix): for f in sources:
print(" " + f) if f.startswith(prefix):
print(" " + f)
if __name__ == "__main__": if __name__ == "__main__":