Skip to content

Commit 190a4c5

Browse files
committed
Merge remote-tracking branch 'origin/main' into shallow-clone-network
2 parents e288f87 + 8a62616 commit 190a4c5

File tree

240 files changed

+4685
-1244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+4685
-1244
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,19 @@ jobs:
130130
SKIP_SSH_TESTS: true
131131
SKIP_NEGOTIATE_TESTS: true
132132
setup-script: osx
133-
- name: "Windows (amd64, Visual Studio)"
133+
- name: "Windows (amd64, Visual Studio, Schannel)"
134134
id: windows-amd64-vs
135135
os: windows-2019
136136
setup-script: win32
137137
env:
138138
ARCH: amd64
139139
CMAKE_GENERATOR: Visual Studio 16 2019
140-
CMAKE_OPTIONS: -A x64 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_SSH=ON -DCMAKE_PREFIX_PATH=D:\Temp\libssh2
140+
CMAKE_OPTIONS: -A x64 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_HTTPS=Schannel -DUSE_SSH=ON -DCMAKE_PREFIX_PATH=D:\Temp\libssh2
141141
BUILD_PATH: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin;D:\Temp\libssh2\bin
142142
BUILD_TEMP: D:\Temp
143143
SKIP_SSH_TESTS: true
144144
SKIP_NEGOTIATE_TESTS: true
145-
- name: "Windows (x86, Visual Studio)"
145+
- name: "Windows (x86, Visual Studio, WinHTTP)"
146146
id: windows-x86-vs
147147
os: windows-2019
148148
setup-script: win32
@@ -154,7 +154,7 @@ jobs:
154154
BUILD_TEMP: D:\Temp
155155
SKIP_SSH_TESTS: true
156156
SKIP_NEGOTIATE_TESTS: true
157-
- name: "Windows (amd64, mingw)"
157+
- name: "Windows (amd64, mingw, WinHTTP)"
158158
id: windows-amd64-mingw
159159
os: windows-2019
160160
setup-script: mingw
@@ -166,14 +166,14 @@ jobs:
166166
BUILD_PATH: D:\Temp\mingw64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
167167
SKIP_SSH_TESTS: true
168168
SKIP_NEGOTIATE_TESTS: true
169-
- name: "Windows (x86, mingw)"
169+
- name: "Windows (x86, mingw, Schannel)"
170170
id: windows-x86-mingw
171171
os: windows-2019
172172
setup-script: mingw
173173
env:
174174
ARCH: x86
175175
CMAKE_GENERATOR: MinGW Makefiles
176-
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
176+
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON -DUSE_HTTPS=Schannel
177177
BUILD_TEMP: D:\Temp
178178
BUILD_PATH: D:\Temp\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
179179
SKIP_SSH_TESTS: true

