Skip to content

Commit 0e2c9ec

Browse files
auto-cache: added test for renamed remote default branch
1 parent 9adb995 commit 0e2c9ec

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_project_caching.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,23 @@ 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+
with chdir(foo_remote):
413+
subprocess.check_call([GIT, 'branch', '-m', 'master', 'renamed-master'])
414+
with chdir(bar_remote):
415+
subprocess.check_call([GIT, 'branch', '-m', 'master', 'changed/main'])
416+
with chdir(auto_cache_dir_foo):
417+
subprocess.check_call([GIT, 'remote', 'update', '--prune'])
418+
with chdir(auto_cache_dir_bar):
419+
subprocess.check_call([GIT, 'remote', 'update', '--prune'])
420+
421+
# west update must succeed
422+
setup_workspace_and_west_update(
423+
tmpdir / 'workspace5',
424+
foo_head='renamed-master',
425+
bar_head='changed/main',
426+
)
427+
411428

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

0 commit comments

Comments
 (0)