MCPcopy Index your code
hub / github.com/jisaacks/GitGutter / _decode_diff

Method _decode_diff

modules/handler.py:403–422  ·  view source on GitHub ↗
(self, results)

Source from the content-addressed store, hash-verified

401 ))), decode=False).then(self._decode_diff)
402
403 def _decode_diff(self, results):
404 encoding = self.view_cache.python_friendly_encoding()
405 try:
406 decoded_results = results.decode(encoding)
407 except AttributeError:
408 # git returned None on stdout
409 decoded_results = ''
410 except UnicodeError:
411 try:
412 decoded_results = results.decode('utf-8')
413 except UnicodeDecodeError:
414 decoded_results = ''
415 except LookupError:
416 try:
417 decoded_results = codecs.decode(results)
418 except UnicodeDecodeError:
419 decoded_results = ''
420 # cache the diff result for reuse with diff_popup.
421 self._git_diff_cache = decoded_results
422 return self.process_diff(decoded_results)
423
424 @staticmethod
425 def process_diff(diff_str):

Callers

nothing calls this directly

Calls 2

process_diffMethod · 0.95

Tested by

no test coverage detected