Closed
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_type
correctly outputsC
instead ofC100
- Both
diffs[0].a_path
anddiffs[0].b_path
will outputtest1.txt\ttest2.txt
intead ofa_path
beingtest1.txt
andb_path
beingtest2.txt
.
Thanks!