Fix link assignment for existing control files
Description of bug
The commit script was assigning wrong links when a link was pointing to a directory not in the current commit.
Changes introduced
Fix link assignment
Tests
Issues resolved
Closes #144 (closed)