Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check .git dir in clone migration check
When the last part of the repository name is the same as the first part of it, the old -> new directory migration code is triggered, since a "top level" directory of the second part's name exists. In the least-bad case, where the `repos-dir` is separate from the znap or any other git repository, this triggers an unnecessary invocation of git, costing a few ms of startup time. However, the bad case is that some users seem to have set things up so that their `repos-dir` is a subdirectory of the znap repository. This causes the `git remote ...` call to succeed, triggering the full migration, and cloning the repository back into the same place. Instead of just checking for a directory's existence, we can check for a git repository's existence fairly cheaply by checking for the `git` directory. Fixes #257
- Loading branch information