Skip to content

Commit cbf18ed

Browse files
committed
Merge 'non-win-fixes' into HEAD
2 parents 6eb257c + 084500e commit cbf18ed

File tree

10 files changed

+47
-11
lines changed

10 files changed

+47
-11
lines changed

Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,14 +1059,11 @@ else
10591059
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
10601060
PROGRAM_OBJS += http-fetch.o
10611061
PROGRAMS += $(REMOTE_CURL_NAMES)
1062-
curl_check := $(shell (echo 070908; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
1063-
ifeq "$(curl_check)" "070908"
1062+
ifndef NO_CURL_MULTI
10641063
ifndef NO_EXPAT
10651064
PROGRAM_OBJS += http-push.o
10661065
endif
1067-
endif
1068-
curl_check := $(shell (echo 072200; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
1069-
ifeq "$(curl_check)" "072200"
1066+
# Assume that cURL is new enough
10701067
USE_CURL_FOR_IMAP_SEND = YesPlease
10711068
endif
10721069
ifdef USE_CURL_FOR_IMAP_SEND

builtin/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
227227
* running.
228228
*/
229229
time(NULL) - st.st_mtime <= 12 * 3600 &&
230-
fscanf(fp, "%"PRIuMAX" %127c", &pid, locking_host) == 2 &&
230+
fscanf(fp, "%"SCNuMAX" %127c", &pid, locking_host) == 2 &&
231231
/* be gentle to concurrent "gc" on remote hosts */
232232
(strcmp(locking_host, my_host) || !kill(pid, 0) || errno == EPERM);
233233
if (fp != NULL)

compat/regex/regcomp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
1919
02110-1301 USA. */
2020

21+
#include <stdint.h>
22+
2123
static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
2224
size_t length, reg_syntax_t syntax);
2325
static void re_compile_fastmap_iter (regex_t *bufp,
@@ -2577,7 +2579,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
25772579
old_tree = NULL;
25782580

25792581
if (elem->token.type == SUBEXP)
2580-
postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx);
2582+
postorder (elem, mark_opt_subexp, (void *) (intptr_t) elem->token.opr.idx);
25812583

25822584
tree = create_tree (dfa, elem, NULL, (end == -1 ? OP_DUP_ASTERISK : OP_ALT));
25832585
if (BE (tree == NULL, 0))
@@ -3806,7 +3808,7 @@ create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
38063808
static reg_errcode_t
38073809
mark_opt_subexp (void *extra, bin_tree_t *node)
38083810
{
3809-
int idx = (int) (long) extra;
3811+
int idx = (int) (intptr_t) extra;
38103812
if (node->token.type == SUBEXP && node->token.opr.idx == idx)
38113813
node->token.opt_subexp = 1;
38123814

configure.ac

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,17 @@ AC_CHECK_LIB([curl], [curl_global_init],
521521
[NO_CURL=],
522522
[NO_CURL=YesPlease])
523523

524+
if test -z "$NO_CURL"; then
525+
526+
AC_CHECK_DECLS([curl_multi_init],
527+
[NO_CURL_MULTI=],
528+
[NO_CURL_MULTI=UnfortunatelyYes],
529+
[[#include <curl/curl.h>]])
530+
531+
GIT_CONF_SUBST([NO_CURL_MULTI])
532+
533+
fi
534+
524535
GIT_UNSTASH_FLAGS($CURLDIR)
525536

526537
GIT_CONF_SUBST([NO_CURL])

git-compat-util.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ extern char *gitbasename(char *);
298298
#define PRIuMAX "llu"
299299
#endif
300300

301+
#ifndef SCNuMAX
302+
#define SCNuMAX PRIuMAX
303+
#endif
304+
301305
#ifndef PRIu32
302306
#define PRIu32 "u"
303307
#endif
@@ -570,7 +574,7 @@ extern int git_lstat(const char *, struct stat *);
570574
#endif
571575

572576
#define DEFAULT_PACKED_GIT_LIMIT \
573-
((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
577+
((1024L * 1024L) * (size_t)(sizeof(void*) >= 8 ? 8192 : 256))
574578

575579
#ifdef NO_PREAD
576580
#define pread git_pread

http.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,17 @@ static CURL *get_curl_handle(void)
429429

430430
if (curl_http_proxy) {
431431
curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
432+
#if LIBCURL_VERSION_NUM >= 0x071800
433+
if (starts_with(curl_http_proxy, "socks5"))
434+
curl_easy_setopt(result,
435+
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
436+
else if (starts_with(curl_http_proxy, "socks4a"))
437+
curl_easy_setopt(result,
438+
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
439+
else if (starts_with(curl_http_proxy, "socks"))
440+
curl_easy_setopt(result,
441+
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
442+
#endif
432443
}
433444
#if LIBCURL_VERSION_NUM >= 0x070a07
434445
curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);

imap-send.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,11 +1422,15 @@ static CURL *setup_curl(struct imap_server_conf *srvc)
14221422
curl_easy_setopt(curl, CURLOPT_PORT, server.port);
14231423

14241424
if (server.auth_method) {
1425+
#if LIBCURL_VERSION_NUM < 0x072200
1426+
warning("No LOGIN_OPTIONS support in this cURL version");
1427+
#else
14251428
struct strbuf auth = STRBUF_INIT;
14261429
strbuf_addstr(&auth, "AUTH=");
14271430
strbuf_addstr(&auth, server.auth_method);
14281431
curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, auth.buf);
14291432
strbuf_release(&auth);
1433+
#endif
14301434
}
14311435

14321436
if (!server.use_ssl)

pack-revindex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static int pack_revindex_hashsz;
2121

2222
static int pack_revindex_ix(struct packed_git *p)
2323
{
24-
unsigned long ui = (unsigned long)p;
24+
unsigned long ui = (unsigned long)(intptr_t)p;
2525
int i;
2626

2727
ui = ui ^ (ui >> 16); /* defeat structure alignment */

sha1_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2089,7 +2089,7 @@ static unsigned long pack_entry_hash(struct packed_git *p, off_t base_offset)
20892089
{
20902090
unsigned long hash;
20912091

2092-
hash = (unsigned long)p + (unsigned long)base_offset;
2092+
hash = (unsigned long)(intptr_t)p + (unsigned long)base_offset;
20932093
hash += (hash >> 8) + (hash >> 16);
20942094
return hash % MAX_DELTA_CACHE;
20952095
}

wrap-for-bin.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@ GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'
1919
PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH"
2020
export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR
2121

22+
if test -n "$TEST_GDB_GIT"
23+
then
24+
exec gdb -args "${GIT_EXEC_PATH}/@@PROG@@" "$@"
25+
echo "Could not run gdb -args ${GIT_EXEC_PATH}/@@PROG@@ $*" >&2
26+
exit 1
27+
fi
28+
2229
exec "${GIT_EXEC_PATH}/@@PROG@@" "$@"

0 commit comments

Comments
 (0)