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