Repository navigation
lib/db: Use need func in withNeed and simplify - #6412
Merged
Merged
Conversation
calmh
approved these changes
Mar 16, 2020
calmh
added a commit
to imsodin/syncthing
that referenced
this pull request
Mar 16, 2020
* master: lib/db: Use need func in withNeed and simplify (syncthing#6412) cmd/syncthing: Do auto-upgrade before startup (fixes syncthing#6384) (syncthing#6385)
calmh
added a commit
to calmh/syncthing
that referenced
this pull request
Mar 17, 2020
* master: lib/protocol: Zero pad index ID strings lib/db: Don't ignore failures unmarshaling version lists (syncthing#6411) lib/db: Use need func in withNeed and simplify (syncthing#6412) cmd/syncthing: Do auto-upgrade before startup (fixes syncthing#6384) (syncthing#6385) lib/db: Extend set test with second remote (syncthing#6402) gui, man, authors: Update docs, translations, and contributors lib/protocol: Use BlocksHash to compare block lists when available (syncthing#6401) lib/api: Ignore that one file that always shows up in git status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WithNeeduses it's own logic to determine whether a file is needed as opposed to usingneed. And it tries multiple file entries in the global list, even though if a missing or invalid file is encountered. The former should be an error (there must never be a file in the global list that doesn't otherwise exist) and the latter is unnecessary, as there isn't anything valid after an invalid file in the global list.