Skip to content

Commit cb7fb9e

Browse files
dschogitster
authored andcommitted
t7504: document regression: reword no longer calls commit-msg
The `reword` command of an interactive rebase used to call the commit-msg hooks, but that regressed when we switched to the rebase--helper backed by the sequencer. Noticed by Sebastian Schuberth. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9942921 commit cb7fb9e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

t/t7504-commit-msg-hook.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,21 @@ test_expect_success "hook doesn't edit commit message (editor)" '
220220
221221
'
222222

223+
# set up fake editor to replace `pick` by `reword`
224+
cat > reword-editor <<'EOF'
225+
#!/bin/sh
226+
mv "$1" "$1".bup &&
227+
sed 's/^pick/reword/' <"$1".bup >"$1"
228+
EOF
229+
chmod +x reword-editor
230+
REWORD_EDITOR="$(pwd)/reword-editor"
231+
export REWORD_EDITOR
232+
233+
test_expect_failure 'hook is called for reword during `rebase -i`' '
234+
235+
GIT_SEQUENCE_EDITOR="\"$REWORD_EDITOR\"" git rebase -i HEAD^ &&
236+
commit_msg_is "new message"
237+
238+
'
239+
223240
test_done

0 commit comments

Comments
 (0)