fix: revise revision if the new file list is empty but the previous one was not (#2003)

This commit is contained in:
三咲雅 · Misaki Masa 2024-12-06 22:11:45 +08:00 committed by GitHub
parent fbf9b3d1ed
commit 11cf555b47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -103,10 +103,12 @@ impl Files {
pub fn update_full(&mut self, files: Vec<File>) {
self.ticket = FILES_TICKET.next();
(self.hidden, self.items) = self.split_files(files);
if !self.items.is_empty() {
let (hidden, items) = self.split_files(files);
if !(items.is_empty() && self.items.is_empty()) {
self.revision += 1;
}
(self.hidden, self.items) = (hidden, items);
}
pub fn update_part(&mut self, files: Vec<File>, ticket: Id) {