Skip to content

Commit

Permalink
Don't set pin state explicit after rename
Browse files Browse the repository at this point in the history
This code had no effect and was wrong because at this time
the original file is long gone and therefore the pin state
of this file can not be retrieved. It worked anyway because
the pin state gets set by updateMetadata()

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
  • Loading branch information
Felix Weilbach committed Jun 11, 2021
1 parent 407817f commit 4608853
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/libsync/propagateremotemove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,9 @@ void PropagateRemoteMove::finalize()
// to the new record. It is not a problem to skip it here.
SyncJournalFileRecord oldRecord;
propagator()->_journal->getFileRecord(_item->_originalFile, &oldRecord);
auto &vfs = propagator()->syncOptions()._vfs;
auto pinState = vfs->pinState(_item->_originalFile);

// Delete old db data.
propagator()->_journal->deleteFileRecord(_item->_originalFile);
vfs->setPinState(_item->_originalFile, PinState::Inherited);

SyncFileItem newItem(*_item);
newItem._type = _item->_type;
Expand All @@ -256,11 +253,6 @@ void PropagateRemoteMove::finalize()
done(SyncFileItem::FatalError, tr("Error writing metadata to the database"));
return;
}
if (pinState && *pinState != PinState::Inherited
&& !vfs->setPinState(newItem._renameTarget, *pinState)) {
done(SyncFileItem::NormalError, tr("Error setting pin state"));
return;
}

if (_item->isDirectory()) {
propagator()->_renamedDirectories.insert(_item->_file, _item->_renameTarget);
Expand Down

0 comments on commit 4608853

Please sign in to comment.