X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=set-commit-date.py;h=c5d49d4225e7864bfdc7710e83179da805d0289b;hb=2c654e316392a8b3523ea0495902372d54548e1c;hp=9588bd87aa26e991006637b3e7779c2df82ffa99;hpb=be308b7b8c887a71e26a8044bba3b334487452b5;p=git-scripts.git diff --git a/set-commit-date.py b/set-commit-date.py index 9588bd8..c5d49d4 100755 --- a/set-commit-date.py +++ b/set-commit-date.py @@ -18,7 +18,10 @@ filenames = set() # 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: @@ -30,8 +33,6 @@ while True: continue stage = 4 assert line == '', line - elif not line: # EOF - break elif stage == 4: filename = line if filename not in filenames: