Skip to content

Commit 2490df0

Browse files
committed
Merge branch 'ps/platform-compat-fixes' into jch
Various platform compatibility fixes split out of the larger effort to use Meson as the primary build tool. * ps/platform-compat-fixes: 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
2 parents f8cc52b + 80ebd91 commit 2490df0

30 files changed

+273
-136
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3176,6 +3176,7 @@ GIT-BUILD-OPTIONS: FORCE
31763176
@echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@+
31773177
@echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@+
31783178
@echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@+
3179+
@echo NO_ICONV=\''$(subst ','\'',$(subst ','\'',$(NO_ICONV)))'\' >>$@+
31793180
@echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+
31803181
@echo USE_LIBPCRE2=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE2)))'\' >>$@+
31813182
@echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+

builtin/credential-cache.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ int cmd_credential_cache(int argc,
189189

190190
#else
191191

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)
193194
{
194195
const char * const usage[] = {
195196
"git credential-cache [options] <action>",

contrib/buildsystems/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,7 @@ set(DIFF diff)
11091109
set(PYTHON_PATH /usr/bin/python)
11101110
set(TAR tar)
11111111
set(NO_CURL )
1112+
set(NO_ICONV )
11121113
set(NO_EXPAT )
11131114
set(USE_LIBPCRE2 )
11141115
set(NO_PERL )
@@ -1122,6 +1123,10 @@ if(NOT CURL_FOUND)
11221123
set(NO_CURL 1)
11231124
endif()
11241125

1126+
if(NOT Iconv_FOUND)
1127+
SET(NO_ICONV 1)
1128+
endif()
1129+
11251130
if(NOT EXPAT_FOUND)
11261131
set(NO_EXPAT 1)
11271132
endif()
@@ -1145,6 +1150,7 @@ file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "DIFF='${DIFF}'\n")
11451150
file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PYTHON_PATH='${PYTHON_PATH}'\n")
11461151
file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "TAR='${TAR}'\n")
11471152
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")
11481154
file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_EXPAT='${NO_EXPAT}'\n")
11491155
file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PERL='${NO_PERL}'\n")
11501156
file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PTHREADS='${NO_PTHREADS}'\n")

http.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,17 +2232,19 @@ static int http_request_reauth(const char *url,
22322232
case HTTP_REQUEST_STRBUF:
22332233
strbuf_reset(result);
22342234
break;
2235-
case HTTP_REQUEST_FILE:
2236-
if (fflush(result)) {
2235+
case HTTP_REQUEST_FILE: {
2236+
FILE *f = result;
2237+
if (fflush(f)) {
22372238
error_errno("unable to flush a file");
22382239
return HTTP_START_FAILED;
22392240
}
2240-
rewind(result);
2241-
if (ftruncate(fileno(result), 0) < 0) {
2241+
rewind(f);
2242+
if (ftruncate(fileno(f), 0) < 0) {
22422243
error_errno("unable to truncate a file");
22432244
return HTTP_START_FAILED;
22442245
}
22452246
break;
2247+
}
22462248
default:
22472249
BUG("Unknown http_request target");
22482250
}

t/lib-gitweb.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ EOF
4848
test -f "$SCRIPT_NAME" ||
4949
error "Cannot find gitweb at $GITWEB_TEST_INSTALLED."
5050
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"
5353
fi
5454
export SCRIPT_NAME
5555
}

t/lib-gpg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# executed in an eval'ed subshell that changes the working directory to a
77
# temporary one.
88

9-
GNUPGHOME="$PWD/gpghome"
9+
GNUPGHOME="$(pwd)/gpghome"
1010
export GNUPGHOME
1111

1212
test_lazy_prereq GPG '

t/t0028-working-tree-encoding.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ TEST_CREATE_REPO_NO_TEMPLATE=1
1212

1313
GIT_TRACE_WORKING_TREE_ENCODING=1 && export GIT_TRACE_WORKING_TREE_ENCODING
1414

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+
1521
test_expect_success 'setup test files' '
1622
git config core.eol lf &&
1723

t/t1401-symbolic-ref.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ reset_to_sane() {
1616
test_expect_success 'setup' '
1717
git symbolic-ref HEAD refs/heads/foo &&
1818
test_commit file &&
19-
"$TAR" cf .git.tar .git/
19+
"$TAR" cf .git.tar .git
2020
'
2121

2222
test_expect_success 'symbolic-ref read/write roundtrip' '

t/t2082-parallel-checkout-attributes.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test_expect_success 'parallel-checkout with ident' '
3434
)
3535
'
3636

37-
test_expect_success 'parallel-checkout with re-encoding' '
37+
test_expect_success ICONV 'parallel-checkout with re-encoding' '
3838
set_checkout_config 2 0 &&
3939
git init encoding &&
4040
(

t/t3404-rebase-interactive.sh

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,18 +1942,17 @@ test_expect_success '--update-refs updates refs correctly' '
19421942
test_cmp_rev HEAD~1 refs/heads/third &&
19431943
test_cmp_rev HEAD refs/heads/no-conflict-branch &&
19441944
1945-
cat >expect <<-\EOF &&
1945+
q_to_tab >expect <<-\EOF &&
19461946
Successfully rebased and updated refs/heads/update-refs.
19471947
Updated the following refs with --update-refs:
1948-
refs/heads/first
1949-
refs/heads/no-conflict-branch
1950-
refs/heads/second
1951-
refs/heads/third
1948+
Qrefs/heads/first
1949+
Qrefs/heads/no-conflict-branch
1950+
Qrefs/heads/second
1951+
Qrefs/heads/third
19521952
EOF
19531953
19541954
# Clear "Rebasing (X/Y)" progress lines and drop leading tabs.
1955-
sed -e "s/Rebasing.*Successfully/Successfully/g" -e "s/^\t//g" \
1956-
<err >err.trimmed &&
1955+
sed "s/Rebasing.*Successfully/Successfully/g" <err >err.trimmed &&
19571956
test_cmp expect err.trimmed
19581957
'
19591958

@@ -2203,19 +2202,18 @@ test_expect_success '--update-refs: check failed ref update' '
22032202
test_must_fail git rebase --continue 2>err &&
22042203
grep "update_ref failed for ref '\''refs/heads/second'\''" err &&
22052204
2206-
cat >expect <<-\EOF &&
2205+
q_to_tab >expect <<-\EOF &&
22072206
Updated the following refs with --update-refs:
2208-
refs/heads/first
2209-
refs/heads/no-conflict-branch
2210-
refs/heads/third
2207+
Qrefs/heads/first
2208+
Qrefs/heads/no-conflict-branch
2209+
Qrefs/heads/third
22112210
Failed to update the following refs with --update-refs:
2212-
refs/heads/second
2211+
Qrefs/heads/second
22132212
EOF
22142213
22152214
# Clear "Rebasing (X/Y)" progress lines and drop leading tabs.
22162215
tail -n 6 err >err.last &&
2217-
sed -e "s/Rebasing.*Successfully/Successfully/g" -e "s/^\t//g" \
2218-
<err.last >err.trimmed &&
2216+
sed "s/Rebasing.*Successfully/Successfully/g" <err.last >err.trimmed &&
22192217
test_cmp expect err.trimmed
22202218
'
22212219

0 commit comments

Comments
 (0)