From 36251b86f7942d7b2cb303010a0f1dc2199bb5af Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Sun, 25 Feb 2018 13:03:55 +0100 Subject: [PATCH] lib/model: Mark deleted file as conflicting when un-ignoring (#4776) This completes #4750 as a followup to #4765. --- lib/model/model.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/model/model.go b/lib/model/model.go index 6a679de9..d355695e 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -2066,6 +2066,14 @@ func (m *Model) internalScanFolderSubdirs(ctx context.Context, folder string, su Deleted: true, Version: f.Version.Update(m.shortID), } + // We do not want to override the global version + // with the deleted file. Keeping only our local + // counter makes sure we are in conflict with any + // other existing versions, which will be resolved + // by the normal pulling mechanisms. + if f.IsInvalid() { + nf.Version.DropOthers(m.shortID) + } batch = append(batch, nf) batchSizeBytes += nf.ProtoSize()