mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
LocalVersion is unavailable until after AddRepo (fixes #154)
This commit is contained in:
parent
39cf269d6b
commit
434ecdac6b
@ -431,8 +431,8 @@ nextRepo:
|
||||
if repo.Invalid != "" {
|
||||
continue
|
||||
}
|
||||
|
||||
repo.Directory = expandTilde(repo.Directory)
|
||||
m.AddRepo(repo)
|
||||
|
||||
fi, err := os.Stat(repo.Directory)
|
||||
if m.LocalVersion(repo.ID) > 0 {
|
||||
@ -458,8 +458,6 @@ nextRepo:
|
||||
cfg.Repositories[i].Invalid = err.Error()
|
||||
continue nextRepo
|
||||
}
|
||||
|
||||
m.AddRepo(repo)
|
||||
}
|
||||
|
||||
// GUI
|
||||
|
@ -1044,7 +1044,7 @@ func (m *Model) LocalVersion(repo string) uint64 {
|
||||
|
||||
fs, ok := m.repoFiles[repo]
|
||||
if !ok {
|
||||
return 0
|
||||
panic("bug: LocalVersion called for nonexistent repo " + repo)
|
||||
}
|
||||
|
||||
ver := fs.LocalVersion(protocol.LocalNodeID)
|
||||
|
Loading…
Reference in New Issue
Block a user