From 98bb76577d9e7e0ffdeb643f1654ec006f6bbc8c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 20 Dec 2021 21:15:59 -0500 Subject: [PATCH] project: prune sample hooks These hooks are never used and often get stale, so just trim them. Users rarely look in these dirs to begin with. Change-Id: Ic785aa55fb7ec84a61376df101127d0018882030 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/327538 Reviewed-by: Jack Neus Tested-by: Mike Frysinger --- project.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/project.py b/project.py index edd748d0..338feffa 100644 --- a/project.py +++ b/project.py @@ -2548,6 +2548,11 @@ class Project(object): hooks = platform_utils.realpath(os.path.join(self.objdir, 'hooks')) if not os.path.exists(hooks): os.makedirs(hooks) + + # Delete sample hooks. They're noise. + for hook in glob.glob(os.path.join(hooks, '*.sample')): + platform_utils.remove(hook, missing_ok=True) + for stock_hook in _ProjectHooks(): name = os.path.basename(stock_hook)