diff --git a/git-filter-repo b/git-filter-repo index 60ff51f..a76b90f 100755 --- a/git-filter-repo +++ b/git-filter-repo @@ -432,12 +432,12 @@ class _GitElement(object): raise SystemExit(_("Unimplemented function: %s") % type(self).__name__ +".dump()") # pragma: no cover - def __str__(self): + def __bytes__(self): """ Convert GitElement to string; used for debugging """ old_dumped = self.dumped - writeme = io.StringIO() + writeme = io.BytesIO() self.dump(writeme) output_lines = writeme.getvalue().splitlines() writeme.close() diff --git a/t/t9391/unusual.py b/t/t9391/unusual.py index 6817c65..c7a2c57 100755 --- a/t/t9391/unusual.py +++ b/t/t9391/unusual.py @@ -50,7 +50,7 @@ compare = "Blob:\n blob\n mark :1\n data {}\n {}".format(len(mystr), mystr) # debugging git-filter-repo; it is NOT something external folks should depend # upon. myblob = fr.Blob(mystr) -assert str(myblob) == compare +assert bytes(myblob) == compare # Everyone should be using RepoFilter objects, not FastExportFilter. But for # testing purposes... filter = fr.FastExportFilter('.', @@ -71,7 +71,7 @@ print("Found {} blobs/commits and {} other objects" .format(total_objects['common'], total_objects['uncommon'])) -stream = io.StringIO(textwrap.dedent(''' +stream = io.BytesIO(textwrap.dedent(''' blob mark :1 data 5