.github/workflows/nightly.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,32 +162,39 @@ jobs:
162162
SKIP_SSH_TESTS: true
163163
SKIP_NEGOTIATE_TESTS: true
164164
setup-script: osx
165-
- name: "Windows (amd64, Visual Studio)"
165+
- name: "Windows (amd64, Visual Studio, WinHTTP)"
166166
os: windows-2019
167167
env:
168168
ARCH: amd64
169169
CMAKE_GENERATOR: Visual Studio 16 2019
170-
CMAKE_OPTIONS: -A x64 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON
170+
CMAKE_OPTIONS: -A x64 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_HTTPS=WinHTTP
171171
SKIP_SSH_TESTS: true
172172
SKIP_NEGOTIATE_TESTS: true
173-
- name: "Windows (no mmap)"
173+
- name: "Windows (x86, Visual Studio, WinHTTP)"
174+
os: windows-2019
175+
env:
176+
ARCH: x86
177+
CMAKE_GENERATOR: Visual Studio 16 2019
178+
CMAKE_OPTIONS: -A Win32 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_HTTPS=WinHTTP -DUSE_SHA1=HTTPS -DUSE_BUNDLED_ZLIB=ON
179+
SKIP_SSH_TESTS: true
180+
SKIP_NEGOTIATE_TESTS: true
181+
- name: "Windows (amd64, Visual Studio, Schannel)"
174182
os: windows-2019
175183
env:
176184
ARCH: amd64
177185
CMAKE_GENERATOR: Visual Studio 16 2019
178-
CFLAGS: -DNO_MMAP
179-
CMAKE_OPTIONS: -A x64 -DDEPRECATE_HARD=ON
186+
CMAKE_OPTIONS: -A x64 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_HTTPS=Schannel
180187
SKIP_SSH_TESTS: true
181188
SKIP_NEGOTIATE_TESTS: true
182-
- name: "Windows (x86, Visual Studio)"
189+
- name: "Windows (x86, Visual Studio, Schannel)"
183190
os: windows-2019
184191
env:
185192
ARCH: x86
186193
CMAKE_GENERATOR: Visual Studio 16 2019
187-
CMAKE_OPTIONS: -A Win32 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS -DUSE_BUNDLED_ZLIB=ON
194+
CMAKE_OPTIONS: -A Win32 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_HTTPS=Schannel -DUSE_BUNDLED_ZLIB=ON
188195
SKIP_SSH_TESTS: true
189196
SKIP_NEGOTIATE_TESTS: true
190-
- name: "Windows (amd64, mingw)"
197+
- name: "Windows (amd64, mingw, WinHTTP)"
191198
os: windows-2019
192199
setup-script: mingw
193200
env:
@@ -198,17 +205,26 @@ jobs:
198205
BUILD_PATH: D:\Temp\mingw64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
199206
SKIP_SSH_TESTS: true
200207
SKIP_NEGOTIATE_TESTS: true
201-
- name: "Windows (x86, mingw)"
208+
- name: "Windows (x86, mingw, Schannel)"
202209
os: windows-2019
203210
setup-script: mingw
204211
env:
205212
ARCH: x86
206213
CMAKE_GENERATOR: MinGW Makefiles
207-
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
214+
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON -DUSE_HTTPS=Schannel
208215
BUILD_TEMP: D:\Temp
209216
BUILD_PATH: D:\Temp\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
210217
SKIP_SSH_TESTS: true
211218
SKIP_NEGOTIATE_TESTS: true
219+
- name: "Windows (no mmap)"
220+
os: windows-2019
221+
env:
222+
ARCH: amd64
223+
CMAKE_GENERATOR: Visual Studio 16 2019
224+
CFLAGS: -DNO_MMAP
225+
CMAKE_OPTIONS: -A x64 -DDEPRECATE_HARD=ON
226+
SKIP_SSH_TESTS: true
227+
SKIP_NEGOTIATE_TESTS: true
212228
- name: "Linux (Bionic, GCC, dynamically-loaded OpenSSL)"
213229
container:
214230
name: bionic

CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
cmake_minimum_required(VERSION 3.5.1)
88

9-
project(libgit2 VERSION "1.6.2" LANGUAGES C)
9+
project(libgit2 VERSION "1.7.0" LANGUAGES C)
1010

