Skip to content

localrepo: Fix bug when adding tree entries

John Cai requested to merge jc/fix-add-tree-entry into master

The code to add tree entries contained a bug whereby a path like dirA/file/dirB/file would only create the path dirA/file due to faulty matching logic. If the filename being added is the same as one of the directories, the loop would end prematurely.

Fix this by ensuring that we are actually at the end of the path by checking secondComponent.

fixes: gitlab#440170 (closed)

Edited by John Cai

Merge request reports