Dulwich.io dulwich / b29129d
Clean get_unstaged_changes error handling Boris Feld 3 months ago
1 changed file(s) with 6 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
651651
652652 if filter_blob_callback is not None:
653653 blob = filter_blob_callback(blob, tree_path)
654 except OSError as e:
654 except (OSError, IOError) as e:
655655 directory_changed = has_directory_changed(e, tree_path, entry)
656656 if directory_changed:
657657 yield tree_path
658658 else:
659 if e.errno != errno.ENOENT:
659 if e.errno == errno.ENOENT:
660 # The file was removed, so we assume that counts as
661 # different from whatever file used to exist.
662 yield tree_path
663 else:
660664 raise
661 # The file was removed, so we assume that counts as
662 # different from whatever file used to exist.
663 yield tree_path
664 except IOError as e:
665 directory_changed = has_directory_changed(e, tree_path, entry)
666 if directory_changed:
667 yield tree_path
668 else:
669 raise
670665 else:
671666 if blob.id != entry.sha:
672667 yield tree_path