-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking empty files #248
Comments
Hi!
Result:
And indeed, if we run
|
Excuse me but I didn't get it. Why do i see this?
And this?
|
Oh thanks, now I saw it. Indeed, in this specific case, looks like GitPython returns the wrong information:
For some reason GitPython thinks the file is a rename of a file that doesn't even exists. I will need to open an issue on GitPython side. |
I was able to reproduce locally:
Then run:
Both paths will be the same. |
Indeed I remembered this kind of problem was raised before. Turns out that 4 years ago I opened a PR about this: gitpython-developers/GitPython#749 I never managed to work on it. |
Ok. Thank you so much for your time! |
Tracking the history of a file, I saw that the class ModifiedFile for empty files can not retrive correctly the info about old_path for them creation (it should be None but we have the same path of new_path) and new_path for them deletion (should be None but it remains the same).
It happens often dealing with "_init_.py"
I think the problem (if it's a problem) could be in parsing the git diff when there are no modified lines.
Here is what happens by parsing your repo for the creation of 'pydriller/tests/integration/_init_.py' :
-- old_path = {str} 'pydriller/tests/integration/_init_.py'
-- source_code_before = {NoneType} None
-- new_path = {str} 'pydriller/tests/integration/_init_.py'
-- source_code = {str} ''
with command:
git diff 4be0402~ 4be0402
...
diff --git a/pydriller/tests/integration/_init_.py b/pydriller/tests/integration/_init_.py
new file mode 100644
index 0000000..e69de29
...
Am I missing something?
Thanks for your time.
The text was updated successfully, but these errors were encountered: