gcc-changelog: support older GitPython releases.

contrib/ChangeLog:

	* gcc-changelog/git_repository.py: Support older releases of
	GitPython when renamed_file was named renamed.
This commit is contained in:
Martin Liska 2020-06-30 17:44:45 +02:00
parent eef63aacb2
commit e2c17dcb12
No known key found for this signature in database
GPG Key ID: 4DC182DC0FA73785
1 changed files with 5 additions and 1 deletions

View File

@ -39,11 +39,15 @@ def parse_git_revisions(repo_path, revisions, strict=False):
modified_files = []
for file in diff:
if hasattr(file, 'renamed_file'):
is_renamed = file.renamed_file
else:
is_renamed = file.renamed
if file.new_file:
t = 'A'
elif file.deleted_file:
t = 'D'
elif file.renamed_file:
elif is_renamed:
# Consider that renamed files are two operations:
# the deletion of the original name
# and the addition of the new one.