aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2026-01-25 07:56:39 +0900
committerDavid Bremner <david@tethera.net>2026-02-16 07:24:18 +0900
commitb7df6feb9809fa9735141fad01616555f4b21726 (patch)
tree434e4e477ca68628d20bd355d2b668c0c5fd2817 /test
parentc4c0843d8fed39d4d7da6be493248f75d0c0d706 (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