aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2025-07-12 20:06:01 -0300
committerDavid Bremner <david@tethera.net>2025-08-11 09:52:10 -0300
commit448c8ca81a3ca9f5c7d2cc20671bb81d7a551f67 (patch)
tree062936f91296e1d233adf5daf594536bbdb07d6e /test
parent271dede0c9a8083aa56af153d55388af8521f6c8 (diff)
cli/git-remote: handle message deletions
There are two main possibilities. One is explicit delete ('D' command in the stream from git fast-export) and one is files disappearing between commits. It is less clear the latter can happen in well formed sequence of commits, but it could result e.g. from manual changes to the repo.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T860-git-remote.sh21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/T860-git-remote.sh b/test/T860-git-remote.sh
index 3a1c128a..fa52c2b7 100755
--- a/test/T860-git-remote.sh
+++ b/test/T860-git-remote.sh
@@ -32,7 +32,7 @@ export GIT_AUTHOR_NAME="Notmuch Test Suite"
export GIT_AUTHOR_EMAIL="notmuch@example.com"
export GIT_COMMITTER_NAME="Notmuch Test Suite"
export GIT_COMMITTER_EMAIL="notmuch@example.com"
-export GIT_REMOTE_NM_DEBUG="s"
+export GIT_REMOTE_NM_DEBUG="sd"
export GIT_REMOTE_NM_LOG=grn-log.txt
EXPECTED=$NOTMUCH_SRCDIR/test/git-remote.expected-output
MAKE_EXPORT_PY=$NOTMUCH_SRCDIR/test/make-export.py
@@ -271,7 +271,6 @@ restore_state
backup_state
test_begin_subtest "removing message via repo"
-test_subtest_known_broken
parent=$(dirname $TAG_FILE)
# future proof this for when e.g. properties are stored
git -C repo rm -r $parent
@@ -285,6 +284,24 @@ test_expect_equal_file EXPECTED OUTPUT
restore_state
backup_state
+test_begin_subtest "not removing later messages"
+add_message '[subject]="first new message"'
+git -C repo pull
+add_message '[subject]="second new message"'
+git -C repo pull
+notmuch dump | sort > EXPECTED
+git clone repo cloned_repo
+rm -rf ${MAIL_DIR}/.notmuch
+notmuch new --full-scan
+git -C cloned_repo remote add database notmuch::
+notmuch config set git.fail_on_missing false
+git -C cloned_repo push database master
+notmuch config set git.fail_on_missing true
+notmuch dump | sort > OUTPUT
+test_expect_equal_file_nonempty EXPECTED OUTPUT
+restore_state
+
+backup_state
test_begin_subtest 'by default, missing messages are an error during export'
test_subtest_known_broken
sed s/4EFC743A.3060609@april.org/missing-message@example.com/ < export.in > missing.in