]> git.notmuchmail.org Git - notmuch/commit
notmuch new: Never ask the database for any names from a new directory.
authorCarl Worth <cworth@cworth.org>
Wed, 6 Jan 2010 22:35:56 +0000 (14:35 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 6 Jan 2010 22:35:56 +0000 (14:35 -0800)
commit1a38cb841ca4ce87f6b57f9b1baf1a5f8b8e35b7
tree6befe39e3f24c2d49ec4d7960aac6b82fd85a8bb
parent957ae198e708dc901e3a8c89b7364c2bc75ce371
notmuch new: Never ask the database for any names from a new directory.

When we know that we are adding a new directory to the database, (and
we therefore are using inode rather than strcmp-based sorting of the
filenames), then we *never* want to see any names from the
database. If we get any names that could only make us inadvertently
remove files that we just added.

Since it's not obvious from the Xapian documentation whether new terms
being added as part of new documents will appear in the in-progress
all-terms iteration we are using, (and this might differ based on
Xapian backend and also might differ based on how many new directories
are added and whether a flush threshold is reached).

For all of these reasons, we play it safe and use NULL rather than a
real notmuch_filenames_t iterator in this case to avoid any problem.
notmuch-new.c