filter-repo: avoid accidental output after 'done' directive

Using fast-import's feature done capability, any output sent to it after
the 'done' directive will be ignored.  We do not intend to send any such
information, but there have been a couple cases where an accident while
refactoring the code resulted in some information being sent after the
done directive.  To avoid having to debug that again, just close the
output stream after sending the 'done' directive to ensure that we get
an immediate and clear error if we ever run into such a situation again.

Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
Elijah Newren 2019-05-23 17:37:09 -07:00
parent 8e482d18a5
commit e97b195229

View File

@ -1801,6 +1801,9 @@ class FastExportFilter(object):
elif self._currentline.startswith(b'done'):
self._handle_final_commands()
self._parse_literal_command()
# Prevent confusion from others writing additional stuff that'll just
# be ignored
self._output.close()
elif self._currentline.startswith(b'#'):
self._parse_literal_command()
elif self._currentline.startswith(b'get-mark') or \