3 # Copyright (c) 2007 Johannes E. Schindelin
6 test_description='git-fast-export'
9 test_expect_success 'setup' '
11 echo Wohlauf > file &&
14 git commit -m initial &&
15 echo die Luft > file &&
16 echo geht frisch > file2 &&
19 git commit -m second &&
22 git commit -m third file2 &&
25 git checkout -b wer HEAD^ &&
28 git commit -m sitzt file2 &&
30 git tag -a -m valentin muss &&
31 git merge -s ours master
35 test_expect_success 'fast-export | fast-import' '
37 MASTER=$(git rev-parse --verify master) &&
38 REIN=$(git rev-parse --verify rein) &&
39 WER=$(git rev-parse --verify wer) &&
40 MUSS=$(git rev-parse --verify muss) &&
42 git --git-dir=new/.git init &&
43 git fast-export --all |
46 test $MASTER = $(git rev-parse --verify refs/heads/master) &&
47 test $REIN = $(git rev-parse --verify refs/tags/rein) &&
48 test $WER = $(git rev-parse --verify refs/heads/wer) &&
49 test $MUSS = $(git rev-parse --verify refs/tags/muss))
53 test_expect_success 'fast-export master~2..master' '
55 git fast-export master~2..master |
56 sed "s/master/partial/" |
59 test $MASTER != $(git rev-parse --verify refs/heads/partial) &&
60 git diff master..partial &&
61 git diff master^..partial^ &&
62 ! git rev-parse partial~2)
66 test_expect_success 'iso-8859-1' '
68 git config i18n.commitencoding ISO-8859-1 &&
69 # use author and committer name in ISO-8859-1 to match it.
70 . ../t3901-8859-1.txt &&
73 git commit -s -m den file &&
74 git fast-export wer^..wer |
78 git cat-file commit i18n | grep "Áéí óú")
81 test_expect_success 'import/export-marks' '
83 git checkout -b marks master &&
84 git fast-export --export-marks=tmp-marks HEAD &&
87 test $(wc -l < tmp-marks) -eq 3 &&
89 git fast-export --import-marks=tmp-marks\
90 --export-marks=tmp-marks HEAD |
95 git commit -m "last commit" file &&
97 git fast-export --import-marks=tmp-marks \
98 --export-marks=tmp-marks HEAD |
102 test $(wc -l < tmp-marks) -eq 4
106 cat > signed-tag-import << EOF
108 from $(git rev-parse HEAD)
109 tagger C O Mitter <committer@example.com> 1112911993 -0700
112 -----BEGIN PGP SIGNATURE-----
113 Version: GnuPG v1.4.5 (GNU/Linux)
115 fakedsignaturefakedsignaturefakedsignaturefakedsignaturfakedsign
116 aturefakedsignaturefake=
118 -----END PGP SIGNATURE-----
121 test_expect_success 'set up faked signed tag' '
123 cat signed-tag-import | git fast-import
127 test_expect_success 'signed-tags=abort' '
129 ! git fast-export --signed-tags=abort sign-your-name
133 test_expect_success 'signed-tags=verbatim' '
135 git fast-export --signed-tags=verbatim sign-your-name > output &&
140 test_expect_success 'signed-tags=strip' '
142 git fast-export --signed-tags=strip sign-your-name > output &&