From 080e11a38f9526201ff4cf99ae6c4e06c95cfbf0 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 19 Feb 2025 18:52:20 +0100 Subject: [PATCH] tools/git-tp-sync: require git Signed-off-by: Karel Zak --- tools/git-tp-sync | 6 ++++++ 1 file changed, 6 insertions(+) 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[@]} ) -- 2.47.3