summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-11-11 15:42:31 +0100
committerSlávek Banko <slavek.banko@axis.cz>2020-11-11 15:42:46 +0100
commit5b81e0aa93702515e5ced5a1ebde5bcb1065190e (patch)
treeb245b797ed8e043517115774dbea40c4f1075ec0
parent1215cfd777e3f1c53989814d79f0716bf6d5f9db (diff)
downloadscripts-5b81e0aa.tar.gz
scripts-5b81e0aa.zip
switch_all_submodules_to_head_and_clean: Clean up abandoned worktrees
before adding a new worktree. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rwxr-xr-xswitch_all_submodules_to_head_and_clean1
1 files changed, 1 insertions, 0 deletions
diff --git a/switch_all_submodules_to_head_and_clean b/switch_all_submodules_to_head_and_clean
index 5ca3d13..2c136fd 100755
--- a/switch_all_submodules_to_head_and_clean
+++ b/switch_all_submodules_to_head_and_clean
@@ -134,6 +134,7 @@ updateModule() {
(
cd $REPO_LOCALTREE &&
git fetch &&
+ git worktree prune &&
git worktree add $PARENTDIR/$MODULE$submodule $branch &&
cd $PARENTDIR/$MODULE$submodule &&
git branch --set-upstream-to=origin/$branch