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>
diff --git a/project.py b/project.py
index b70f6d4..8490d9f 100644
--- a/project.py
+++ b/project.py
@@ -2554,7 +2554,10 @@
# 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)