From debfae20db9a45ce7e12ac51db2b0104cd3b0be2 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 27 Aug 2017 20:58:22 -0300 Subject: [PATCH] lib: enforce that n_message_reindex takes headers from first file 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 | 4 +++- test/T670-duplicate-mid.sh | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/message.cc b/lib/message.cc index 63d67cfe..0e3b5a4f 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -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); diff --git a/test/T670-duplicate-mid.sh b/test/T670-duplicate-mid.sh index d4c1d1c2..ce010cf7 100755 --- a/test/T670-duplicate-mid.sh +++ b/test/T670-duplicate-mid.sh @@ -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 < EXPECTED thread:XXX 2001-01-05 [1/1(3)] Notmuch Test Suite; message 0 (inbox unread) EOF -- 2.26.2