From 690c824fada8f3374c870bb102eb20d33c651838 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Tue, 12 Mar 2019 11:26:21 -0700 Subject: [PATCH] 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 --- git-filter-repo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-filter-repo b/git-filter-repo index 9077d34..5082c48 100755 --- a/git-filter-repo +++ b/git-filter-repo @@ -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)