Backport 'jc/fix-add-tree-entry' into 16-8-stable

This MR backports the changes from !6670 (merged) into the 16-8-stable branch

Edited by John Cai

Merge request reports

Loading