From: Martin Liska Date: Tue, 30 Jun 2020 15:44:45 +0000 (+0200) Subject: gcc-changelog: support older GitPython releases. X-Git-Tag: basepoints/gcc-12~6523 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2c17dcb120813a715e4cfb7559803839d3806d9;p=thirdparty%2Fgcc.git gcc-changelog: support older GitPython releases. contrib/ChangeLog: * gcc-changelog/git_repository.py: Support older releases of GitPython when renamed_file was named renamed. --- diff --git a/contrib/gcc-changelog/git_repository.py b/contrib/gcc-changelog/git_repository.py index 4f0d21af0396..90edc3ce3d89 100755 --- a/contrib/gcc-changelog/git_repository.py +++ b/contrib/gcc-changelog/git_repository.py @@ -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.