From b550501254a0a10d4ea356331ee054d47c4ddc75 Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Fri, 21 Jan 2022 23:09:19 +0100 Subject: [PATCH] project: Ignore failure to remove the sample hooks Removing the sample hooks is just clean up, so if repo cannot remove a sample hook that should not cause it to fail. Change-Id: I716b977da091c22b8f53e134f4fbc114116f9a65 Signed-off-by: Peter Kjellerstedt Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/328635 Reviewed-by: Mike Frysinger --- project.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/project.py b/project.py index b70f6d41..8490d9f9 100644 --- a/project.py +++ b/project.py @@ -2554,7 +2554,10 @@ class Project(object): # Delete sample hooks. They're noise. for hook in glob.glob(os.path.join(hooks, '*.sample')): - platform_utils.remove(hook, missing_ok=True) + try: + platform_utils.remove(hook, missing_ok=True) + except PermissionError: + pass for stock_hook in _ProjectHooks(): name = os.path.basename(stock_hook)