1111
# Add find modules to the path
1212
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
@@ -36,6 +36,7 @@ option(USE_SHA1 "Enable SHA1. Can be set to CollisionDetection(ON
3636
option(USE_SHA256 "Enable SHA256. Can be set to HTTPS/Builtin" ON)
3737
option(USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF)
3838
set(USE_HTTP_PARSER "" CACHE STRING "Specifies the HTTP Parser implementation; either system or builtin.")
39+
# set(USE_XDIFF "" CACHE STRING "Specifies the xdiff implementation; either system or builtin.")
3940
set(REGEX_BACKEND "" CACHE STRING "Regular expression implementation. One of regcomp_l, pcre2, pcre, regcomp, or builtin.")
4041
option(USE_BUNDLED_ZLIB "Use the bundled version of zlib. Can be set to one of Bundled(ON)/Chromium. The Chromium option requires a x86_64 processor with SSE4.2 and CLMUL" OFF)
4142

@@ -82,12 +83,6 @@ if(MSVC)
8283
option(WIN32_LEAKCHECK "Enable leak reporting via crtdbg" OFF)
8384
endif()
8485

85-
if(WIN32)
86-
# By default, libgit2 is built with WinHTTP. To use the built-in
87-
# HTTP transport, invoke CMake with the "-DUSE_WINHTTP=OFF" argument.
88-
option(USE_WINHTTP "Use Win32 WinHTTP routines" ON)
89-
endif()
90-
9186
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
9287
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
9388
endif()

cmake/SelectGSSAPI.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if(USE_GSSAPI)
2929
list(APPEND LIBGIT2_SYSTEM_LIBS ${GSSFRAMEWORK_LIBRARIES})
3030

3131
set(GIT_GSSFRAMEWORK 1)
32-
add_feature_info(SPNEGO GIT_GSSFRAMEWORK "SPNEGO authentication support (${USE_GSSAPI})")
32+
add_feature_info(GSSAPI GIT_GSSFRAMEWORK "GSSAPI support for SPNEGO authentication (${USE_GSSAPI})")
3333
elseif(USE_GSSAPI STREQUAL "gssapi")
3434
if(NOT GSSAPI_FOUND)
3535
message(FATAL_ERROR "Asked for gssapi GSS backend, but it wasn't found")
@@ -38,11 +38,11 @@ if(USE_GSSAPI)
3838
list(APPEND LIBGIT2_SYSTEM_LIBS ${GSSAPI_LIBRARIES})
3939

4040
set(GIT_GSSAPI 1)
41-
add_feature_info(SPNEGO GIT_GSSAPI "SPNEGO authentication support (${USE_GSSAPI})")
41+
add_feature_info(GSSAPI GIT_GSSAPI "GSSAPI support for SPNEGO authentication (${USE_GSSAPI})")
4242
else()
4343
message(FATAL_ERROR "Asked for backend ${USE_GSSAPI} but it wasn't found")
4444
endif()
4545
else()
4646
set(GIT_GSSAPI 0)
47-
add_feature_info(SPNEGO NO "SPNEGO authentication support")
47+
add_feature_info(GSSAPI NO "GSSAPI support for SPNEGO authentication")
4848
endif()

cmake/SelectHTTPSBackend.cmake

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if(USE_HTTPS)
1919
message(STATUS "Security framework is too old, falling back to OpenSSL")
2020
set(USE_HTTPS "OpenSSL")
2121
endif()
22-
elseif(USE_WINHTTP)
22+
elseif(WIN32)
2323
set(USE_HTTPS "WinHTTP")
2424
elseif(OPENSSL_FOUND)
2525
set(USE_HTTPS "OpenSSL")
@@ -106,8 +106,27 @@ if(USE_HTTPS)
106106
# https://github.com/ARMmbed/mbedtls/issues/228
107107
# For now, pass its link flags as our own
108108
list(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
109+
elseif(USE_HTTPS STREQUAL "Schannel")
110+
set(GIT_SCHANNEL 1)
111+
112+
list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32" "secur32")
113+
list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32" "-lsecur32")
109114
elseif(USE_HTTPS STREQUAL "WinHTTP")
110-
# WinHTTP setup was handled in the WinHTTP-specific block above
115+
set(GIT_WINHTTP 1)
116+
117+
# Since MinGW does not come with headers or an import library for winhttp,
118+
# we have to include a private header and generate our own import library
119+
if(MINGW)
120+
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/winhttp" "${PROJECT_BINARY_DIR}/deps/winhttp")
121+
list(APPEND LIBGIT2_SYSTEM_LIBS winhttp)
122+
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/winhttp")
123+
else()
124+
list(APPEND LIBGIT2_SYSTEM_LIBS "winhttp")
125+
list(APPEND LIBGIT2_PC_LIBS "-lwinhttp")
126+
endif()
127+
128+
list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32" "secur32")
129+
list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32" "-lsecur32")
111130
elseif(USE_HTTPS STREQUAL "OpenSSL-Dynamic")
112131
set(GIT_OPENSSL 1)
113132
set(GIT_OPENSSL_DYNAMIC 1)

cmake/SelectHashes.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ if(USE_SHA1 STREQUAL ON)
1313
elseif(USE_SHA1 STREQUAL "HTTPS")
1414
if(USE_HTTPS STREQUAL "SecureTransport")
1515
set(USE_SHA1 "CommonCrypto")
16+
elseif(USE_HTTPS STREQUAL "Schannel")
17+
set(USE_SHA1 "Win32")
1618
elseif(USE_HTTPS STREQUAL "WinHTTP")
1719
set(USE_SHA1 "Win32")
1820
elseif(USE_HTTPS)
@@ -51,6 +53,8 @@ endif()
5153
if(USE_SHA256 STREQUAL "HTTPS")
5254
if(USE_HTTPS STREQUAL "SecureTransport")
5355
set(USE_SHA256 "CommonCrypto")
56+
elseif(USE_HTTPS STREQUAL "Schannel")
57+
set(USE_SHA256 "Win32")
5458
elseif(USE_HTTPS STREQUAL "WinHTTP")
5559
set(USE_SHA256 "Win32")
5660
elseif(USE_HTTPS)

cmake/SelectWinHTTP.cmake

Lines changed: 0 additions & 17 deletions
This file was deleted.

cmake/SelectXdiff.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Optional external dependency: xdiff
2+
if(USE_XDIFF STREQUAL "system")
3+
message(FATAL_ERROR "external/system xdiff is not yet supported")
4+
else()
5+
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/xdiff" "${PROJECT_BINARY_DIR}/deps/xdiff")
6+
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/xdiff")
7+
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$<TARGET_OBJECTS:xdiff>")
8+
add_feature_info(xdiff ON "xdiff support (bundled)")
9+
endif()

deps/xdiff/CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
file(GLOB SRC_XDIFF "*.c" "*.h")
3+
list(SORT SRC_XDIFF)
4+
5+
add_library(xdiff OBJECT ${SRC_XDIFF})
6+
target_include_directories(xdiff SYSTEM PRIVATE
7+
"${PROJECT_SOURCE_DIR}/include"
8+
"${PROJECT_SOURCE_DIR}/src/util"
9+
"${PROJECT_BINARY_DIR}/src/util"
10+
${LIBGIT2_SYSTEM_INCLUDES}
11+
${LIBGIT2_DEPENDENCY_INCLUDES})
12+
13+
# the xdiff dependency is not (yet) warning-free, disable warnings
14+
# as errors for the xdiff sources until we've sorted them out
15+
if(MSVC)
16+
set_source_files_properties(xdiffi.c PROPERTIES COMPILE_FLAGS -WX-)
17+
set_source_files_properties(xemit.c PROPERTIES COMPILE_FLAGS -WX-)
18+
set_source_files_properties(xhistogram.c PROPERTIES COMPILE_FLAGS -WX-)
19+
set_source_files_properties(xmerge.c PROPERTIES COMPILE_FLAGS -WX-)
20+
set_source_files_properties(xutils.c PROPERTIES COMPILE_FLAGS -WX-)
21+
set_source_files_properties(xpatience.c PROPERTIES COMPILE_FLAGS -WX-)
22+
else()
23+
set_source_files_properties(xdiffi.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -Wno-unused-parameter")
24+
set_source_files_properties(xemit.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -Wno-unused-parameter")
25+
set_source_files_properties(xhistogram.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
26+
set_source_files_properties(xutils.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
27+
set_source_files_properties(xpatience.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
28+
endif()

0 commit comments

Comments
 (0)