summaryrefslogtreecommitdiff
path: root/t/t3404-rebase-interactive.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-xt/t3404-rebase-interactive.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index d26e3f5..98eb49a 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -1227,6 +1227,21 @@ test_expect_success 'static check of bad command' '
test C = $(git cat-file commit HEAD^ | sed -ne \$p)
'
+test_expect_success 'tabs and spaces are accepted in the todolist' '
+ rebase_setup_and_clean indented-comment &&
+ write_script add-indent.sh <<-\EOF &&
+ (
+ # Turn single spaces into space/tab mix
+ sed "1s/ / /g; 2s/ / /g; 3s/ / /g" "$1"
+ printf "\n\t# comment\n #more\n\t # comment\n"
+ ) >$1.new
+ mv "$1.new" "$1"
+ EOF
+ test_set_editor "$(pwd)/add-indent.sh" &&
+ git rebase -i HEAD^^^ &&
+ test E = $(git cat-file commit HEAD | sed -ne \$p)
+'
+
cat >expect <<EOF
Warning: the SHA-1 is missing or isn't a commit in the following line:
- edit XXXXXXX False commit
@@ -1246,4 +1261,16 @@ test_expect_success 'static check of bad SHA-1' '
test E = $(git cat-file commit HEAD | sed -ne \$p)
'
+test_expect_success 'editor saves as CR/LF' '
+ git checkout -b with-crlf &&
+ write_script add-crs.sh <<-\EOF &&
+ sed -e "s/\$/Q/" <"$1" | tr Q "\\015" >"$1".new &&
+ mv -f "$1".new "$1"
+ EOF
+ (
+ test_set_editor "$(pwd)/add-crs.sh" &&
+ git rebase -i HEAD^
+ )
+'
+
test_done