[patch 2/4] Fix local repository handling