From: Oleg Broytman Date: Sat, 3 Aug 2019 11:22:42 +0000 (+0300) Subject: Refactor(set-commit-date.py): Combine 2 conditions X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=commitdiff_plain;h=a0f5c1217294a1a72b71bc94fd80760b0393e775 Refactor(set-commit-date.py): Combine 2 conditions --- diff --git a/set-commit-date.py b/set-commit-date.py index 4530252..a88c5de 100755 --- a/set-commit-date.py +++ b/set-commit-date.py @@ -43,9 +43,9 @@ for line in git_log.stdout: filename = line.split(None, 2)[1] elif line.startswith('R'): filename = line.split(None, 3)[2] # renamed to - if line.startswith('D'): - if filename not in changed_files: # The file was not readded - deleted_files.add(filename) + if line.startswith('D') and filename not in changed_files: + # The file was not readded + deleted_files.add(filename) if filename not in deleted_files and filename not in changed_files: changed_files.add(filename) if os.path.exists(filename):