filter-repo: avoid coverage testing renames from fast-export

We don't run fast-export with rename detection, even though we have
code for handling it, because we decided to use a rev-list|diff-tree
pipeline instead.  The code was manually tested and determined to be
working and it might be useful in the future so I don't want to just
outright delete it, but since we know we can't trigger it right now,
add a
   # pragma: no cover
on these lines so it doesn't show up on coverage reports.

Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
Elijah Newren 2019-03-12 11:26:21 -07:00
parent 0e4d48158f
commit 690c824fad

View File

@ -498,7 +498,7 @@ class FileChanges(_GitElement):
self.blob_id = id_
# For 'R' file changes (rename), expect to have newname as third arg
elif type_ == 'R':
elif type_ == 'R': # pragma: no cover (now avoid fast-export renames)
if id_ is None:
raise SystemExit("new name needed for rename of %s" % filename)
self.filename = (self.filename, id_)
@ -980,7 +980,7 @@ class FastExportFilter(object):
path = PathQuoting.dequote(path)
filechange = FileChanges('D', path)
self._advance_currentline()
elif changetype == 'R':
elif changetype == 'R': # pragma: no cover (now avoid fast-export renames)
rest = self._currentline[2:-1]
if rest.startswith('"'):
m = self._quoted_string_re.match(rest)