Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _from_change_to_modification_type(diff: Diff):
if diff.new_file:
return ModificationType.ADD
if diff.deleted_file:
return ModificationType.DELETE
if diff.renamed_file:
return ModificationType.RENAME
if diff.a_blob and diff.b_blob and diff.a_blob != diff.b_blob:
return ModificationType.MODIFY
return ModificationType.UNKNOWN