Describe the bug
When changing src of git.repo for an existing working copy, the new value of src is not assigned to the working copy's origin.
Consequently, after switching to a remote with newer commits, those are not present in the working copy.
To Reproduce
# File: git_repo_does_not_honor_change_of_src.py
from pyinfra.operations import git
from os import path
tmp_dir = "/tmp/git_repo_does_not_honor_change_of_src"
repo_original = "https://github.com/ansible/ansible"
repo_changed = "https://github.com/pyinfra-dev/pyinfra.git"
git.repo(dest=tmp_dir, src=repo_original)
git.repo(dest=tmp_dir, src=repo_changed)
# Run commands
uv run pyinfra @local git_repo_does_not_honor_change_of_src.py
(cd /tmp/git_repo_does_not_honor_change_of_src && git remote -v) # Still Ansible :(
Expected behavior
The repository's origin is updated to src, with new commits visible. (Above example doesn't make sense as there is no common ancestry or set of files.)
Meta
Pyinfra 3.8.
Describe the bug
When changing
srcof git.repo for an existing working copy, the new value of src is not assigned to the working copy'sorigin.Consequently, after switching to a remote with newer commits, those are not present in the working copy.
To Reproduce
Expected behavior
The repository's
originis updated tosrc, with new commits visible. (Above example doesn't make sense as there is no common ancestry or set of files.)Meta
Pyinfra 3.8.