Skip to content

Commit 268fd2f

Browse files
committed
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
2 parents 47c3170 + dd6003f commit 268fd2f

30 files changed

+275
-138
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3171,6 +3171,7 @@ GIT-BUILD-OPTIONS: FORCE
31713171
@echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@+
31723172
@echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@+
31733173
@echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@+
3174+
@echo NO_ICONV=\''$(subst ','\'',$(subst ','\'',$(NO_ICONV)))'\' >>$@+
31743175
@echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+
31753176
@echo USE_LIBPCRE2=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE2)))'\' >>$@+
31763177
@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
@@ -2290,17 +2290,19 @@ static int http_request_reauth(const char *url,
22902290
case HTTP_REQUEST_STRBUF:
22912291
strbuf_reset(result);
22922292
break;
2293-
case HTTP_REQUEST_FILE:
2294-
if (fflush(result)) {
2293+
case HTTP_REQUEST_FILE: {
2294+
FILE *f = result;
2295+
if (fflush(f)) {
22952296
error_errno("unable to flush a file");
22962297
return HTTP_START_FAILED;
22972298
}
2298-
rewind(result);
2299-
if (ftruncate(fileno(result), 0) < 0) {
2299+
rewind(f);
2300+
if (ftruncate(fileno(f), 0) < 0) {
23002301
error_errno("unable to truncate a file");
23012302
return HTTP_START_FAILED;
23022303
}
23032304
break;
2305+
}
23042306
default:
23052307
BUG("Unknown http_request target");
23062308
}

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
@@ -1917,18 +1917,17 @@ test_expect_success '--update-refs updates refs correctly' '
19171917
test_cmp_rev HEAD~1 refs/heads/third &&
19181918
test_cmp_rev HEAD refs/heads/no-conflict-branch &&
19191919
1920-
cat >expect <<-\EOF &&
1920+
q_to_tab >expect <<-\EOF &&
19211921
Successfully rebased and updated refs/heads/update-refs.
19221922
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
19271927
EOF
19281928
19291929
# 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 &&
19321931
test_cmp expect err.trimmed
19331932
'
19341933

@@ -2178,19 +2177,18 @@ test_expect_success '--update-refs: check failed ref update' '
21782177
test_must_fail git rebase --continue 2>err &&
21792178
grep "update_ref failed for ref '\''refs/heads/second'\''" err &&
21802179
2181-
cat >expect <<-\EOF &&
2180+
q_to_tab >expect <<-\EOF &&
21822181
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
21862185
Failed to update the following refs with --update-refs:
2187-
refs/heads/second
2186+
Qrefs/heads/second
21882187
EOF
21892188
21902189
# Clear "Rebasing (X/Y)" progress lines and drop leading tabs.
21912190
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 &&
21942192
test_cmp expect err.trimmed
21952193
'
21962194

0 commit comments

Comments
 (0)