Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit c760e2b

Browse files
committed
Prune remote branches before submodule update.
Attempting to update branches that don't exist in the remote repository any more will cause problems.
1 parent 58f962c commit c760e2b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/update_submodules.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,9 @@ def process_repository(path, remote, branches=None):
201201
# Make sure all submodules have been initialised and checked out
202202
init_submodules(path)
203203

204-
# Fetch from the remote
205-
cmd = ['fetch', remote]
204+
# Fetch from the remote, removing any branches that don't exist
205+
# any more.
206+
cmd = ['fetch', '--prune', remote]
206207
git_cmd(path, cmd)
207208

208209
# Process each branch

0 commit comments

Comments
 (0)