lib: enforce that n_message_reindex takes headers from first file
authorDavid Bremner <david@tethera.net>
Sun, 27 Aug 2017 23:58:22 +0000 (20:58 -0300)
committerDavid Bremner <david@tethera.net>
Wed, 6 Sep 2017 00:51:57 +0000 (21:51 -0300)
This is still a bit stopgap to be only choosing one set of headers,
but this seems like a more defensible set of headers to choose.

lib/message.cc
test/T670-duplicate-mid.sh

index 63d67cfe84947de37ea03564f99d451d6382d40c..0e3b5a4f1510722729d60e73322baf2d529219bc 100644 (file)
@@ -2034,7 +2034,9 @@ notmuch_message_reindex (notmuch_message_t *message,
            thread_id = orig_thread_id;
 
        _notmuch_message_add_term (message, "thread", thread_id);
-       _notmuch_message_set_header_values (message, date, from, subject);
+       /* Take header values only from first filename */
+       if (found == 0)
+           _notmuch_message_set_header_values (message, date, from, subject);
 
        ret = _notmuch_message_index_file (message, message_file);
 
index d4c1d1c22358c341cd0bc28c8b91685ed6198b3c..ce010cf739c404989da48684a0a25ca00b53d830 100755 (executable)
@@ -41,7 +41,6 @@ notmuch search --output=files "sekrit" | notmuch_dir_sanitize > OUTPUT
 test_expect_equal_file EXPECTED OUTPUT
 
 test_begin_subtest 'reindex choses subject from first filename'
-test_subtest_known_broken
 cat <<EOF > EXPECTED
 thread:XXX   2001-01-05 [1/1(3)] Notmuch Test Suite; message 0 (inbox unread)
 EOF