Empty directories are invalid (ref #188)

This commit is contained in:
Jakob Borg 2014-05-12 21:30:04 -03:00
parent 1bf07d6b58
commit e8a9abaf40
1 changed files with 6 additions and 1 deletions

View File

@ -171,11 +171,16 @@ func readConfigXML(rd io.Reader, myID string) (Configuration, error) {
cfg.Options.ListenAddress = uniqueStrings(cfg.Options.ListenAddress)
// Check for missing or duplicate repository ID:s
// Check for missing, bad or duplicate repository ID:s
var seenRepos = map[string]*RepositoryConfiguration{}
for i := range cfg.Repositories {
repo := &cfg.Repositories[i]
if len(repo.Directory) == 0 {
repo.Invalid = "empty directory"
continue
}
if repo.ID == "" {
repo.ID = "default"
}