Prepare sub repos for tests

Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
Václav Valíček 2022-07-27 10:23:50 +02:00
parent 0e36b1dd78
commit 4662c7de47
Signed by: valicek
GPG Key ID: FF05BDCA0C73BB31

View File

@ -15,3 +15,13 @@ mkdir -p tool_repos/uninitialized.git
git init --bare tool_repos/initialized.git
git init tool_repos/non-bare-init
echo "Preparing submodules for tests.."
for repo in test-repo-*
do
echo ">> $repo"
cd $repo
for i in $(git for-each-ref --format="%(refname:short)" --no-merged=origin/HEAD refs/remotes/origin); do git switch --track $i; done
cd ..
done
# recover submodules to initial state (branches will remain)
git submodule update --init