Skip to content

Commit 004a383

Browse files
committed
Merge branch 'ob/test-lib-rebase-fake-editor-updates'
Test updates. * ob/test-lib-rebase-fake-editor-updates: t/lib-rebase: improve documentation of set_fake_editor() t/lib-rebase: set_fake_editor(): handle FAKE_LINES more consistently t/lib-rebase: set_fake_editor(): fix recognition of reset's short command
2 parents aaf0a42 + 20a0bd4 commit 004a383

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

t/lib-rebase.sh

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@
88
# - check that non-commit messages have a certain line count with $EXPECT_COUNT
99
# - check the commit count in the commit message header with $EXPECT_HEADER_COUNT
1010
# - rewrite a rebase -i script as directed by $FAKE_LINES.
11-
# $FAKE_LINES consists of a sequence of words separated by spaces.
12-
# The following word combinations are possible:
11+
# $FAKE_LINES consists of a sequence of words separated by spaces;
12+
# spaces inside the words are encoded as underscores.
13+
# The following words are possible:
1314
#
14-
# "<lineno>" -- add a "pick" line with the SHA1 taken from the
15-
# specified line.
15+
# "<cmd>" -- override the command for the next line specification. Can be
16+
# "pick", "squash", "fixup[_-(c|C)]", "edit", "reword", "drop",
17+
# "merge[_-(c|C)_<rev>]", or "bad" for an invalid command.
1618
#
17-
# "<cmd> <lineno>" -- add a line with the specified command
18-
# ("pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword" or "drop")
19-
# and the SHA1 taken from the specified line.
19+
# "<lineno>" -- add a command, using the specified line as a template.
20+
# If the command has not been overridden, the line will be copied
21+
# verbatim, usually resulting in a "pick" line.
2022
#
21-
# "_" -- add a space, like "fixup_-C" implies "fixup -C" and
22-
# "exec_cmd_with_args" add an "exec cmd with args" line.
23+
# "fakesha" -- add a command ("pick" by default), using a fake SHA1.
24+
#
25+
# "exec_[command...]", "break" -- add the specified command.
2326
#
2427
# "#" -- Add a comment line.
2528
#
@@ -49,7 +52,7 @@ set_fake_editor () {
4952
action=\&
5053
for line in $FAKE_LINES; do
5154
case $line in
52-
pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|r|merge|m)
55+
pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|t|merge|m)
5356
action="$line";;
5457
exec_*|x_*|break|b)
5558
echo "$line" | sed 's/_/ /g' >> "$1";;
@@ -64,7 +67,7 @@ set_fake_editor () {
6467
fakesha)
6568
test \& != "$action" || action=pick
6669
echo "$action XXXXXXX False commit" >> "$1"
67-
action=pick;;
70+
action=\&;;
6871
*)
6972
sed -n "${line}s/^[a-z][a-z]*/$action/p" < "$1".tmp >> "$1"
7073
action=\&;;

0 commit comments

Comments
 (0)