From 889d6017bcc7c94e667bb4ef2ffbc003131dabf5 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 12 Apr 2016 13:42:12 +0300 Subject: [PATCH] Minor refactoring --- set-commit-date.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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: -- 2.39.2