2 # Copyright (c) 2006 Karl Hasselström
3 test_description='Test the import command'
7 'Initialize the StGIT repository' \
9 cp ../t1800-import/foo.txt . &&
11 git commit -a -m "initial version" &&
16 'Apply a patch created with "git diff"' \
18 stg import ../t1800-import/git-diff &&
19 [ $(git cat-file -p $(stg id) \
20 | grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") = 1 ] &&
25 'Apply a patch created with "git diff" from a subdirectory' \
27 mkdir subdir && cd subdir &&
28 stg import ../../t1800-import/git-diff &&
29 [ $(git cat-file -p $(stg id) \
30 | grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") = 1 ] &&
36 'Apply a patch created with GNU diff' \
38 stg import ../t1800-import/gnu-diff &&
39 [ $(git cat-file -p $(stg id) \
40 | grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") = 1 ] &&
45 'Apply a patch created with "stg export"' \
47 stg import ../t1800-import/stg-export &&
48 [ $(git cat-file -p $(stg id) \
49 | grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") = 1 ] &&
54 'Apply a patch from an 8bit-encoded e-mail' \
56 stg import -m ../t1800-import/email-8bit &&
57 [ $(git cat-file -p $(stg id) \
58 | grep -c "tree 030be42660323ff2a1958f9ee79589a4f3fbee2f") = 1 ] &&
59 [ $(git cat-file -p $(stg id) \
60 | grep -c "author Inge Ström <inge@power.com>") = 1 ] &&
65 'Apply a patch from a QP-encoded e-mail' \
67 stg import -m ../t1800-import/email-qp &&
68 [ $(git cat-file -p $(stg id) \
69 | grep -c "tree 030be42660323ff2a1958f9ee79589a4f3fbee2f") = 1 ] &&
70 [ $(git cat-file -p $(stg id) \
71 | grep -c "author Inge Ström <inge@power.com>") = 1 ] &&
76 'Apply several patches from an mbox file' \
78 stg import -M ../t1800-import/email-mbox &&
79 [ $(git cat-file -p $(stg id change-1) \
80 | grep -c "tree 401bef82cd9fb403aba18f480a63844416a2e023") = 1 ] &&
81 [ $(git cat-file -p $(stg id change-1) \
82 | grep -c "author Inge Ström <inge@power.com>") = 1 ] &&
83 [ $(git cat-file -p $(stg id change-2) \
84 | grep -c "tree e49dbce010ec7f441015a8c64bce0b99108af4cc") = 1 ] &&
85 [ $(git cat-file -p $(stg id change-2) \
86 | grep -c "author Inge Ström <inge@power.com>") = 1 ] &&
87 [ $(git cat-file -p $(stg id change-3) \
88 | grep -c "tree 166bbaf27a44aee21ba78c98822a741e6f7d78f5") = 1 ] &&
89 [ $(git cat-file -p $(stg id change-3) \
90 | grep -c "author Inge Ström <inge@power.com>") = 1 ] &&