X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=set-commit-date.py;h=c5d49d4225e7864bfdc7710e83179da805d0289b;hb=100447ea773288fbe043c6f63a2b5400222d1ab2;hp=70e393296053605689794d6aae43a7df67c7806d;hpb=5513a663e5a0665fb5ba30c1ce7056468376e679;p=git-scripts.git diff --git a/set-commit-date.py b/set-commit-date.py index 70e3932..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: - break elif stage == 4: filename = line if filename not in filenames: