diff options
author | Brandon Casey <drafnel@gmail.com> | 2010-07-22 14:15:11 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-07-25 23:14:18 -0700 |
commit | 938791cd01bfb9729feed95a12f743fd077d0467 (patch) | |
tree | 813a371595af4972898a16b5b18d5250e14be619 /t/t3404-rebase-interactive.sh | |
parent | ec136663c7d5a8e2ce1664ce79f2297e2e61c86f (diff) | |
download | git-938791cd01bfb9729feed95a12f743fd077d0467.tar.gz |
git-rebase--interactive.sh: use printf instead of echo to print commit message
On systems with an echo which defaults to the XSI-conformant behavior
(Solaris, or others using Ksh), echo will interpret certain backslashed
characters as control sequences. This can cause a problem for interactive
rebase when it is used to rebase commits whose commit "subject" (the first
line) contains any of these backslashed sequences. In this case, echo will
substitute the control sequence for the backslashed characters and either
the rebased commit message will differ from the original, or the rebase
process will fail. Neither is desirable.
So work around this issue by replacing the echo statements used to print
out portions of the commit message, with printf.
Also, add a test to test for this breakage.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-x | t/t3404-rebase-interactive.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 47ca88fc52..9f03ce699e 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -637,13 +637,19 @@ test_expect_success 'set up commits with funny messages' ' git commit -a -m "end with slash\\" && echo >>file1 && test_tick && + git commit -a -m "something (\000) that looks like octal" && + echo >>file1 && + test_tick && + git commit -a -m "something (\n) that looks like a newline" && + echo >>file1 && + test_tick && git commit -a -m "another commit" ' test_expect_success 'rebase-i history with funny messages' ' git rev-list A..funny >expect && test_tick && - FAKE_LINES="1 2" git rebase -i A && + FAKE_LINES="1 2 3 4" git rebase -i A && git rev-list A.. >actual && test_cmp expect actual ' |