From 4662c7de4737152d573379017482709ef5edc912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Val=C3=AD=C4=8Dek?= Date: Wed, 27 Jul 2022 10:23:50 +0200 Subject: [PATCH] Prepare sub repos for tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Václav Valíček --- tests/_support_data/gen-data.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/_support_data/gen-data.sh b/tests/_support_data/gen-data.sh index f2c5189..457157c 100755 --- a/tests/_support_data/gen-data.sh +++ b/tests/_support_data/gen-data.sh @@ -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