Force conn-only checks on repos using objstore

There's no need to run full fsck on repositories that use objstore
repos, because we'll end up checking the same objects over and over
again. Just check connectivity and let full fsck run happen on the
actual objstore repo.

Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
diff --git a/grokmirror/fsck.py b/grokmirror/fsck.py
index 0556afb..9549e19 100755
--- a/grokmirror/fsck.py
+++ b/grokmirror/fsck.py
@@ -329,6 +329,12 @@
 
 def run_git_fsck(fullpath, config, conn_only=False):
     args = ['fsck', '--no-progress', '--no-dangling', '--no-reflogs']
+    obstdir = os.path.realpath(config['core'].get('objstore'))
+    # If it's got an obstrepo, always run as connectivity-only
+    altrepo = grokmirror.get_altrepo(fullpath)
+    if altrepo and grokmirror.is_obstrepo(altrepo, obstdir):
+        logger.debug('Repo uses objstore, forcing connectivity-only')
+        conn_only = True
     if conn_only:
         args.append('--connectivity-only')
         logger.info('     fsck: running with --connectivity-only')