From 8e908b221f13167389e780593f12ea4fd168b4b3 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Mon, 24 Oct 2022 08:03:20 -0700 Subject: [PATCH] The --why parameter in whichgit should be optional Test: ./build/make/tools/whichgit --modules out/target/product/coral/system.img Change-Id: Ibc6e208d75c8e68c8130dc9ba3fc7af51390691b --- tools/whichgit | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/whichgit b/tools/whichgit index 24d6d87d36..b0bf2e42f8 100755 --- a/tools/whichgit +++ b/tools/whichgit @@ -95,11 +95,12 @@ def main(argv): # 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)): print(project) - if "*" in args.why or project in args.why: - prefix = project + "/" - for f in sources: - if f.startswith(prefix): - print(" " + f) + if args.why: + if "*" in args.why or project in args.why: + prefix = project + "/" + for f in sources: + if f.startswith(prefix): + print(" " + f) if __name__ == "__main__":