3 test_expect_success 'Git pull works after adding a new wiki page' '
6 git clone mediawiki::'"$WIKI_URL"' mw_dir_1 &&
7 wiki_editpage Foo "page created after the git clone" false &&
14 wiki_getallpage ref_page_1 &&
15 test_diff_directories mw_dir_1 ref_page_1
18 test_expect_success 'Git pull works after editing a wiki page' '
21 wiki_editpage Foo "page created before the git clone" false &&
22 git clone mediawiki::'"$WIKI_URL"' mw_dir_2 &&
23 wiki_editpage Foo "new line added on the wiki" true &&
30 wiki_getallpage ref_page_2 &&
31 test_diff_directories mw_dir_2 ref_page_2
34 test_expect_success 'git pull works on conflict handled by auto-merge' '
37 wiki_editpage Foo "1 init
41 git clone mediawiki::'"$WIKI_URL"' mw_dir_3 &&
43 wiki_editpage Foo "1 init
44 2 content added on wiki after clone
53 4 content added on git after clone
56 git commit -am "conflicting change on foo" &&
62 test_expect_success 'Git push works after adding a file .mw' '
64 git clone mediawiki::'"$WIKI_URL"' mw_dir_4 &&
65 wiki_getallpage ref_page_4 &&
68 test_path_is_missing Foo.mw &&
70 echo "hello world" >>Foo.mw &&
72 git commit -m "Foo" &&
75 wiki_getallpage ref_page_4 &&
76 test_diff_directories mw_dir_4 ref_page_4
79 test_expect_success 'Git push works after editing a file .mw' '
81 wiki_editpage "Foo" "page created before the git clone" false &&
82 git clone mediawiki::'"$WIKI_URL"' mw_dir_5 &&
86 echo "new line added in the file Foo.mw" >>Foo.mw &&
87 git commit -am "edit file Foo.mw" &&
91 wiki_getallpage ref_page_5 &&
92 test_diff_directories mw_dir_5 ref_page_5
95 test_expect_failure 'Git push works after deleting a file' '
97 wiki_editpage Foo "wiki page added before git clone" false &&
98 git clone mediawiki::'"$WIKI_URL"' mw_dir_6 &&
103 git commit -am "page Foo.mw deleted" &&
107 test_must_fail wiki_page_exist Foo
110 test_expect_success 'Merge conflict expected and solving it' '
113 git clone mediawiki::'"$WIKI_URL"' mw_dir_7 &&
114 wiki_editpage Foo "1 conflict
124 git commit -m "conflict created" &&
125 test_must_fail git pull &&
126 "$PERL_PATH" -pi -e "s/[<=>].*//g" Foo.mw &&
127 git commit -am "merge conflict solved" &&
132 test_expect_failure 'git pull works after deleting a wiki page' '
134 wiki_editpage Foo "wiki page added before the git clone" false &&
135 git clone mediawiki::'"$WIKI_URL"' mw_dir_8 &&
137 wiki_delete_page Foo &&
141 test_path_is_missing Foo.mw