diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-11-23 11:23:17 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-11-23 11:23:17 -0800 |
commit | bd53f38d52b87340ad791290d700c5c7e8587f23 (patch) | |
tree | ecff6137224ddcd8d0e20a9a7c68fec94f056841 /t | |
parent | 48e9ad5ef3afd39168e2fb72d0ce7ac5f7124d31 (diff) | |
parent | 882cd23777f8984e433e0c0addae5e9d70de75e8 (diff) | |
download | git-bd53f38d52b87340ad791290d700c5c7e8587f23.tar.gz |
Merge branch 'js/rebase-i-commentchar-fix'
"git rebase -i" did not work well with core.commentchar
configuration variable for two reasons, both of which have been
fixed.
* js/rebase-i-commentchar-fix:
rebase -i: handle core.commentChar=auto
stripspace: respect repository config
rebase -i: highlight problems with core.commentchar
Diffstat (limited to 't')
-rwxr-xr-x | t/t0030-stripspace.sh | 9 | ||||
-rwxr-xr-x | t/t3404-rebase-interactive.sh | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/t/t0030-stripspace.sh b/t/t0030-stripspace.sh index 29e91d861c..bbf3e39e3d 100755 --- a/t/t0030-stripspace.sh +++ b/t/t0030-stripspace.sh @@ -432,6 +432,15 @@ test_expect_success '-c with changed comment char' ' test_cmp expect actual ' +test_expect_success '-c with comment char defined in .git/config' ' + test_config core.commentchar = && + printf "= foo\n" >expect && + printf "foo" | ( + mkdir sub && cd sub && git stripspace -c + ) >actual && + test_cmp expect actual +' + test_expect_success 'avoid SP-HT sequence in commented line' ' printf "#\tone\n#\n# two\n" >expect && printf "\tone\n\ntwo\n" | git stripspace -c >actual && diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index e38e296388..c896a4c106 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -976,6 +976,17 @@ test_expect_success 'rebase -i respects core.commentchar' ' test B = $(git cat-file commit HEAD^ | sed -ne \$p) ' +test_expect_success 'rebase -i respects core.commentchar=auto' ' + test_config core.commentchar auto && + write_script copy-edit-script.sh <<-\EOF && + cp "$1" edit-script + EOF + test_set_editor "$(pwd)/copy-edit-script.sh" && + test_when_finished "git rebase --abort || :" && + git rebase -i HEAD^ && + test -z "$(grep -ve "^#" -e "^\$" -e "^pick" edit-script)" +' + test_expect_success 'rebase -i, with <onto> and <upstream> specified as :/quuxery' ' test_when_finished "git branch -D torebase" && git checkout -b torebase branch1 && |