Git fork

Merge branch 'ps/platform-compat-fixes'

Various platform compatibility fixes split out of the larger effort
to use Meson as the primary build tool.

* ps/platform-compat-fixes:
t6006: fix prereq handling with `test_format ()`
http: fix build error on FreeBSD
builtin/credential-cache: fix missing parameter for stub function
t7300: work around platform-specific behaviour with long paths on MinGW
t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin
t3404: work around platform-specific behaviour on macOS 10.15
t1401: make invocation of tar(1) work with Win32-provided one
t/lib-gpg: fix setup of GNUPGHOME in MinGW
t/lib-gitweb: test against the build version of gitweb
t/test-lib: wire up NO_ICONV prerequisite
t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE

+273 -136
+1
Makefile
··· 3171 @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@+ 3172 @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@+ 3173 @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@+ 3174 @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+ 3175 @echo USE_LIBPCRE2=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE2)))'\' >>$@+ 3176 @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+
··· 3171 @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@+ 3172 @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@+ 3173 @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@+ 3174 + @echo NO_ICONV=\''$(subst ','\'',$(subst ','\'',$(NO_ICONV)))'\' >>$@+ 3175 @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+ 3176 @echo USE_LIBPCRE2=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE2)))'\' >>$@+ 3177 @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+
+2 -1
builtin/credential-cache.c
··· 189 190 #else 191 192 - int cmd_credential_cache(int argc, const char **argv, const char *prefix) 193 { 194 const char * const usage[] = { 195 "git credential-cache [options] <action>",
··· 189 190 #else 191 192 + int cmd_credential_cache(int argc, const char **argv, const char *prefix, 193 + struct repository *repo UNUSED) 194 { 195 const char * const usage[] = { 196 "git credential-cache [options] <action>",
+6
contrib/buildsystems/CMakeLists.txt
··· 1109 set(PYTHON_PATH /usr/bin/python) 1110 set(TAR tar) 1111 set(NO_CURL ) 1112 set(NO_EXPAT ) 1113 set(USE_LIBPCRE2 ) 1114 set(NO_PERL ) ··· 1120 1121 if(NOT CURL_FOUND) 1122 set(NO_CURL 1) 1123 endif() 1124 1125 if(NOT EXPAT_FOUND) ··· 1145 file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PYTHON_PATH='${PYTHON_PATH}'\n") 1146 file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "TAR='${TAR}'\n") 1147 file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_CURL='${NO_CURL}'\n") 1148 file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_EXPAT='${NO_EXPAT}'\n") 1149 file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PERL='${NO_PERL}'\n") 1150 file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PTHREADS='${NO_PTHREADS}'\n")
··· 1109 set(PYTHON_PATH /usr/bin/python) 1110 set(TAR tar) 1111 set(NO_CURL ) 1112 + set(NO_ICONV ) 1113 set(NO_EXPAT ) 1114 set(USE_LIBPCRE2 ) 1115 set(NO_PERL ) ··· 1121 1122 if(NOT CURL_FOUND) 1123 set(NO_CURL 1) 1124 + endif() 1125 + 1126 + if(NOT Iconv_FOUND) 1127 + SET(NO_ICONV 1) 1128 endif() 1129 1130 if(NOT EXPAT_FOUND) ··· 1150 file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PYTHON_PATH='${PYTHON_PATH}'\n") 1151 file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "TAR='${TAR}'\n") 1152 file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_CURL='${NO_CURL}'\n") 1153 + file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_ICONV='${NO_ICONV}'\n") 1154 file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_EXPAT='${NO_EXPAT}'\n") 1155 file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PERL='${NO_PERL}'\n") 1156 file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PTHREADS='${NO_PTHREADS}'\n")
+6 -4
http.c
··· 2290 case HTTP_REQUEST_STRBUF: 2291 strbuf_reset(result); 2292 break; 2293 - case HTTP_REQUEST_FILE: 2294 - if (fflush(result)) { 2295 error_errno("unable to flush a file"); 2296 return HTTP_START_FAILED; 2297 } 2298 - rewind(result); 2299 - if (ftruncate(fileno(result), 0) < 0) { 2300 error_errno("unable to truncate a file"); 2301 return HTTP_START_FAILED; 2302 } 2303 break; 2304 default: 2305 BUG("Unknown http_request target"); 2306 }
··· 2290 case HTTP_REQUEST_STRBUF: 2291 strbuf_reset(result); 2292 break; 2293 + case HTTP_REQUEST_FILE: { 2294 + FILE *f = result; 2295 + if (fflush(f)) { 2296 error_errno("unable to flush a file"); 2297 return HTTP_START_FAILED; 2298 } 2299 + rewind(f); 2300 + if (ftruncate(fileno(f), 0) < 0) { 2301 error_errno("unable to truncate a file"); 2302 return HTTP_START_FAILED; 2303 } 2304 break; 2305 + } 2306 default: 2307 BUG("Unknown http_request target"); 2308 }
+2 -2
t/lib-gitweb.sh
··· 48 test -f "$SCRIPT_NAME" || 49 error "Cannot find gitweb at $GITWEB_TEST_INSTALLED." 50 say "# Testing $SCRIPT_NAME" 51 - else # normal case, use source version of gitweb 52 - SCRIPT_NAME="$GIT_BUILD_DIR/gitweb/gitweb.perl" 53 fi 54 export SCRIPT_NAME 55 }
··· 48 test -f "$SCRIPT_NAME" || 49 error "Cannot find gitweb at $GITWEB_TEST_INSTALLED." 50 say "# Testing $SCRIPT_NAME" 51 + else # normal case, use built version of gitweb 52 + SCRIPT_NAME="$GIT_BUILD_DIR/gitweb/gitweb.cgi" 53 fi 54 export SCRIPT_NAME 55 }
+1 -1
t/lib-gpg.sh
··· 6 # executed in an eval'ed subshell that changes the working directory to a 7 # temporary one. 8 9 - GNUPGHOME="$PWD/gpghome" 10 export GNUPGHOME 11 12 test_lazy_prereq GPG '
··· 6 # executed in an eval'ed subshell that changes the working directory to a 7 # temporary one. 8 9 + GNUPGHOME="$(pwd)/gpghome" 10 export GNUPGHOME 11 12 test_lazy_prereq GPG '
+6
t/t0028-working-tree-encoding.sh
··· 12 13 GIT_TRACE_WORKING_TREE_ENCODING=1 && export GIT_TRACE_WORKING_TREE_ENCODING 14 15 test_expect_success 'setup test files' ' 16 git config core.eol lf && 17
··· 12 13 GIT_TRACE_WORKING_TREE_ENCODING=1 && export GIT_TRACE_WORKING_TREE_ENCODING 14 15 + if ! test_have_prereq ICONV 16 + then 17 + skip_all='skipping working tree encoding tests; iconv not available' 18 + test_done 19 + fi 20 + 21 test_expect_success 'setup test files' ' 22 git config core.eol lf && 23
+1 -1
t/t1401-symbolic-ref.sh
··· 16 test_expect_success 'setup' ' 17 git symbolic-ref HEAD refs/heads/foo && 18 test_commit file && 19 - "$TAR" cf .git.tar .git/ 20 ' 21 22 test_expect_success 'symbolic-ref read/write roundtrip' '
··· 16 test_expect_success 'setup' ' 17 git symbolic-ref HEAD refs/heads/foo && 18 test_commit file && 19 + "$TAR" cf .git.tar .git 20 ' 21 22 test_expect_success 'symbolic-ref read/write roundtrip' '
+1 -1
t/t2082-parallel-checkout-attributes.sh
··· 34 ) 35 ' 36 37 - test_expect_success 'parallel-checkout with re-encoding' ' 38 set_checkout_config 2 0 && 39 git init encoding && 40 (
··· 34 ) 35 ' 36 37 + test_expect_success ICONV 'parallel-checkout with re-encoding' ' 38 set_checkout_config 2 0 && 39 git init encoding && 40 (
+12 -14
t/t3404-rebase-interactive.sh
··· 1917 test_cmp_rev HEAD~1 refs/heads/third && 1918 test_cmp_rev HEAD refs/heads/no-conflict-branch && 1919 1920 - cat >expect <<-\EOF && 1921 Successfully rebased and updated refs/heads/update-refs. 1922 Updated the following refs with --update-refs: 1923 - refs/heads/first 1924 - refs/heads/no-conflict-branch 1925 - refs/heads/second 1926 - refs/heads/third 1927 EOF 1928 1929 # Clear "Rebasing (X/Y)" progress lines and drop leading tabs. 1930 - sed -e "s/Rebasing.*Successfully/Successfully/g" -e "s/^\t//g" \ 1931 - <err >err.trimmed && 1932 test_cmp expect err.trimmed 1933 ' 1934 ··· 2178 test_must_fail git rebase --continue 2>err && 2179 grep "update_ref failed for ref '\''refs/heads/second'\''" err && 2180 2181 - cat >expect <<-\EOF && 2182 Updated the following refs with --update-refs: 2183 - refs/heads/first 2184 - refs/heads/no-conflict-branch 2185 - refs/heads/third 2186 Failed to update the following refs with --update-refs: 2187 - refs/heads/second 2188 EOF 2189 2190 # Clear "Rebasing (X/Y)" progress lines and drop leading tabs. 2191 tail -n 6 err >err.last && 2192 - sed -e "s/Rebasing.*Successfully/Successfully/g" -e "s/^\t//g" \ 2193 - <err.last >err.trimmed && 2194 test_cmp expect err.trimmed 2195 ' 2196
··· 1917 test_cmp_rev HEAD~1 refs/heads/third && 1918 test_cmp_rev HEAD refs/heads/no-conflict-branch && 1919 1920 + q_to_tab >expect <<-\EOF && 1921 Successfully rebased and updated refs/heads/update-refs. 1922 Updated the following refs with --update-refs: 1923 + Qrefs/heads/first 1924 + Qrefs/heads/no-conflict-branch 1925 + Qrefs/heads/second 1926 + Qrefs/heads/third 1927 EOF 1928 1929 # Clear "Rebasing (X/Y)" progress lines and drop leading tabs. 1930 + sed "s/Rebasing.*Successfully/Successfully/g" <err >err.trimmed && 1931 test_cmp expect err.trimmed 1932 ' 1933 ··· 2177 test_must_fail git rebase --continue 2>err && 2178 grep "update_ref failed for ref '\''refs/heads/second'\''" err && 2179 2180 + q_to_tab >expect <<-\EOF && 2181 Updated the following refs with --update-refs: 2182 + Qrefs/heads/first 2183 + Qrefs/heads/no-conflict-branch 2184 + Qrefs/heads/third 2185 Failed to update the following refs with --update-refs: 2186 + Qrefs/heads/second 2187 EOF 2188 2189 # Clear "Rebasing (X/Y)" progress lines and drop leading tabs. 2190 tail -n 6 err >err.last && 2191 + sed "s/Rebasing.*Successfully/Successfully/g" <err.last >err.trimmed && 2192 test_cmp expect err.trimmed 2193 ' 2194
+6
t/t3434-rebase-i18n.sh
··· 20 TEST_PASSES_SANITIZE_LEAK=true 21 . ./test-lib.sh 22 23 compare_msg () { 24 iconv -f "$2" -t "$3" "$TEST_DIRECTORY/t3434/$1" >expect && 25 git cat-file commit HEAD >raw &&
··· 20 TEST_PASSES_SANITIZE_LEAK=true 21 . ./test-lib.sh 22 23 + if ! test_have_prereq ICONV 24 + then 25 + skip_all='skipping rebase i18n tests; iconv not available' 26 + test_done 27 + fi 28 + 29 compare_msg () { 30 iconv -f "$2" -t "$3" "$TEST_DIRECTORY/t3434/$1" >expect && 31 git cat-file commit HEAD >raw &&
+6
t/t3900-i18n-commit.sh
··· 8 TEST_PASSES_SANITIZE_LEAK=true 9 . ./test-lib.sh 10 11 compare_with () { 12 git show -s $1 | sed -e '1,/^$/d' -e 's/^ //' >current && 13 case "$3" in
··· 8 TEST_PASSES_SANITIZE_LEAK=true 9 . ./test-lib.sh 10 11 + if ! test_have_prereq ICONV 12 + then 13 + skip_all='skipping commit i18n tests; iconv not available' 14 + test_done 15 + fi 16 + 17 compare_with () { 18 git show -s $1 | sed -e '1,/^$/d' -e 's/^ //' >current && 19 case "$3" in
+6
t/t3901-i18n-patch.sh
··· 11 TEST_PASSES_SANITIZE_LEAK=true 12 . ./test-lib.sh 13 14 check_encoding () { 15 # Make sure characters are not corrupted 16 cnt="$1" header="$2" i=1 j=0
··· 11 TEST_PASSES_SANITIZE_LEAK=true 12 . ./test-lib.sh 13 14 + if ! test_have_prereq ICONV 15 + then 16 + skip_all='skipping patch i18n tests; iconv not available' 17 + test_done 18 + fi 19 + 20 check_encoding () { 21 # Make sure characters are not corrupted 22 cnt="$1" header="$2" i=1 j=0
+11 -5
t/t4041-diff-submodule-option.sh
··· 15 TEST_PASSES_SANITIZE_LEAK=true 16 . ./test-lib.sh 17 18 - # Tested non-UTF-8 encoding 19 - test_encoding="ISO8859-1" 20 21 - # String "added" in German (translated with Google Translate), encoded in UTF-8, 22 - # used in sample commit log messages in add_file() function below. 23 - added=$(printf "hinzugef\303\274gt") 24 add_file () { 25 ( 26 cd "$1" &&
··· 15 TEST_PASSES_SANITIZE_LEAK=true 16 . ./test-lib.sh 17 18 + # Test non-UTF-8 encoding in case iconv is available. 19 + if test_have_prereq ICONV 20 + then 21 + test_encoding="ISO8859-1" 22 + # String "added" in German (translated with Google Translate), encoded in UTF-8, 23 + # used in sample commit log messages in add_file() function below. 24 + added=$(printf "hinzugef\303\274gt") 25 + else 26 + test_encoding="UTF-8" 27 + added="added" 28 + fi 29 30 add_file () { 31 ( 32 cd "$1" &&
+11 -5
t/t4059-diff-submodule-not-initialized.sh
··· 12 TEST_PASSES_SANITIZE_LEAK=true 13 . ./test-lib.sh 14 15 - # Tested non-UTF-8 encoding 16 - test_encoding="ISO8859-1" 17 18 - # String "added" in German (translated with Google Translate), encoded in UTF-8, 19 - # used in sample commit log messages in add_file() function below. 20 - added=$(printf "hinzugef\303\274gt") 21 22 add_file () { 23 (
··· 12 TEST_PASSES_SANITIZE_LEAK=true 13 . ./test-lib.sh 14 15 16 + # Test non-UTF-8 encoding in case iconv is available. 17 + if test_have_prereq ICONV 18 + then 19 + test_encoding="ISO8859-1" 20 + # String "added" in German (translated with Google Translate), encoded in UTF-8, 21 + # used in sample commit log messages in add_file() function below. 22 + added=$(printf "hinzugef\303\274gt") 23 + else 24 + test_encoding="UTF-8" 25 + added="added" 26 + fi 27 28 add_file () { 29 (
+11 -6
t/t4060-diff-submodule-option-diff-format.sh
··· 13 TEST_PASSES_SANITIZE_LEAK=true 14 . ./test-lib.sh 15 16 - # Tested non-UTF-8 encoding 17 - test_encoding="ISO8859-1" 18 - 19 - # String "added" in German (translated with Google Translate), encoded in UTF-8, 20 - # used in sample commit log messages in add_file() function below. 21 - added=$(printf "hinzugef\303\274gt") 22 23 add_file () { 24 (
··· 13 TEST_PASSES_SANITIZE_LEAK=true 14 . ./test-lib.sh 15 16 + # Test non-UTF-8 encoding in case iconv is available. 17 + if test_have_prereq ICONV 18 + then 19 + test_encoding="ISO8859-1" 20 + # String "added" in German (translated with Google Translate), encoded in UTF-8, 21 + # used in sample commit log messages in add_file() function below. 22 + added=$(printf "hinzugef\303\274gt") 23 + else 24 + test_encoding="UTF-8" 25 + added="added" 26 + fi 27 28 add_file () { 29 (
+4 -4
t/t4201-shortlog.sh
··· 105 test_cmp expect log.predictable 106 ' 107 108 - test_expect_success !MINGW 'shortlog wrapping' ' 109 cat >expect <<\EOF && 110 A U Thor (5): 111 Test ··· 126 test_cmp expect out 127 ' 128 129 - test_expect_success !MINGW 'shortlog from non-git directory' ' 130 git log --no-expand-tabs HEAD >log && 131 GIT_DIR=non-existing git shortlog -w <log >out && 132 test_cmp expect out 133 ' 134 135 - test_expect_success !MINGW 'shortlog can read --format=raw output' ' 136 git log --format=raw HEAD >log && 137 GIT_DIR=non-existing git shortlog -w <log >out && 138 test_cmp expect out ··· 186 187 EOF 188 189 - test_expect_success !MINGW 'shortlog encoding' ' 190 git reset --hard "$commit" && 191 git config --unset i18n.commitencoding && 192 echo 2 > a1 &&
··· 105 test_cmp expect log.predictable 106 ' 107 108 + test_expect_success !MINGW,ICONV 'shortlog wrapping' ' 109 cat >expect <<\EOF && 110 A U Thor (5): 111 Test ··· 126 test_cmp expect out 127 ' 128 129 + test_expect_success !MINGW,ICONV 'shortlog from non-git directory' ' 130 git log --no-expand-tabs HEAD >log && 131 GIT_DIR=non-existing git shortlog -w <log >out && 132 test_cmp expect out 133 ' 134 135 + test_expect_success !MINGW,ICONV 'shortlog can read --format=raw output' ' 136 git log --format=raw HEAD >log && 137 GIT_DIR=non-existing git shortlog -w <log >out && 138 test_cmp expect out ··· 186 187 EOF 188 189 + test_expect_success !MINGW,ICONV 'shortlog encoding' ' 190 git reset --hard "$commit" && 191 git config --unset i18n.commitencoding && 192 echo 2 > a1 &&
+59 -43
t/t4205-log-pretty-formats.sh
··· 114 test_must_fail git log --pretty=test-foo 115 ' 116 117 - test_expect_success 'NUL separation' ' 118 printf "add bar\0$(commit_msg)" >expected && 119 git log -z --pretty="format:%s" >actual && 120 test_cmp expected actual 121 ' 122 123 - test_expect_success 'NUL termination' ' 124 printf "add bar\0$(commit_msg)\0" >expected && 125 git log -z --pretty="tformat:%s" >actual && 126 test_cmp expected actual 127 ' 128 129 - test_expect_success 'NUL separation with --stat' ' 130 stat0_part=$(git diff --stat HEAD^ HEAD) && 131 stat1_part=$(git diff-tree --no-commit-id --stat --root HEAD^) && 132 printf "add bar\n$stat0_part\n\0$(commit_msg)\n$stat1_part\n" >expected && ··· 181 head4=$(git rev-parse --verify --short HEAD~3) 182 ' 183 184 - test_expect_success 'left alignment formatting' ' 185 git log --pretty="tformat:%<(40)%s" >actual && 186 qz_to_tab_space <<-EOF >expected && 187 message two Z ··· 192 test_cmp expected actual 193 ' 194 195 - test_expect_success 'left alignment formatting. i18n.logOutputEncoding' ' 196 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(40)%s" >actual && 197 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 198 message two Z ··· 203 test_cmp expected actual 204 ' 205 206 - test_expect_success 'left alignment formatting at the nth column' ' 207 git log --pretty="tformat:%h %<|(40)%s" >actual && 208 qz_to_tab_space <<-EOF >expected && 209 $head1 message two Z ··· 214 test_cmp expected actual 215 ' 216 217 - test_expect_success 'left alignment formatting at the nth column' ' 218 COLUMNS=50 git log --pretty="tformat:%h %<|(-10)%s" >actual && 219 qz_to_tab_space <<-EOF >expected && 220 $head1 message two Z ··· 225 test_cmp expected actual 226 ' 227 228 - test_expect_success 'left alignment formatting at the nth column. i18n.logOutputEncoding' ' 229 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %<|(40)%s" >actual && 230 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 231 $head1 message two Z ··· 236 test_cmp expected actual 237 ' 238 239 - test_expect_success 'left alignment formatting with no padding' ' 240 git log --pretty="tformat:%<(1)%s" >actual && 241 cat <<-EOF >expected && 242 message two ··· 258 test_cmp expected actual 259 ' 260 261 - test_expect_success 'left alignment formatting with trunc' ' 262 git log --pretty="tformat:%<(10,trunc)%s" >actual && 263 qz_to_tab_space <<-\EOF >expected && 264 message .. ··· 269 test_cmp expected actual 270 ' 271 272 - test_expect_success 'left alignment formatting with trunc. i18n.logOutputEncoding' ' 273 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s" >actual && 274 qz_to_tab_space <<-\EOF | iconv -f utf-8 -t $test_encoding >expected && 275 message .. ··· 280 test_cmp expected actual 281 ' 282 283 - test_expect_success 'left alignment formatting with ltrunc' ' 284 git log --pretty="tformat:%<(10,ltrunc)%s" >actual && 285 qz_to_tab_space <<-EOF >expected && 286 ..sage two ··· 291 test_cmp expected actual 292 ' 293 294 - test_expect_success 'left alignment formatting with ltrunc. i18n.logOutputEncoding' ' 295 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,ltrunc)%s" >actual && 296 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 297 ..sage two ··· 302 test_cmp expected actual 303 ' 304 305 - test_expect_success 'left alignment formatting with mtrunc' ' 306 git log --pretty="tformat:%<(10,mtrunc)%s" >actual && 307 qz_to_tab_space <<-\EOF >expected && 308 mess.. two ··· 313 test_cmp expected actual 314 ' 315 316 - test_expect_success 'left alignment formatting with mtrunc. i18n.logOutputEncoding' ' 317 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,mtrunc)%s" >actual && 318 qz_to_tab_space <<-\EOF | iconv -f utf-8 -t $test_encoding >expected && 319 mess.. two ··· 324 test_cmp expected actual 325 ' 326 327 - test_expect_success 'right alignment formatting' ' 328 git log --pretty="tformat:%>(40)%s" >actual && 329 qz_to_tab_space <<-EOF >expected && 330 Z message two ··· 335 test_cmp expected actual 336 ' 337 338 - test_expect_success 'right alignment formatting. i18n.logOutputEncoding' ' 339 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(40)%s" >actual && 340 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 341 Z message two ··· 346 test_cmp expected actual 347 ' 348 349 - test_expect_success 'right alignment formatting at the nth column' ' 350 git log --pretty="tformat:%h %>|(40)%s" >actual && 351 qz_to_tab_space <<-EOF >expected && 352 $head1 message two ··· 357 test_cmp expected actual 358 ' 359 360 - test_expect_success 'right alignment formatting at the nth column' ' 361 COLUMNS=50 git log --pretty="tformat:%h %>|(-10)%s" >actual && 362 qz_to_tab_space <<-EOF >expected && 363 $head1 message two ··· 368 test_cmp expected actual 369 ' 370 371 - test_expect_success 'right alignment formatting at the nth column. i18n.logOutputEncoding' ' 372 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %>|(40)%s" >actual && 373 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 374 $head1 message two ··· 381 382 # Note: Space between 'message' and 'two' should be in the same column 383 # as in previous test. 384 - test_expect_success 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' ' 385 git -c i18n.logOutputEncoding=$test_encoding log --graph --pretty="tformat:%h %>|(40)%s" >actual && 386 iconv -f utf-8 -t $test_encoding >expected <<-EOF && 387 * $head1 message two ··· 392 test_cmp expected actual 393 ' 394 395 - test_expect_success 'right alignment formatting with no padding' ' 396 git log --pretty="tformat:%>(1)%s" >actual && 397 cat <<-EOF >expected && 398 message two ··· 403 test_cmp expected actual 404 ' 405 406 - test_expect_success 'right alignment formatting with no padding and with --graph' ' 407 git log --graph --pretty="tformat:%>(1)%s" >actual && 408 cat <<-EOF >expected && 409 * message two ··· 414 test_cmp expected actual 415 ' 416 417 - test_expect_success 'right alignment formatting with no padding. i18n.logOutputEncoding' ' 418 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(1)%s" >actual && 419 cat <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 420 message two ··· 425 test_cmp expected actual 426 ' 427 428 - test_expect_success 'center alignment formatting' ' 429 git log --pretty="tformat:%><(40)%s" >actual && 430 qz_to_tab_space <<-EOF >expected && 431 Z message two Z ··· 436 test_cmp expected actual 437 ' 438 439 - test_expect_success 'center alignment formatting. i18n.logOutputEncoding' ' 440 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(40)%s" >actual && 441 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 442 Z message two Z ··· 446 EOF 447 test_cmp expected actual 448 ' 449 - test_expect_success 'center alignment formatting at the nth column' ' 450 git log --pretty="tformat:%h %><|(40)%s" >actual && 451 qz_to_tab_space <<-EOF >expected && 452 $head1 message two Z ··· 457 test_cmp expected actual 458 ' 459 460 - test_expect_success 'center alignment formatting at the nth column' ' 461 COLUMNS=70 git log --pretty="tformat:%h %><|(-30)%s" >actual && 462 qz_to_tab_space <<-EOF >expected && 463 $head1 message two Z ··· 468 test_cmp expected actual 469 ' 470 471 - test_expect_success 'center alignment formatting at the nth column. i18n.logOutputEncoding' ' 472 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %><|(40)%s" >actual && 473 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 474 $head1 message two Z ··· 479 test_cmp expected actual 480 ' 481 482 - test_expect_success 'center alignment formatting with no padding' ' 483 git log --pretty="tformat:%><(1)%s" >actual && 484 cat <<-EOF >expected && 485 message two ··· 493 # save HEAD's SHA-1 digest (with no abbreviations) to use it below 494 # as far as the next test amends HEAD 495 old_head1=$(git rev-parse --verify HEAD~0) 496 - test_expect_success 'center alignment formatting with no padding. i18n.logOutputEncoding' ' 497 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(1)%s" >actual && 498 cat <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 499 message two ··· 504 test_cmp expected actual 505 ' 506 507 - test_expect_success 'left/right alignment formatting with stealing' ' 508 git commit --amend -m short --author "long long long <long@me.com>" && 509 git log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual && 510 cat <<-\EOF >expected && ··· 515 EOF 516 test_cmp expected actual 517 ' 518 - test_expect_success 'left/right alignment formatting with stealing. i18n.logOutputEncoding' ' 519 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual && 520 cat <<-\EOF | iconv -f utf-8 -t $test_encoding >expected && 521 short long long long ··· 564 git tag -d tag1 && 565 git commit --amend -m shorter && 566 git log --no-walk --tags --pretty="%H %d" --decorate=full >actual && 567 - cat <<-EOF >expected && 568 - $head2 (tag: refs/tags/message-one) 569 - $old_head1 (tag: refs/tags/message-two) 570 - $head1 (tag: refs/tags/tag2) 571 - EOF 572 sort -k3 actual >actual1 && 573 test_cmp expected actual1 574 ' 575 576 test_expect_success 'clean log decoration' ' 577 git log --no-walk --tags --pretty="%H %D" --decorate=full >actual && 578 - cat >expected <<-EOF && 579 - $head2 tag: refs/tags/message-one 580 - $old_head1 tag: refs/tags/message-two 581 - $head1 tag: refs/tags/tag2 582 - EOF 583 sort -k3 actual >actual1 && 584 test_cmp expected actual1 585 '
··· 114 test_must_fail git log --pretty=test-foo 115 ' 116 117 + test_expect_success ICONV 'NUL separation' ' 118 printf "add bar\0$(commit_msg)" >expected && 119 git log -z --pretty="format:%s" >actual && 120 test_cmp expected actual 121 ' 122 123 + test_expect_success ICONV 'NUL termination' ' 124 printf "add bar\0$(commit_msg)\0" >expected && 125 git log -z --pretty="tformat:%s" >actual && 126 test_cmp expected actual 127 ' 128 129 + test_expect_success ICONV 'NUL separation with --stat' ' 130 stat0_part=$(git diff --stat HEAD^ HEAD) && 131 stat1_part=$(git diff-tree --no-commit-id --stat --root HEAD^) && 132 printf "add bar\n$stat0_part\n\0$(commit_msg)\n$stat1_part\n" >expected && ··· 181 head4=$(git rev-parse --verify --short HEAD~3) 182 ' 183 184 + test_expect_success ICONV 'left alignment formatting' ' 185 git log --pretty="tformat:%<(40)%s" >actual && 186 qz_to_tab_space <<-EOF >expected && 187 message two Z ··· 192 test_cmp expected actual 193 ' 194 195 + test_expect_success ICONV 'left alignment formatting. i18n.logOutputEncoding' ' 196 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(40)%s" >actual && 197 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 198 message two Z ··· 203 test_cmp expected actual 204 ' 205 206 + test_expect_success ICONV 'left alignment formatting at the nth column' ' 207 git log --pretty="tformat:%h %<|(40)%s" >actual && 208 qz_to_tab_space <<-EOF >expected && 209 $head1 message two Z ··· 214 test_cmp expected actual 215 ' 216 217 + test_expect_success ICONV 'left alignment formatting at the nth column' ' 218 COLUMNS=50 git log --pretty="tformat:%h %<|(-10)%s" >actual && 219 qz_to_tab_space <<-EOF >expected && 220 $head1 message two Z ··· 225 test_cmp expected actual 226 ' 227 228 + test_expect_success ICONV 'left alignment formatting at the nth column. i18n.logOutputEncoding' ' 229 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %<|(40)%s" >actual && 230 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 231 $head1 message two Z ··· 236 test_cmp expected actual 237 ' 238 239 + test_expect_success ICONV 'left alignment formatting with no padding' ' 240 git log --pretty="tformat:%<(1)%s" >actual && 241 cat <<-EOF >expected && 242 message two ··· 258 test_cmp expected actual 259 ' 260 261 + test_expect_success ICONV 'left alignment formatting with trunc' ' 262 git log --pretty="tformat:%<(10,trunc)%s" >actual && 263 qz_to_tab_space <<-\EOF >expected && 264 message .. ··· 269 test_cmp expected actual 270 ' 271 272 + test_expect_success ICONV 'left alignment formatting with trunc. i18n.logOutputEncoding' ' 273 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s" >actual && 274 qz_to_tab_space <<-\EOF | iconv -f utf-8 -t $test_encoding >expected && 275 message .. ··· 280 test_cmp expected actual 281 ' 282 283 + test_expect_success ICONV 'left alignment formatting with ltrunc' ' 284 git log --pretty="tformat:%<(10,ltrunc)%s" >actual && 285 qz_to_tab_space <<-EOF >expected && 286 ..sage two ··· 291 test_cmp expected actual 292 ' 293 294 + test_expect_success ICONV 'left alignment formatting with ltrunc. i18n.logOutputEncoding' ' 295 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,ltrunc)%s" >actual && 296 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 297 ..sage two ··· 302 test_cmp expected actual 303 ' 304 305 + test_expect_success ICONV 'left alignment formatting with mtrunc' ' 306 git log --pretty="tformat:%<(10,mtrunc)%s" >actual && 307 qz_to_tab_space <<-\EOF >expected && 308 mess.. two ··· 313 test_cmp expected actual 314 ' 315 316 + test_expect_success ICONV 'left alignment formatting with mtrunc. i18n.logOutputEncoding' ' 317 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,mtrunc)%s" >actual && 318 qz_to_tab_space <<-\EOF | iconv -f utf-8 -t $test_encoding >expected && 319 mess.. two ··· 324 test_cmp expected actual 325 ' 326 327 + test_expect_success ICONV 'right alignment formatting' ' 328 git log --pretty="tformat:%>(40)%s" >actual && 329 qz_to_tab_space <<-EOF >expected && 330 Z message two ··· 335 test_cmp expected actual 336 ' 337 338 + test_expect_success ICONV 'right alignment formatting. i18n.logOutputEncoding' ' 339 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(40)%s" >actual && 340 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 341 Z message two ··· 346 test_cmp expected actual 347 ' 348 349 + test_expect_success ICONV 'right alignment formatting at the nth column' ' 350 git log --pretty="tformat:%h %>|(40)%s" >actual && 351 qz_to_tab_space <<-EOF >expected && 352 $head1 message two ··· 357 test_cmp expected actual 358 ' 359 360 + test_expect_success ICONV 'right alignment formatting at the nth column' ' 361 COLUMNS=50 git log --pretty="tformat:%h %>|(-10)%s" >actual && 362 qz_to_tab_space <<-EOF >expected && 363 $head1 message two ··· 368 test_cmp expected actual 369 ' 370 371 + test_expect_success ICONV 'right alignment formatting at the nth column. i18n.logOutputEncoding' ' 372 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %>|(40)%s" >actual && 373 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 374 $head1 message two ··· 381 382 # Note: Space between 'message' and 'two' should be in the same column 383 # as in previous test. 384 + test_expect_success ICONV 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' ' 385 git -c i18n.logOutputEncoding=$test_encoding log --graph --pretty="tformat:%h %>|(40)%s" >actual && 386 iconv -f utf-8 -t $test_encoding >expected <<-EOF && 387 * $head1 message two ··· 392 test_cmp expected actual 393 ' 394 395 + test_expect_success ICONV 'right alignment formatting with no padding' ' 396 git log --pretty="tformat:%>(1)%s" >actual && 397 cat <<-EOF >expected && 398 message two ··· 403 test_cmp expected actual 404 ' 405 406 + test_expect_success ICONV 'right alignment formatting with no padding and with --graph' ' 407 git log --graph --pretty="tformat:%>(1)%s" >actual && 408 cat <<-EOF >expected && 409 * message two ··· 414 test_cmp expected actual 415 ' 416 417 + test_expect_success ICONV 'right alignment formatting with no padding. i18n.logOutputEncoding' ' 418 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(1)%s" >actual && 419 cat <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 420 message two ··· 425 test_cmp expected actual 426 ' 427 428 + test_expect_success ICONV 'center alignment formatting' ' 429 git log --pretty="tformat:%><(40)%s" >actual && 430 qz_to_tab_space <<-EOF >expected && 431 Z message two Z ··· 436 test_cmp expected actual 437 ' 438 439 + test_expect_success ICONV 'center alignment formatting. i18n.logOutputEncoding' ' 440 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(40)%s" >actual && 441 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 442 Z message two Z ··· 446 EOF 447 test_cmp expected actual 448 ' 449 + test_expect_success ICONV 'center alignment formatting at the nth column' ' 450 git log --pretty="tformat:%h %><|(40)%s" >actual && 451 qz_to_tab_space <<-EOF >expected && 452 $head1 message two Z ··· 457 test_cmp expected actual 458 ' 459 460 + test_expect_success ICONV 'center alignment formatting at the nth column' ' 461 COLUMNS=70 git log --pretty="tformat:%h %><|(-30)%s" >actual && 462 qz_to_tab_space <<-EOF >expected && 463 $head1 message two Z ··· 468 test_cmp expected actual 469 ' 470 471 + test_expect_success ICONV 'center alignment formatting at the nth column. i18n.logOutputEncoding' ' 472 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %><|(40)%s" >actual && 473 qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 474 $head1 message two Z ··· 479 test_cmp expected actual 480 ' 481 482 + test_expect_success ICONV 'center alignment formatting with no padding' ' 483 git log --pretty="tformat:%><(1)%s" >actual && 484 cat <<-EOF >expected && 485 message two ··· 493 # save HEAD's SHA-1 digest (with no abbreviations) to use it below 494 # as far as the next test amends HEAD 495 old_head1=$(git rev-parse --verify HEAD~0) 496 + test_expect_success ICONV 'center alignment formatting with no padding. i18n.logOutputEncoding' ' 497 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(1)%s" >actual && 498 cat <<-EOF | iconv -f utf-8 -t $test_encoding >expected && 499 message two ··· 504 test_cmp expected actual 505 ' 506 507 + test_expect_success ICONV 'left/right alignment formatting with stealing' ' 508 git commit --amend -m short --author "long long long <long@me.com>" && 509 git log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual && 510 cat <<-\EOF >expected && ··· 515 EOF 516 test_cmp expected actual 517 ' 518 + test_expect_success ICONV 'left/right alignment formatting with stealing. i18n.logOutputEncoding' ' 519 git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual && 520 cat <<-\EOF | iconv -f utf-8 -t $test_encoding >expected && 521 short long long long ··· 564 git tag -d tag1 && 565 git commit --amend -m shorter && 566 git log --no-walk --tags --pretty="%H %d" --decorate=full >actual && 567 + if test_have_prereq ICONV 568 + then 569 + cat <<-EOF >expected 570 + $head2 (tag: refs/tags/message-one) 571 + $old_head1 (tag: refs/tags/message-two) 572 + $head1 (tag: refs/tags/tag2) 573 + EOF 574 + else 575 + cat <<-EOF >expected 576 + $head2 (tag: refs/tags/message-one) 577 + $old_head1 (tag: refs/tags/tag2, tag: refs/tags/message-two) 578 + EOF 579 + fi && 580 sort -k3 actual >actual1 && 581 test_cmp expected actual1 582 ' 583 584 test_expect_success 'clean log decoration' ' 585 git log --no-walk --tags --pretty="%H %D" --decorate=full >actual && 586 + if test_have_prereq ICONV 587 + then 588 + cat <<-EOF >expected 589 + $head2 tag: refs/tags/message-one 590 + $old_head1 tag: refs/tags/message-two 591 + $head1 tag: refs/tags/tag2 592 + EOF 593 + else 594 + cat <<-EOF >expected 595 + $head2 tag: refs/tags/message-one 596 + $old_head1 tag: refs/tags/tag2, tag: refs/tags/message-two 597 + EOF 598 + fi && 599 sort -k3 actual >actual1 && 600 test_cmp expected actual1 601 '
+6
t/t4210-log-i18n.sh
··· 5 TEST_PASSES_SANITIZE_LEAK=true 6 . ./lib-gettext.sh 7 8 # two forms of é 9 utf8_e=$(printf '\303\251') 10 latin1_e=$(printf '\351')
··· 5 TEST_PASSES_SANITIZE_LEAK=true 6 . ./lib-gettext.sh 7 8 + if ! test_have_prereq ICONV 9 + then 10 + skip_all='skipping log i18n tests; iconv not available' 11 + test_done 12 + fi 13 + 14 # two forms of é 15 utf8_e=$(printf '\303\251') 16 latin1_e=$(printf '\351')
+6
t/t4254-am-corrupt.sh
··· 5 TEST_PASSES_SANITIZE_LEAK=true 6 . ./test-lib.sh 7 8 make_mbox_with_nul () { 9 space=' ' 10 q_nul_in_subject=
··· 5 TEST_PASSES_SANITIZE_LEAK=true 6 . ./test-lib.sh 7 8 + if ! test_have_prereq ICONV 9 + then 10 + skip_all='skipping am encoding corruption tests; iconv not available' 11 + test_done 12 + fi 13 + 14 make_mbox_with_nul () { 15 space=' ' 16 q_nul_in_subject=
+12 -2
t/t5100-mailinfo.sh
··· 28 29 for mail in 00* 30 do 31 - test_expect_success "mailinfo $mail" ' 32 check_mailinfo "$mail" "" && 33 if test -f "$DATA/msg$mail--scissors" 34 then ··· 56 57 for mail in rfc2047/00* 58 do 59 - test_expect_success "mailinfo $mail" ' 60 git mailinfo -u "$mail-msg" "$mail-patch" <"$mail" >"$mail-info" && 61 echo msg && 62 test_cmp "$DATA/empty" "$mail-msg" &&
··· 28 29 for mail in 00* 30 do 31 + case "$mail" in 32 + 0004) 33 + prereq=ICONV;; 34 + esac 35 + 36 + test_expect_success $prereq "mailinfo $mail" ' 37 check_mailinfo "$mail" "" && 38 if test -f "$DATA/msg$mail--scissors" 39 then ··· 61 62 for mail in rfc2047/00* 63 do 64 + case "$mail" in 65 + rfc2047/0001) 66 + prereq=ICONV;; 67 + esac 68 + 69 + test_expect_success $prereq "mailinfo $mail" ' 70 git mailinfo -u "$mail-msg" "$mail-patch" <"$mail" >"$mail-info" && 71 echo msg && 72 test_cmp "$DATA/empty" "$mail-msg" &&
+10 -4
t/t5500-fetch-pack.sh
··· 774 # file with scheme 775 for p in file 776 do 777 - test_expect_success !MINGW "fetch-pack --diag-url $p://$h/$r" ' 778 check_prot_path $p://$h/$r $p "/$r" 779 ' 780 test_expect_success MINGW "fetch-pack --diag-url $p://$h/$r" ' ··· 784 check_prot_path $p:///$r $p "/$r" 785 ' 786 # No "/~" -> "~" conversion for file 787 - test_expect_success !MINGW "fetch-pack --diag-url $p://$h/~$r" ' 788 check_prot_path $p://$h/~$r $p "/~$r" 789 ' 790 test_expect_success MINGW "fetch-pack --diag-url $p://$h/~$r" ' ··· 806 p=ssh 807 for h in host [::1] 808 do 809 - test_expect_success "fetch-pack --diag-url $h:$r" ' 810 check_prot_host_port_path $h:$r $p "$h" NONE "$r" 811 ' 812 # Do "/~" -> "~" conversion 813 - test_expect_success "fetch-pack --diag-url $h:/~$r" ' 814 check_prot_host_port_path $h:/~$r $p "$h" NONE "~$r" 815 ' 816 done
··· 774 # file with scheme 775 for p in file 776 do 777 + test_expect_success !WINDOWS "fetch-pack --diag-url $p://$h/$r" ' 778 check_prot_path $p://$h/$r $p "/$r" 779 ' 780 test_expect_success MINGW "fetch-pack --diag-url $p://$h/$r" ' ··· 784 check_prot_path $p:///$r $p "/$r" 785 ' 786 # No "/~" -> "~" conversion for file 787 + test_expect_success !WINDOWS "fetch-pack --diag-url $p://$h/~$r" ' 788 check_prot_path $p://$h/~$r $p "/~$r" 789 ' 790 test_expect_success MINGW "fetch-pack --diag-url $p://$h/~$r" ' ··· 806 p=ssh 807 for h in host [::1] 808 do 809 + expectation="success" 810 + if test_have_prereq CYGWIN && test "$h" = "[::1]" 811 + then 812 + expectation="failure" 813 + fi 814 + 815 + test_expect_$expectation "fetch-pack --diag-url $h:$r" ' 816 check_prot_host_port_path $h:$r $p "$h" NONE "$r" 817 ' 818 # Do "/~" -> "~" conversion 819 + test_expect_$expectation "fetch-pack --diag-url $h:/~$r" ' 820 check_prot_host_port_path $h:/~$r $p "$h" NONE "~$r" 821 ' 822 done
+2 -2
t/t5550-http-fetch-dumb.sh
··· 344 grep "this is the error message" stderr 345 ' 346 347 - test_expect_success 'http error messages are reencoded' ' 348 test_must_fail git clone "$HTTPD_URL/error/utf16" 2>stderr && 349 grep "this is the error message" stderr 350 ' 351 352 - test_expect_success 'reencoding is robust to whitespace oddities' ' 353 test_must_fail git clone "$HTTPD_URL/error/odd-spacing" 2>stderr && 354 grep "this is the error message" stderr 355 '
··· 344 grep "this is the error message" stderr 345 ' 346 347 + test_expect_success ICONV 'http error messages are reencoded' ' 348 test_must_fail git clone "$HTTPD_URL/error/utf16" 2>stderr && 349 grep "this is the error message" stderr 350 ' 351 352 + test_expect_success ICONV 'reencoding is robust to whitespace oddities' ' 353 test_must_fail git clone "$HTTPD_URL/error/odd-spacing" 2>stderr && 354 grep "this is the error message" stderr 355 '
+9 -2
t/t5601-clone.sh
··· 530 ' 531 done 532 533 #ipv6 534 for repo in rep rep/home/project 123 535 do 536 - test_expect_success "clone [::1]:$repo" ' 537 test_clone_url [::1]:$repo ::1 "$repo" 538 ' 539 done ··· 542 test_clone_url host:/~repo host "~repo" 543 ' 544 545 - test_expect_success "clone [::1]:/~repo" ' 546 test_clone_url [::1]:/~repo ::1 "~repo" 547 ' 548
··· 530 ' 531 done 532 533 + # Parsing of paths that look like IPv6 addresses is broken on Cygwin. 534 + expectation_for_ipv6_tests=success 535 + if test_have_prereq CYGWIN 536 + then 537 + expectation_for_ipv6_tests=failure 538 + fi 539 + 540 #ipv6 541 for repo in rep rep/home/project 123 542 do 543 + test_expect_$expectation_for_ipv6_tests "clone [::1]:$repo" ' 544 test_clone_url [::1]:$repo ::1 "$repo" 545 ' 546 done ··· 549 test_clone_url host:/~repo host "~repo" 550 ' 551 552 + test_expect_$expectation_for_ipv6_tests "clone [::1]:/~repo" ' 553 test_clone_url [::1]:/~repo ::1 "~repo" 554 ' 555
+38 -18
t/t6006-rev-list-format.sh
··· 13 . "$TEST_DIRECTORY"/lib-terminal.sh 14 15 test_tick 16 - # Tested non-UTF-8 encoding 17 - test_encoding="ISO8859-1" 18 19 - # String "added" in German 20 - # (translated with Google Translate), 21 - # encoded in UTF-8, used as a commit log message below. 22 - added_utf8_part=$(printf "\303\274") 23 - added_utf8_part_iso88591=$(echo "$added_utf8_part" | iconv -f utf-8 -t $test_encoding) 24 - added=$(printf "added (hinzugef${added_utf8_part}gt) foo") 25 - added_iso88591=$(echo "$added" | iconv -f utf-8 -t $test_encoding) 26 - # same but "changed" 27 - changed_utf8_part=$(printf "\303\244") 28 - changed_utf8_part_iso88591=$(echo "$changed_utf8_part" | iconv -f utf-8 -t $test_encoding) 29 - changed=$(printf "changed (ge${changed_utf8_part}ndert) foo") 30 - changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t $test_encoding) 31 32 # Count of char to truncate 33 # Number is chosen so, that non-ACSII characters ··· 55 git config --unset i18n.commitEncoding 56 ' 57 58 - # usage: test_format [argument...] name format_string [failure] <expected_output 59 test_format () { 60 local args= 61 while true ··· 69 esac 70 done 71 cat >expect.$1 72 - test_expect_${3:-success} "format $1" " 73 git rev-list $args --pretty=format:'$2' main >output.$1 && 74 test_cmp expect.$1 output.$1 75 " ··· 198 1112911993 199 EOF 200 201 - test_format encoding %e <<EOF 202 commit $head2 203 $test_encoding 204 commit $head1 ··· 374 head3_short=$(git rev-parse --short $head3) 375 ' 376 377 - test_format complex-encoding %e <<EOF 378 commit $head3 379 $test_encoding 380 commit $head2
··· 13 . "$TEST_DIRECTORY"/lib-terminal.sh 14 15 test_tick 16 17 + if test_have_prereq ICONV 18 + then 19 + # Tested non-UTF-8 encoding 20 + test_encoding="ISO8859-1" 21 + 22 + # String "added" in German 23 + # (translated with Google Translate), 24 + # encoded in UTF-8, used as a commit log message below. 25 + added_utf8_part=$(printf "\303\274") 26 + added_utf8_part_iso88591=$(echo "$added_utf8_part" | iconv -f utf-8 -t $test_encoding) 27 + added=$(printf "added (hinzugef${added_utf8_part}gt) foo") 28 + added_iso88591=$(echo "$added" | iconv -f utf-8 -t $test_encoding) 29 + # same but "changed" 30 + changed_utf8_part=$(printf "\303\244") 31 + changed_utf8_part_iso88591=$(echo "$changed_utf8_part" | iconv -f utf-8 -t $test_encoding) 32 + changed=$(printf "changed (ge${changed_utf8_part}ndert) foo") 33 + changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t $test_encoding) 34 + else 35 + # Tested non-UTF-8 encoding 36 + test_encoding="UTF-8" 37 + 38 + # String "added" in German 39 + # (translated with Google Translate), 40 + # encoded in UTF-8, used as a commit log message below. 41 + added_utf8_part="u" 42 + added_utf8_part_iso88591="u" 43 + added=$(printf "added (hinzugef${added_utf8_part}gt) foo") 44 + added_iso88591="$added" 45 + # same but "changed" 46 + changed_utf8_part="a" 47 + changed_utf8_part_iso88591="a" 48 + changed=$(printf "changed (ge${changed_utf8_part}ndert) foo") 49 + changed_iso88591="$changed" 50 + fi 51 52 # Count of char to truncate 53 # Number is chosen so, that non-ACSII characters ··· 75 git config --unset i18n.commitEncoding 76 ' 77 78 + # usage: test_format [argument...] name format_string [success|failure] [prereq] <expected_output 79 test_format () { 80 local args= 81 while true ··· 89 esac 90 done 91 cat >expect.$1 92 + test_expect_${3:-success} $4 "format $1" " 93 git rev-list $args --pretty=format:'$2' main >output.$1 && 94 test_cmp expect.$1 output.$1 95 " ··· 218 1112911993 219 EOF 220 221 + test_format encoding %e success ICONV <<EOF 222 commit $head2 223 $test_encoding 224 commit $head1 ··· 394 head3_short=$(git rev-parse --short $head3) 395 ' 396 397 + test_format complex-encoding %e success ICONV <<EOF 398 commit $head3 399 $test_encoding 400 commit $head2
+24 -14
t/t7102-reset.sh
··· 13 TEST_PASSES_SANITIZE_LEAK=true 14 . ./test-lib.sh 15 16 - commit_msg () { 17 - # String "modify 2nd file (changed)" partly in German 18 - # (translated with Google Translate), 19 - # encoded in UTF-8, used as a commit log message below. 20 - msg="modify 2nd file (ge\303\244ndert)\n" 21 - if test -n "$1" 22 - then 23 - printf "$msg" | iconv -f utf-8 -t "$1" 24 - else 25 - printf "$msg" 26 - fi 27 - } 28 29 - # Tested non-UTF-8 encoding 30 - test_encoding="ISO8859-1" 31 32 test_expect_success 'creating initial files and commits' ' 33 test_tick &&
··· 13 TEST_PASSES_SANITIZE_LEAK=true 14 . ./test-lib.sh 15 16 + if test_have_prereq ICONV 17 + then 18 + commit_msg () { 19 + # String "modify 2nd file (changed)" partly in German 20 + # (translated with Google Translate), 21 + # encoded in UTF-8, used as a commit log message below. 22 + msg="modify 2nd file (ge\303\244ndert)\n" 23 + if test -n "$1" 24 + then 25 + printf "$msg" | iconv -f utf-8 -t "$1" 26 + else 27 + printf "$msg" 28 + fi 29 + } 30 31 + # Tested non-UTF-8 encoding 32 + test_encoding="ISO8859-1" 33 + else 34 + commit_msg () { 35 + echo "modify 2nd file (geandert)" 36 + } 37 + 38 + # Tested non-UTF-8 encoding 39 + test_encoding="UTF-8" 40 + fi 41 42 test_expect_success 'creating initial files and commits' ' 43 test_tick &&
+6
t/t8005-blame-i18n.sh
··· 3 test_description='git blame encoding conversion' 4 . ./test-lib.sh 5 6 . "$TEST_DIRECTORY"/t8005/utf8.txt 7 . "$TEST_DIRECTORY"/t8005/euc-japan.txt 8 . "$TEST_DIRECTORY"/t8005/sjis.txt
··· 3 test_description='git blame encoding conversion' 4 . ./test-lib.sh 5 6 + if ! test_have_prereq ICONV 7 + then 8 + skip_all='skipping blame i18n tests; iconv not available' 9 + test_done 10 + fi 11 + 12 . "$TEST_DIRECTORY"/t8005/utf8.txt 13 . "$TEST_DIRECTORY"/t8005/euc-japan.txt 14 . "$TEST_DIRECTORY"/t8005/sjis.txt
+1 -1
t/t9300-fast-import.sh
··· 3676 ### series X (other new features) 3677 ### 3678 3679 - test_expect_success 'X: handling encoding' ' 3680 test_tick && 3681 cat >input <<-INPUT_END && 3682 commit refs/heads/encoding
··· 3676 ### series X (other new features) 3677 ### 3678 3679 + test_expect_success ICONV 'X: handling encoding' ' 3680 test_tick && 3681 cat >input <<-INPUT_END && 3682 commit refs/heads/encoding
+5 -5
t/t9350-fast-export.sh
··· 125 test $MUSS = $(git rev-parse --verify refs/tags/muss) 126 ' 127 128 - test_expect_success 'reencoding iso-8859-7' ' 129 130 test_when_finished "git reset --hard HEAD~1" && 131 test_config i18n.commitencoding iso-8859-7 && ··· 421 422 EOF 423 424 - test_expect_success 'dropping tag of filtered out object' ' 425 ( 426 cd limit-by-paths && 427 git fast-export --tag-of-filtered-object=drop mytag -- there > output && ··· 438 439 EOF 440 441 - test_expect_success 'rewriting tag of filtered out object' ' 442 ( 443 cd limit-by-paths && 444 git fast-export --tag-of-filtered-object=rewrite mytag -- there > output && ··· 667 668 EOF 669 670 - test_expect_success 'avoid uninteresting refs' ' 671 > tmp-marks && 672 git fast-export --import-marks=tmp-marks \ 673 --export-marks=tmp-marks main > /dev/null && ··· 686 687 EOF 688 689 - test_expect_success 'refs are updated even if no commits need to be exported' ' 690 > tmp-marks && 691 git fast-export --import-marks=tmp-marks \ 692 --export-marks=tmp-marks main > /dev/null &&
··· 125 test $MUSS = $(git rev-parse --verify refs/tags/muss) 126 ' 127 128 + test_expect_success ICONV 'reencoding iso-8859-7' ' 129 130 test_when_finished "git reset --hard HEAD~1" && 131 test_config i18n.commitencoding iso-8859-7 && ··· 421 422 EOF 423 424 + test_expect_success ICONV 'dropping tag of filtered out object' ' 425 ( 426 cd limit-by-paths && 427 git fast-export --tag-of-filtered-object=drop mytag -- there > output && ··· 438 439 EOF 440 441 + test_expect_success ICONV 'rewriting tag of filtered out object' ' 442 ( 443 cd limit-by-paths && 444 git fast-export --tag-of-filtered-object=rewrite mytag -- there > output && ··· 667 668 EOF 669 670 + test_expect_success ICONV 'avoid uninteresting refs' ' 671 > tmp-marks && 672 git fast-export --import-marks=tmp-marks \ 673 --export-marks=tmp-marks main > /dev/null && ··· 686 687 EOF 688 689 + test_expect_success ICONV 'refs are updated even if no commits need to be exported' ' 690 > tmp-marks && 691 git fast-export --import-marks=tmp-marks \ 692 --export-marks=tmp-marks main > /dev/null &&
+2 -1
t/test-lib.sh
··· 1572 1573 prepend_var LSAN_OPTIONS : dedup_token_length=9999 1574 prepend_var LSAN_OPTIONS : log_exe_name=1 1575 - prepend_var LSAN_OPTIONS : log_path=\"$TEST_RESULTS_SAN_FILE\" 1576 export LSAN_OPTIONS 1577 1578 elif test "$GIT_TEST_PASSING_SANITIZE_LEAK" = "check" || ··· 1743 1744 ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1 1745 test -z "$NO_CURL" && test_set_prereq LIBCURL 1746 test -z "$NO_PERL" && test_set_prereq PERL 1747 test -z "$NO_PTHREADS" && test_set_prereq PTHREADS 1748 test -z "$NO_PYTHON" && test_set_prereq PYTHON
··· 1572 1573 prepend_var LSAN_OPTIONS : dedup_token_length=9999 1574 prepend_var LSAN_OPTIONS : log_exe_name=1 1575 + prepend_var LSAN_OPTIONS : log_path="'$TEST_RESULTS_SAN_FILE'" 1576 export LSAN_OPTIONS 1577 1578 elif test "$GIT_TEST_PASSING_SANITIZE_LEAK" = "check" || ··· 1743 1744 ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1 1745 test -z "$NO_CURL" && test_set_prereq LIBCURL 1746 + test -z "$NO_ICONV" && test_set_prereq ICONV 1747 test -z "$NO_PERL" && test_set_prereq PERL 1748 test -z "$NO_PTHREADS" && test_set_prereq PTHREADS 1749 test -z "$NO_PYTHON" && test_set_prereq PYTHON