Merge branch 'jk/merge-file-exit-code' into maint
[gitweb.git] / t / t3404-rebase-interactive.sh
index d26e3f57dcbc18585c360ee78a725708f5a69207..98eb49ac236e9e9d08d5da5167f7e257db173c41 100755 (executable)
@@ -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