Use mutexes to lock git access
Use mutexes to lock git access

Added 2 levels of locks. The first is for getting a repository. This
means that only a single repo can be cloned or updated at once now. This
is so that 2 updates to the same repo don't start cloning the repo
twice. Could do something more advanced with locking cloning/fetching
for a certain path, but I think it's an overkill, as clones should be
rare and fetches should be fast.

The second, and more important, lock is for each repo. Git handles
locking for each repo itself as well, but this means that simple git
commands could fail only because we called them at the wrong time. By
handling the locking on the application level as well, we can avoid
theses failures. All commands to a single repo are locked, even if
they're basically only *read* actions. All repos handled by the
application will now be held in memory for the entire lifetime of the
application.

salemove/github-review-helper