]> git.cworth.org Git - obsolete/notmuch-old/commitdiff
notmuch new: Fix bug resulting in file removal on initial build of database.
authorCarl Worth <cworth@cworth.org>
Wed, 6 Jan 2010 21:54:39 +0000 (13:54 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 6 Jan 2010 21:54:39 +0000 (13:54 -0800)
The bug here was that we would see that the database did not know
anything about a directory so would get results from the filesystem in
inode rather than strcmp order.

However, we wouldn't actually ask for the list of files from the
database until after recursing into the sub-directories. So by the
time we traverse the filenames looking for deletions, the database
*does* have entries and we end up detecting erroneous deletions
because our filename list from the filesystem isn't in strcmp order.

So ask for the list of names from the database before doing any
additions to avoid this problem.


No differences found