From: Oleg Broytman Date: Mon, 26 Feb 2018 19:48:29 +0000 (+0300) Subject: Feat(submodule): Test .gitmodules before running `git submodule` X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=cd2022e1e1db8e89f7fae123057a51392862ccf4;p=git-scripts.git Feat(submodule): Test .gitmodules before running `git submodule` --- diff --git a/gc-not-packed-recursive b/gc-not-packed-recursive index 46572cc..ca17043 100755 --- a/gc-not-packed-recursive +++ b/gc-not-packed-recursive @@ -1,7 +1,8 @@ #! /bin/sh prog_dir="`dirname \"$0\"`" && +"$prog_dir"/gc-not-packed && -"$prog_dir"/gc-not-packed || exit 1 -git submodule foreach "$prog_dir"/gc-not-packed -exit 0 # Ignore errors from git submodule in bare repos +if [ -f .gitmodules ]; then + exec git submodule foreach "$prog_dir"/gc-not-packed +fi diff --git a/gc-repack-recursive b/gc-repack-recursive index b7da6e6..af5f067 100755 --- a/gc-repack-recursive +++ b/gc-repack-recursive @@ -1,7 +1,8 @@ #! /bin/sh prog_dir="`dirname \"$0\"`" && +"$prog_dir"/gc-repack && -"$prog_dir"/gc-repack || exit 1 -git submodule foreach "$prog_dir"/gc-repack -exit 0 # Ignore errors from git submodule in bare repos +if [ -f .gitmodules ]; then + exec git submodule foreach "$prog_dir"/gc-repack +fi diff --git a/set-commit-date-recursive b/set-commit-date-recursive index 465f5fa..2caa688 100755 --- a/set-commit-date-recursive +++ b/set-commit-date-recursive @@ -3,6 +3,8 @@ # Call set-commit-date on the repo and all submodules prog_dir="`dirname \"$0\"`" && - "$prog_dir"/set-commit-date.py && \ -exec git submodule foreach "$prog_dir"/set-commit-date.py + +if [ -f .gitmodules ]; then + exec git submodule foreach "$prog_dir"/set-commit-date.py +fi