2 # Test the series parsing code
7 function prepare_for_tests
9 # set up the repo so we have something interesting to run gq on
12 git-commit
-s -m "initial" 2> /dev
/null
> /dev
/null
14 # patch to modify a file
15 cat << DONE > .git/patches/master/modify
16 diff --git a/def b/def
17 index 8baef1b..7d69c2f 100644
25 # patch to add a new file
26 cat << DONE > .git/patches/master/add
27 diff --git a/abd b/abd
29 index 0000000..489450e
36 # patch to remove an existing file
37 cat << DONE > .git/patches/master/remove
38 diff --git a/abd b/abd
39 deleted file mode 100644
40 index 489450e..0000000
47 # patch to change a mode
48 cat << DONE > .git/patches/master/mode
49 diff --git a/def b/def
54 # the series file of all the things
55 cat << DONE > .git/patches/master/series
75 function expected_series
90 # NOTE: this has to be in the same order as the series file
91 tests
="empty modify add remove mode"
95 [ "$t" != "empty" ] && gq-push
> /dev
/null
97 gq-series
> /tmp
/reg.$$
99 expected_series |
diff -u - /tmp
/reg.$$