aboutsummaryrefslogtreecommitdiff
path: root/check-git-repos.py
diff options
context:
space:
mode:
Diffstat (limited to 'check-git-repos.py')
-rwxr-xr-xcheck-git-repos.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/check-git-repos.py b/check-git-repos.py
index 4b1d975..2363bba 100755
--- a/check-git-repos.py
+++ b/check-git-repos.py
@@ -85,9 +85,16 @@ def check_ref_status(path):
log.error(out)
-def check_export_file(path):
- if not os.path.exists(os.path.join(path, EXPORT_FILE)):
- log.warn("%s not found in %s", EXPORT_FILE, path)
+def check_file_exists(filepath, islink=False, linkpath=None):
+ if not os.path.exists(filepath):
+ log.warn("%s not found", filepath)
+ else:
+ if islink:
+ if not os.path.islink(filepath):
+ log.warn("%s is not a link as expected", filepath)
+ if linkpath:
+ if os.path.realpath(filepath) != linkpath:
+ log.warn("%s does not link to %s", filepath, linkpath)
def process(paths):
@@ -95,7 +102,8 @@ def process(paths):
refsfile = os.path.join(path, "info/refs")
perms_check(refsfile)
perms_check(path+"/objects/info/packs")
- # check_export_file(path)
+ # check_file_exists(os.path.join(path, EXPORT_FILE))
+ check_file_exists(path+"/hooks/post-update", True)
check_ref_status(path)