The import command supports importing mbox from stdin using the deprecated
mailbox.UnixMailbox interface.

Signed-off-by: Peter Grayson <[email protected]>
---
 t/t1800-import.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/t/t1800-import.sh b/t/t1800-import.sh
index 8539d97d..dc63c2a0 100755
--- a/t/t1800-import.sh
+++ b/t/t1800-import.sh
@@ -128,6 +128,25 @@ test_expect_success \
     '

 test_expect_success \
+    'Apply several patches from an mbox file from stdin' \
+    '
+    cat $STG_ROOT/t/t1800-import/email-mbox | stg import -M &&
+    [ $(git cat-file -p $(stg id change-1) \
+        | grep -c "tree 401bef82cd9fb403aba18f480a63844416a2e023") = 1 ] &&
+    [ $(git cat-file -p $(stg id change-1) \
+        | grep -c "author Inge Ström <[email protected]>") = 1 ] &&
+    [ $(git cat-file -p $(stg id change-2) \
+        | grep -c "tree e49dbce010ec7f441015a8c64bce0b99108af4cc") = 1 ] &&
+    [ $(git cat-file -p $(stg id change-2) \
+        | grep -c "author Inge Ström <[email protected]>") = 1 ] &&
+    [ $(git cat-file -p $(stg id change-3) \
+        | grep -c "tree 166bbaf27a44aee21ba78c98822a741e6f7d78f5") = 1 ] &&
+    [ $(git cat-file -p $(stg id change-3) \
+        | grep -c "author Inge Ström <[email protected]>") = 1 ] &&
+    stg delete ..
+    '
+
+test_expect_success \
     'Apply a bzip2 patch created with "git diff"' \
     '
     bzip2 -c $STG_ROOT/t/t1800-import/git-diff > \
-- 
2.12.0

_______________________________________________
stgit-users mailing list
[email protected]
https://mail.gna.org/listinfo/stgit-users

Reply via email to