From 97be2fd71cbc46702e38d21ca6f98ad390b65cf5 Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont (@ardumont)" <antoine.romain.dumont@gmail.com> Date: Thu, 31 Mar 2016 20:41:14 +0200 Subject: [PATCH] Fix: Delete paths below the path removal deletion --- swh/model/git.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/swh/model/git.py b/swh/model/git.py index d4ae1666..034279c5 100644 --- a/swh/model/git.py +++ b/swh/model/git.py @@ -330,7 +330,6 @@ def recompute_sha1_in_memory(root, deeper_rootdir, objects): # update root objects[ROOT_TREE_KEY][0]['sha1_git'] = compute_directory_git_sha1(root, objects) - return objects @@ -362,7 +361,9 @@ def update_checksums_from(changed_paths, objects, for changed_path in changed_paths: path = changed_path['path'] if changed_path['action'] == 'D': - objects.pop(path, None) + new_objects = {k: objects[k] for k in objects.keys() + if not k.startswith(path)} + objects = new_objects rootdir = os.path.dirname(path) if not os.path.exists(rootdir): -- GitLab