Adjust figuring out the path of the git repo cloned
If the repo was cloned into a target, then target is the new location
if there was not target but the repo was cloned to a bare repo, then
bare_dir is the new location, otherwise it's module
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>