]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3701-add-interactive.sh
Merge branch 'ec/fetch-mark-common-refs-trace2'
[thirdparty/git.git] / t / t3701-add-interactive.sh
index 69991a3168f354b8bfefcd396a968e653bb352bd..d4f9386621b468ae805febf7382268ed8bf53d8d 100755 (executable)
@@ -314,7 +314,7 @@ test_expect_success C_LOCALE_OUTPUT 'add first line works' '
        git commit -am "clear local changes" &&
        git apply patch &&
        printf "%s\n" s y y | git add -p file 2>error |
-               sed -n -e "s/^Stage this hunk[^@]*\(@@ .*\)/\1/" \
+               sed -n -e "s/^([1-2]\/[1-2]) Stage this hunk[^@]*\(@@ .*\)/\1/" \
                       -e "/^[-+@ \\\\]"/p  >output &&
        test_must_be_empty error &&
        git diff --cached >diff &&
@@ -647,4 +647,29 @@ test_expect_success 'checkout -p works with pathological context lines' '
        test_write_lines a b a b a a b a b a >expect &&
        test_cmp expect a
 '
+
+test_expect_success 'show help from add--helper' '
+       git reset --hard &&
+       cat >expect <<-EOF &&
+
+       <BOLD>*** Commands ***<RESET>
+         1: <BOLD;BLUE>s<RESET>tatus     2: <BOLD;BLUE>u<RESET>pdate     3: <BOLD;BLUE>r<RESET>evert     4: <BOLD;BLUE>a<RESET>dd untracked
+         5: <BOLD;BLUE>p<RESET>atch      6: <BOLD;BLUE>d<RESET>iff       7: <BOLD;BLUE>q<RESET>uit       8: <BOLD;BLUE>h<RESET>elp
+       <BOLD;BLUE>What now<RESET>> <BOLD;RED>status        - show paths with changes<RESET>
+       <BOLD;RED>update        - add working tree state to the staged set of changes<RESET>
+       <BOLD;RED>revert        - revert staged set of changes back to the HEAD version<RESET>
+       <BOLD;RED>patch         - pick hunks and update selectively<RESET>
+       <BOLD;RED>diff          - view diff between HEAD and index<RESET>
+       <BOLD;RED>add untracked - add contents of untracked files to the staged set of changes<RESET>
+       <BOLD>*** Commands ***<RESET>
+         1: <BOLD;BLUE>s<RESET>tatus     2: <BOLD;BLUE>u<RESET>pdate     3: <BOLD;BLUE>r<RESET>evert     4: <BOLD;BLUE>a<RESET>dd untracked
+         5: <BOLD;BLUE>p<RESET>atch      6: <BOLD;BLUE>d<RESET>iff       7: <BOLD;BLUE>q<RESET>uit       8: <BOLD;BLUE>h<RESET>elp
+       <BOLD;BLUE>What now<RESET>>$SP
+       Bye.
+       EOF
+       test_write_lines h | GIT_PAGER_IN_USE=true TERM=vt100 git add -i >actual.colored &&
+       test_decode_color <actual.colored >actual &&
+       test_i18ncmp expect actual
+'
+
 test_done