diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-06-22 23:29:06 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-06-22 23:29:06 (GMT) |
commit | 644591bd0659979f46f92baab197af633f30931d (patch) | |
tree | 33eb048d23bdc69f4a92f3510cfbc3694eb4aba9 /t/t3701-add-interactive.sh | |
parent | a9ea4c23dc34bd0c27166f3445aba5a8696700c7 (diff) | |
parent | 6f74648cea1ada4dd0add46b2ae038606bb47395 (diff) | |
download | git-644591bd0659979f46f92baab197af633f30931d.zip git-644591bd0659979f46f92baab197af633f30931d.tar.gz git-644591bd0659979f46f92baab197af633f30931d.tar.bz2 |
Merge branch 'ds/add-i-color-configuration-fix'
The reimplemented "git add -i" did not honor color.ui configuration.
* ds/add-i-color-configuration-fix:
add: test use of brackets when color is disabled
add: check color.ui for interactive add
Diffstat (limited to 't/t3701-add-interactive.sh')
-rwxr-xr-x | t/t3701-add-interactive.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh index 3982b6b..34aabb7 100755 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@ -734,6 +734,44 @@ test_expect_success 'colors can be overridden' ' test_cmp expect actual ' +test_expect_success 'brackets appear without color' ' + git reset --hard && + test_when_finished "git rm -f bracket-test" && + test_write_lines context old more-context >bracket-test && + git add bracket-test && + test_write_lines context new more-context another-one >bracket-test && + + test_write_lines quit >input && + git add -i >actual <input && + + sed "s/^|//" >expect <<-\EOF && + | staged unstaged path + | 1: +3/-0 +2/-1 bracket-test + | + |*** Commands *** + | 1: [s]tatus 2: [u]pdate 3: [r]evert 4: [a]dd untracked + | 5: [p]atch 6: [d]iff 7: [q]uit 8: [h]elp + |What now> Bye. + EOF + + test_cmp expect actual +' + +test_expect_success 'colors can be skipped with color.ui=false' ' + git reset --hard && + test_when_finished "git rm -f color-test" && + test_write_lines context old more-context >color-test && + git add color-test && + test_write_lines context new more-context another-one >color-test && + + test_write_lines help quit >input && + force_color git \ + -c color.ui=false \ + add -i >actual.raw <input && + test_decode_color <actual.raw >actual && + test_cmp actual.raw actual +' + test_expect_success 'colorized diffs respect diff.wsErrorHighlight' ' git reset --hard && |