Skip to content
Snippets Groups Projects
Commit 012a3a40 authored by Jonas Haag's avatar Jonas Haag
Browse files

Handle type changes in history (folder -> file, file -> symlink etc)

parent 4ec3205d
No related branches found
No related tags found
No related merge requests found
......@@ -65,11 +65,17 @@ class RepoWrapper(dulwich.repo.Repo):
def _path_changed_between(self, path, commit1, commit2):
path, filename = os.path.split(path)
try:
blob1 = self.get_tree(commit1, path)[filename]
blob1 = self.get_tree(commit1, path)
if not isinstance(blob1, dulwich.objects.Tree):
return True
blob1 = blob1[filename]
except KeyError:
blob1 = None
try:
blob2 = self.get_tree(commit2, path)[filename]
blob2 = self.get_tree(commit2, path)
if not isinstance(blob2, dulwich.objects.Tree):
return True
blob2 = blob2[filename]
except KeyError:
blob2 = None
if blob1 is None and blob2 is None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment