Skip to content

Commit

Permalink
delete stashed modifications when stash node or subtree
Browse files Browse the repository at this point in the history
Signed-off-by: walid-sahnoun <[email protected]>
  • Loading branch information
Walid-Sahnoun committed Sep 19, 2023
1 parent 9e0daaa commit 7563f5e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ public void deleteStashedModificationGroup(UUID groupUuid, boolean errorOnGroupN
try {
ModificationGroupEntity groupEntity = getModificationGroup(groupUuid);
if (!groupEntity.getModifications().isEmpty()) {
modificationRepository.deleteAll(groupEntity.getModifications().stream().filter(modificationEntity -> modificationEntity.getStashed().equals(true)).collect(Collectors.toList()));
List<UUID> stashedModifications = groupEntity.getModifications().stream()
.filter(modificationEntity -> modificationEntity.getStashed()).map(modification -> modification.getId()).collect(Collectors.toList());
deleteModifications(groupUuid, stashedModifications);
}
} catch (NetworkModificationException e) {
if (e.getType() == MODIFICATION_GROUP_NOT_FOUND && !errorOnGroupNotFound) {
Expand Down

0 comments on commit 7563f5e

Please sign in to comment.