From: Oleg Broytman Date: Fri, 18 Jan 2019 03:12:29 +0000 (+0300) Subject: Add scripts to run fsck of all repositories X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=bd3b9c6f98e238045baa88f0c9120b527099ad6d;p=git-scripts.git Add scripts to run fsck of all repositories --- diff --git a/fsck b/fsck new file mode 100755 index 0000000..14f2ac5 --- /dev/null +++ b/fsck @@ -0,0 +1,2 @@ +#! /bin/sh +exec git fsck --strict diff --git a/fsck-recursive b/fsck-recursive new file mode 100755 index 0000000..3e47bd2 --- /dev/null +++ b/fsck-recursive @@ -0,0 +1,8 @@ +#! /bin/sh + +prog_dir="`dirname \"$0\"`" && +"$prog_dir"/fsck && + +if [ -f .gitmodules ]; then + exec git submodule foreach "$prog_dir"/fsck +fi diff --git a/fsck-repos b/fsck-repos new file mode 100755 index 0000000..a31c8bb --- /dev/null +++ b/fsck-repos @@ -0,0 +1,9 @@ +#! /bin/sh + +cd "`dirname \"$0\"`" && +prog_dir="`pwd`" && +export prog_dir + +exec "$prog_dir"/do-all \ + 'echo "----- $d -----" && cd "$d" &&' \ + '"$prog_dir"/fsck-recursive || exit 1'