import pygit2
repo = pygit2.Repository(pygit2.discover_repository(<repo_path>))
status = repo.status()
for filepath, flags in status.items():
print(filepath, flags)
On branch master
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
renamed: mvvv.txt -> mvv.txt
new file: x/mvvv.txt
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: mvv.txt
deleted: x/mvvv.txt
deleted: zname.py
Untracked files:
(use "git add <file>..." to include in what will be committed)
.idea/
child.py
example.py
name2.py
parent.py
x/mvv.txt
x/parent2.py
xname.py
zname1.py
Which contains the renamed records.
Why this happened?
(If you want the test repo, I can zip it and send to your team mail if anyone provide me one.)
Test code:
Running Result:
However,
git status
given me the result as:Which contains the renamed records.
Why this happened? (If you want the test repo, I can zip it and send to your team mail if anyone provide me one.)