Updated line.startswith("tree")

Addressed the issue where:
1. line.startswith("tree") was inside the line.startswith("test") block
2. Recovered repos_root_dir and deleted the checking of subdirectory