summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorPeter Kjellerstedt <pkj@axis.com>2022-01-21 23:09:19 +0100
committerMike Frysinger <vapier@google.com>2022-01-22 06:13:10 +0000
commitb550501254a0a10d4ea356331ee054d47c4ddc75 (patch)
treecdf718db505f0bd456516e7a5e94a8cee8835e71 /project.py
parenta535ae441824171428877ce877a3b97c38548a85 (diff)
downloadgit-repo-b550501254a0a10d4ea356331ee054d47c4ddc75.tar.gz
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 <peter.kjellerstedt@axis.com> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/328635 Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'project.py')
-rw-r--r--project.py5
1 files changed, 4 insertions, 1 deletions
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):
2554 2554
2555 # Delete sample hooks. They're noise. 2555 # Delete sample hooks. They're noise.
2556 for hook in glob.glob(os.path.join(hooks, '*.sample')): 2556 for hook in glob.glob(os.path.join(hooks, '*.sample')):
2557 platform_utils.remove(hook, missing_ok=True) 2557 try:
2558 platform_utils.remove(hook, missing_ok=True)
2559 except PermissionError:
2560 pass
2558 2561
2559 for stock_hook in _ProjectHooks(): 2562 for stock_hook in _ProjectHooks():
2560 name = os.path.basename(stock_hook) 2563 name = os.path.basename(stock_hook)