From: Karel Zak Date: Wed, 19 Feb 2025 17:52:20 +0000 (+0100) Subject: tools/git-tp-sync: require git X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=080e11a38f9526201ff4cf99ae6c4e06c95cfbf0;p=thirdparty%2Futil-linux.git tools/git-tp-sync: require git Signed-off-by: Karel Zak --- diff --git a/tools/git-tp-sync b/tools/git-tp-sync index bad3ecb99..00c847b91 100755 --- a/tools/git-tp-sync +++ b/tools/git-tp-sync @@ -52,6 +52,12 @@ while [[ $# -gt 0 ]]; do esac done +git rev-parse --is-inside-work-tree &> /dev/null +if [ "$?" -ne 0 ]; then + echo "Must be called within a Git working tree." + exit 1 +fi + # default to all dirs defined by TP_PROJECTS if [ ${#DIRS[@]} -eq 0 ]; then DIRS=( ${!TP_PROJECTS[@]} )