]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Git maintenance operations
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 25 Feb 2014 15:41:41 +0000 (12:41 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 25 Feb 2014 15:41:41 +0000 (12:41 -0300)
lib/keyringer/actions/check

index 098d163d309f33d4548967570153ca390062b7f5..83401b809a5994cf3a421a7dc77f9a006d6c830e 100755 (executable)
@@ -27,4 +27,13 @@ source "$LIB" || exit 1
 
 # This should be done here:
 # TODO: Check canaries' timestamps, warning by mail if configured by user preferences.
-# TODO: Git maintenance operations.
+
+# Git maintenance operations.
+if [ -d "$BASEDIR/.git" ]; then
+  echo "Running git maintenance operations..."
+  keyringer_exec git "$BASEDIR" fsck
+  keyringer_exec git "$BASEDIR" gc --prune=all
+else
+  echo "Fatal: not a git repository: $BASEDIR"
+  exit 1
+fi