mirror of
https://github.com/octoleo/syncthing.git
synced 2025-04-11 03:51:51 +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 != "" {
|
if repo.Invalid != "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
repo.Directory = expandTilde(repo.Directory)
|
repo.Directory = expandTilde(repo.Directory)
|
||||||
|
m.AddRepo(repo)
|
||||||
|
|
||||||
fi, err := os.Stat(repo.Directory)
|
fi, err := os.Stat(repo.Directory)
|
||||||
if m.LocalVersion(repo.ID) > 0 {
|
if m.LocalVersion(repo.ID) > 0 {
|
||||||
@ -458,8 +458,6 @@ nextRepo:
|
|||||||
cfg.Repositories[i].Invalid = err.Error()
|
cfg.Repositories[i].Invalid = err.Error()
|
||||||
continue nextRepo
|
continue nextRepo
|
||||||
}
|
}
|
||||||
|
|
||||||
m.AddRepo(repo)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GUI
|
// GUI
|
||||||
|
@ -1044,7 +1044,7 @@ func (m *Model) LocalVersion(repo string) uint64 {
|
|||||||
|
|
||||||
fs, ok := m.repoFiles[repo]
|
fs, ok := m.repoFiles[repo]
|
||||||
if !ok {
|
if !ok {
|
||||||
return 0
|
panic("bug: LocalVersion called for nonexistent repo " + repo)
|
||||||
}
|
}
|
||||||
|
|
||||||
ver := fs.LocalVersion(protocol.LocalNodeID)
|
ver := fs.LocalVersion(protocol.LocalNodeID)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user