Fix .git directory detection in repository directory traversing.
Optimize the checking for a package's presence in the repository
packages by using a hash for storing repo. package names and infos
instead of an array. Now it is not necessary to loop through the whole
repo. package array, it's just a defined() check on the package name in
the repo. package list hash.