Skip to content

Commit 229d7ae

Browse files
auto-cache: added test for renamed remote default branch
1 parent 61c1e1a commit 229d7ae

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_project_caching.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,19 @@ def setup_workspace_and_west_update(workspace, foo_head, bar_head):
408408
for msg in msgs:
409409
assert msg in stdout
410410

411+
# Rename remote default branches and update remote (results in dangling remote HEAD).
412+
subprocess.check_call([GIT, 'branch', '-m', 'master', 'renamed-master'], cwd=foo_remote)
413+
subprocess.check_call([GIT, 'branch', '-m', 'master', 'changed/main'], cwd=bar_remote)
414+
subprocess.check_call([GIT, 'remote', 'update', '--prune'], cwd=auto_cache_dir_foo)
415+
subprocess.check_call([GIT, 'remote', 'update', '--prune'], cwd=auto_cache_dir_bar)
416+
417+
# west update must succeed
418+
setup_workspace_and_west_update(
419+
tmpdir / 'workspace5',
420+
foo_head='renamed-master',
421+
bar_head='changed/main',
422+
)
423+
411424

412425
def test_update_caches_priorities(tmpdir):
413426
# Test that the correct cache is used if multiple caches are specified

0 commit comments

Comments
 (0)