This pull request fixes the remaining item in #35 (git-bundle-server init behaves incorrectly when the specified route already exists). The update to fix this revealed a different bug affecting usage of ReadRepositoryStorage() (repair and, as of this PR, init) when the bundle server directory structure hasn't been created yet.
Commit 1 updates init to exit if it receives an error from CloneBareRepo(), rather than trying to continue with creating a base bundle (as it does now).
Commit 2 fixes the issue with ReadRepositoryStorage() by ensuring ReadDirRecursive() catches "missing entry" errors and returns an empty result rather than an error.
Commit 3 adds an explicit check for the specified route before CreateRepository(). If the route is found in the results of ReadRepositoryStorage(), exit with an error.
Closes #35
This pull request fixes the remaining item in #35 (
git-bundle-server init
behaves incorrectly when the specified route already exists). The update to fix this revealed a different bug affecting usage ofReadRepositoryStorage()
(repair
and, as of this PR,init
) when the bundle server directory structure hasn't been created yet.init
to exit if it receives an error fromCloneBareRepo()
, rather than trying to continue with creating a base bundle (as it does now).ReadRepositoryStorage()
by ensuringReadDirRecursive()
catches "missing entry" errors and returns an empty result rather than an error.CreateRepository()
. If the route is found in the results ofReadRepositoryStorage()
, exit with an error.