t4150: test applying StGit series

A StGit series is a directory containing a "series" file which begins with the line: # This series applies on GIT commit XXXXX where XXXXX is the commit ID that the patch series applies on. Every following line names a patch in the directory to be applied. Test that git-am, when given this "series" file, is able to detect it as an StGit series and apply all the patches in the series. Signed-off-by: Paul Tan <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Paul Tan committed Jun 15, 2015 at 19:08 UTC fcceef4e06f30ea6dc30bd8fe16142472447cb94
1 file changed +17
t/t4150-am.sh
+17
@@ -116,6 +116,13 @@ test_expect_success setup '
116 echo "---" &&
117 git diff-tree --no-commit-id --stat -p second
118 } >patch1-stgit.eml &&
119 + mkdir stgit-series &&
120 + cp patch1-stgit.eml stgit-series/patch &&
121 + {
122 + echo "# This series applies on GIT commit $(git rev-parse first)" &&
123 + echo "patch"
124 + } >stgit-series/series &&
125 +
126
127 sed -n -e "3,\$p" msg >file &&
128 git add file &&
@@ -219,6 +226,16 @@ test_expect_success 'am --patch-format=stgit applies stgit patch' '
226 test_cmp_rev second^ HEAD^
227 '
228
229 +test_expect_success 'am applies stgit series' '
230 + rm -fr .git/rebase-apply &&
231 + git checkout -f first &&
232 + git am stgit-series/series &&
233 + test_path_is_missing .git/rebase-apply &&
234 + git diff --exit-code second &&
235 + test_cmp_rev second HEAD &&
236 + test_cmp_rev second^ HEAD^
237 +'
238 +
239 test_expect_success 'setup: new author and committer' '
240 GIT_AUTHOR_NAME="Another Thor" &&
241 GIT_AUTHOR_EMAIL="a.thor@example.com" &&