-
-
Notifications
You must be signed in to change notification settings - Fork 960
Closed
Labels
Description
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_typecorrectly outputsCinstead ofC100- Both
diffs[0].a_pathanddiffs[0].b_pathwill outputtest1.txt\ttest2.txtintead ofa_pathbeingtest1.txtandb_pathbeingtest2.txt.
Thanks!