# stages: 1 - start of commit, 2 - timestamp, 3 - empty line, 4 - files
stage = 1
while True:
- line = git_log.stdout.readline().strip()
+ line = git_log.stdout.readline()
+ if not line: # EOF
+ break
+ line = line.strip()
if (stage in (1, 4)) and (line == separator): # Start of a commit
stage = 2
elif stage == 2:
continue
stage = 4
assert line == '', line
- elif not line: # EOF
- break
elif stage == 4:
filename = line
if filename not in filenames: