mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-03-14 03:25:15 +01:00
Fix notmuch_message_tags_to_maildir_flags to effect rename immediately
We have tests to ensure that when the notmuch library renames a file that that rename takes place immediately in the database, (without requiring something like "notmuch new" to notice the change). This was working when the code was first added, but recently broke in the reworking of the maildir-synchronization interface since the tags_to_maildir_flags function can no longer assume that it is being called as part of _notmuch_message_sync. Fortunately, the fix is as simple as adding an explicit call to _notmuch_message_sync.
This commit is contained in:
parent
4b6063397f
commit
81cbaafc0f
1 changed files with 7 additions and 2 deletions
|
@ -998,14 +998,19 @@ notmuch_message_tags_to_maildir_flags (notmuch_message_t *message)
|
|||
strcpy (filename_new+(p-filename)+3, flags);
|
||||
|
||||
if (strcmp (filename, filename_new) != 0) {
|
||||
notmuch_status_t status;
|
||||
|
||||
ret = rename (filename, filename_new);
|
||||
if (ret == -1) {
|
||||
perror (talloc_asprintf (message, "rename of %s to %s failed",
|
||||
filename, filename_new));
|
||||
exit (1);
|
||||
}
|
||||
return _notmuch_message_rename (message, filename_new);
|
||||
/* _notmuch_message_sync is our caller. Do not call it here. */
|
||||
status = _notmuch_message_rename (message, filename_new);
|
||||
|
||||
_notmuch_message_sync (message);
|
||||
|
||||
return status;
|
||||
}
|
||||
return NOTMUCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue