rebase -i: highlight problems with core.commentchar
The interactive rebase does not currently play well with core.commentchar. Let's add some tests to highlight those problems that will be fixed in the remainder of the series. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Nov 21, 2016 at 15:18 UTC
6645838845c523952f60a855f8c646d49e59cee0
2 files changed
+20
t/t0030-stripspace.sh
+9
@@ -432,6 +432,15 @@ test_expect_success '-c with changed comment char' '
432
test_cmp expect actual
433
'
434
435
+test_expect_failure '-c with comment char defined in .git/config' '
436
+ test_config core.commentchar = &&
437
+ printf "= foo\n" >expect &&
438
+ printf "foo" | (
439
+ mkdir sub && cd sub && git stripspace -c
440
+ ) >actual &&
441
+ test_cmp expect actual
442
+'
443
+
444
test_expect_success 'avoid SP-HT sequence in commented line' '
445
printf "#\tone\n#\n# two\n" >expect &&
446
printf "\tone\n\ntwo\n" | git stripspace -c >actual &&
t/t3404-rebase-interactive.sh
+11
@@ -983,6 +983,17 @@ test_expect_success 'rebase -i respects core.commentchar' '
983
test B = $(git cat-file commit HEAD^ | sed -ne \$p)
984
'
985
986
+test_expect_failure 'rebase -i respects core.commentchar=auto' '
987
+ test_config core.commentchar auto &&
988
+ write_script copy-edit-script.sh <<-\EOF &&
989
+ cp "$1" edit-script
990
+ EOF
991
+ test_set_editor "$(pwd)/copy-edit-script.sh" &&
992
+ test_when_finished "git rebase --abort || :" &&
993
+ git rebase -i HEAD^ &&
994
+ test -z "$(grep -ve "^#" -e "^\$" -e "^pick" edit-script)"
995
+'
996
+
997
test_expect_success 'rebase -i, with <onto> and <upstream> specified as :/quuxery' '
998
test_when_finished "git branch -D torebase" &&
999
git checkout -b torebase branch1 &&