]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tools/git-tp-sync: require git
authorKarel Zak <kzak@redhat.com>
Wed, 19 Feb 2025 17:52:20 +0000 (18:52 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 19 Feb 2025 17:52:20 +0000 (18:52 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
tools/git-tp-sync

index bad3ecb99b83c2e81a55a7a814b2466e5e64e9f3..00c847b91c02fbf01a289d146e3f465594574de7 100755 (executable)
@@ -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[@]} )