2 # Copyright (c) 2006 Karl Hasselström
3 test_description
='Test the import command'
7 'Initialize the StGIT repository' \
9 for x in {do,di,da}{be,bi,bo}{dam,dim,dum}; do
13 git commit -a -m "initial version" &&
18 'Apply a patch created with "git diff"' \
20 stg import ../t1800-import/git-diff &&
21 [ $(git cat-file -p $(stg id) \
22 | grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") == 1 ] &&
27 'Apply a patch created with GNU diff' \
29 stg import ../t1800-import/gnu-diff &&
30 [ $(git cat-file -p $(stg id) \
31 | grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") == 1 ] &&
36 'Apply a patch created with "stg export"' \
38 stg import ../t1800-import/stg-export &&
39 [ $(git cat-file -p $(stg id) \
40 | grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") == 1 ] &&
45 'Apply a patch from an 8bit-encoded e-mail' \
47 stg import -m ../t1800-import/email-8bit &&
48 [ $(git cat-file -p $(stg id) \
49 | grep -c "tree 030be42660323ff2a1958f9ee79589a4f3fbee2f") == 1 ] &&
50 [ $(git cat-file -p $(stg id) \
51 | grep -c "author Inge Ström <inge@power.com>") == 1 ] &&
56 'Apply a patch from a QP-encoded e-mail' \
58 stg import -m ../t1800-import/email-qp &&
59 [ $(git cat-file -p $(stg id) \
60 | grep -c "tree 030be42660323ff2a1958f9ee79589a4f3fbee2f") == 1 ] &&
61 [ $(git cat-file -p $(stg id) \
62 | grep -c "author Inge Ström <inge@power.com>") == 1 ] &&
67 'Apply several patches from an mbox file' \
69 stg import -M ../t1800-import/email-mbox &&
70 [ $(git cat-file -p $(stg id change-1) \
71 | grep -c "tree 401bef82cd9fb403aba18f480a63844416a2e023") == 1 ] &&
72 [ $(git cat-file -p $(stg id change-1) \
73 | grep -c "author Inge Ström <inge@power.com>") == 1 ] &&
74 [ $(git cat-file -p $(stg id change-2) \
75 | grep -c "tree e49dbce010ec7f441015a8c64bce0b99108af4cc") == 1 ] &&
76 [ $(git cat-file -p $(stg id change-2) \
77 | grep -c "author Inge Ström <inge@power.com>") == 1 ] &&
78 [ $(git cat-file -p $(stg id change-3) \
79 | grep -c "tree 166bbaf27a44aee21ba78c98822a741e6f7d78f5") == 1 ] &&
80 [ $(git cat-file -p $(stg id change-3) \
81 | grep -c "author Inge Ström <inge@power.com>") == 1 ] &&