# @TEST-DOC: Test that the info doesn't recursively clone repos. The tested repository has a broken submodule in it and will fail to clone otherwise.
#
# @TEST-EXEC: bash %INPUT
# @TEST-EXEC: zkg info ./clonetest | grep -v "metadata file:" > clonetest.info
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff clonetest.info

zkg create --packagedir clonetest --user-var name=clonetest.gitmodules
cp zkg.meta clonetest/zkg.meta

pushd clonetest

git add zkg.meta && git commit -v -m "Update zkg.meta"

git submodule add "../$(basename $(realpath .))"
# Use a full URI so we go through the same Git machinery as a remote repo.
sed 's~url.*$~url = file:///dev/null/A-REPO-WHICH-SHOULD-NOT-EXIST~' .gitmodules > modules && mv modules .gitmodules
git add .gitmodules && git commit -v -m 'Add submodule'

# @TEST-START-FILE zkg.meta
[package]
build_command = ./configure && make
description = Zeek package with a broken submodule for testing 'zkg info'
# @TEST-END-FILE
