Hello,
I'm using GitPython 3.0.2 and noticed that git.Diffable cannot properly handle copied files (C). I realize this kind of change type is seldom used so it might be a known issue, but since I couldn't find anyone reporting it I thought I'd just make sure that everyone's aware of it.
How to reproduce
Prepare the demo repo:
mkdir test
cd test
git init
dd if=/dev/urandom of=test1.txt bs=1M count=1
git add . && git commit -m "1"
cp test1.txt test2.txt
git add . && git commit -m "2"
On Python
from git import Repo
from os import getcwd
hcommit = Repo(getcwd()).head.commit
diffs = hcommit.diff('HEAD~1', R=True, find_copies_harder=True)
You will observe that:
diffs[0].change_type correctly outputs C instead of C100
- Both
diffs[0].a_path and diffs[0].b_path will output test1.txt\ttest2.txt intead of a_path being test1.txt and b_path being test2.txt.
Thanks!
Hello,
I'm using GitPython
3.0.2and noticed thatgit.Diffablecannot properly handle copied files (C). I realize this kind of change type is seldom used so it might be a known issue, but since I couldn't find anyone reporting it I thought I'd just make sure that everyone's aware of it.How to reproduce
Prepare the demo repo:
On Python
You will observe that:
diffs[0].change_typecorrectly outputsCinstead ofC100diffs[0].a_pathanddiffs[0].b_pathwill outputtest1.txt\ttest2.txtintead ofa_pathbeingtest1.txtandb_pathbeingtest2.txt.Thanks!