git pull returns Success when already has all changes
Describe the bug
When pulling from a git repository it outputs the Success state in situations where it should output No Changes
debug output:
[lima] >>> sh -c 'cd /home/fimdomeio.linux/src/neovim && git pull'
[lima] Already up to date.
To Reproduce
pull from a repo.
I'm running this operation:
git.repo(
name="pull from neovim repo",
src="https://github.com/neovim/neovim",
dest="/home/fimdomeio.linux/src/neovim",
)
operating system is a Ubuntu Virtual Machine (Ubuntu 23.04)
Expected behavior
I expect "No changes" as a Status
Meta
pyinfra --support
System: Darwin
Platform: macOS-13.4.1-arm64-arm-64bit
Release: 22.5.0
Machine: arm64
pyinfra: v2.7
Executable: /Users/fimdomeio/.local/bin/pyinfra
Python: 3.11.4 (CPython, Clang 14.0.3 (clang-1403.0.22.14.1))
installed with pipx
The “success” bit is determined as “did run any commands”, in the case of git it the “git pull” command. I think this is correct (it did run, it did succeed), pyinfra is thinking on the command level rather than git itself.
We could, I think, use git fetch to pre-check for changes and only pull if so which would resolve this, though I’m not sure in reality if this is a problem?