feat: git-fsck-dirs, validate git repo objects

This commit is contained in:
2023-10-31 13:08:04 +02:00
parent bfe7e93b60
commit cec1edb269

23
local/bin/git-fsck-dirs Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# FSCK subfolders git projects.
#
# Actions taken: git fsck --no-dangling --full
#
# Copyright 2023 Ismo Vuorinen. All Rights Reserved.
# License: MIT <https://opensource.org/license/mit/>
STARTING_PATH=${1:-$(pwd)}
DIRS=$(find "$STARTING_PATH" -mindepth 1 -maxdepth 1 -type d)
for DIR in $DIRS; do
echo "-> Processing dir: $DIR"
cd "$DIR" || exit 1
if [ -d "$DIR/.git" ]; then
git fsck --no-dangling --full --no-progress
echo ""
fi
done
echo ""
echo "Done."