refactor: create Git namespace
[git-rebase2.git] / itest-edit.sh
blobfa8ff59dcfa87f088e97b1129518d60a73944eca
1 #!/bin/sh
3 file="$1"
5 echo File: >>/dev/stderr
6 cat "$file" >>/dev/stderr
7 cp "$file" "save_todo"
9 case "$GIT_SEQUENCE_EDITOR_CASE" in
10 empty)
11 : >"$file"
13 empty-with-comment)
14 cat >"$file" <<EOF
15 #bla-bla
16 EOF
18 fail)
19 cat >"$file" <<EOF
20 x false
21 EOF
23 fail-pick)
24 cat >"$file" <<EOF
25 pick $GIT_SEQUENCE_EDITOR_STEP_HASH
26 EOF
28 merge-c)
29 cat >"$file" <<EOF
30 merge -c 3a5191091 HEAD,608a449bb2 Test merge subject
31 EOF
33 merge-no-c)
34 cat >"$file" <<EOF
35 merge HEAD,608a449bb2 Some subject
36 EOF
38 merge-no-ff)
39 cat >"$file" <<EOF
40 : base
41 pick origin/base
42 pick origin/b2
43 : tmp1
44 reset @base
45 merge --no-ff HEAD,@tmp1
46 EOF
48 merge-no-ff-reuse)
49 file_content=`awk -- '/^end$/{ exit } { print }' "$file"`
50 cat >"$file" <<EOF
51 : base
52 $file_content
53 : tmp1
54 #aaaa
55 reset @base
56 merge --no-ff HEAD,@tmp1
57 EOF
59 merge-resolved)
60 cat >"$file" <<EOF
61 Merge origin/b2 with resolving conflict (test)
62 EOF
64 merge-inner)
65 cat >"$file" <<EOF
66 x git commit --allow-empty -m UPDATE
67 pick origin/base
68 : tmp1
69 pick origin/b1
70 : tmp2
71 #bbbb
72 reset @tmp1
73 pick origin/b2
74 merge -c origin/master1 HEAD,@tmp2
75 EOF
77 merge-inner-broken)
78 cat >"$file" <<EOF
79 reset @tmp1
80 pick origin/b2
81 merge -c origin/master1 HEAD,@tmp2
82 EOF
84 set-comment)
85 cat >"$file" <<EOF
86 pick 76dee8a19ec
87 comment
88 test-comment
90 EOF
92 edit-noop)
93 cat >"$file" <<EOF
94 edit 76dee8a19ec
95 EOF
97 pass)
100 cat >"$file" <<EOF
101 pick 76dee8a19ec
104 esac