rugged 1.6.5 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rugged/rugged_allocator.c +0 -54
  3. data/lib/rugged/version.rb +1 -1
  4. data/vendor/libgit2/CMakeLists.txt +3 -8
  5. data/vendor/libgit2/cmake/CheckPrototypeDefinitionSafe.cmake +16 -0
  6. data/vendor/libgit2/cmake/SelectGSSAPI.cmake +3 -3
  7. data/vendor/libgit2/cmake/SelectHTTPSBackend.cmake +21 -2
  8. data/vendor/libgit2/cmake/SelectHashes.cmake +4 -0
  9. data/vendor/libgit2/cmake/SelectXdiff.cmake +9 -0
  10. data/vendor/libgit2/deps/pcre/LICENCE +5 -5
  11. data/vendor/libgit2/deps/pcre/pcre.h +2 -2
  12. data/vendor/libgit2/deps/pcre/pcre_compile.c +6 -3
  13. data/vendor/libgit2/deps/pcre/pcre_exec.c +2 -2
  14. data/vendor/libgit2/deps/xdiff/CMakeLists.txt +28 -0
  15. data/vendor/libgit2/{src/libgit2 → deps}/xdiff/git-xdiff.h +4 -1
  16. data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xdiffi.c +19 -18
  17. data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xdiffi.h +2 -4
  18. data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xemit.c +3 -3
  19. data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xhistogram.c +7 -18
  20. data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xmacros.h +18 -1
  21. data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xmerge.c +24 -22
  22. data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xpatience.c +21 -30
  23. data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xprepare.c +13 -30
  24. data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xutils.c +18 -1
  25. data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xutils.h +2 -1
  26. data/vendor/libgit2/include/git2/common.h +26 -1
  27. data/vendor/libgit2/include/git2/diff.h +41 -3
  28. data/vendor/libgit2/include/git2/errors.h +4 -2
  29. data/vendor/libgit2/include/git2/index.h +9 -0
  30. data/vendor/libgit2/include/git2/oid.h +1 -1
  31. data/vendor/libgit2/include/git2/remote.h +18 -0
  32. data/vendor/libgit2/include/git2/repository.h +12 -2
  33. data/vendor/libgit2/include/git2/sys/alloc.h +0 -34
  34. data/vendor/libgit2/include/git2/sys/commit_graph.h +12 -2
  35. data/vendor/libgit2/include/git2/sys/midx.h +5 -1
  36. data/vendor/libgit2/include/git2/sys/stream.h +16 -2
  37. data/vendor/libgit2/include/git2/sys/transport.h +20 -2
  38. data/vendor/libgit2/include/git2/version.h +4 -4
  39. data/vendor/libgit2/include/git2/worktree.h +3 -1
  40. data/vendor/libgit2/src/CMakeLists.txt +34 -11
  41. data/vendor/libgit2/src/cli/cmd_clone.c +22 -6
  42. data/vendor/libgit2/src/cli/progress.c +9 -8
  43. data/vendor/libgit2/src/cli/progress.h +4 -4
  44. data/vendor/libgit2/src/libgit2/CMakeLists.txt +1 -19
  45. data/vendor/libgit2/src/libgit2/annotated_commit.c +2 -2
  46. data/vendor/libgit2/src/libgit2/annotated_commit.h +1 -1
  47. data/vendor/libgit2/src/libgit2/apply.c +4 -3
  48. data/vendor/libgit2/src/libgit2/blame.c +23 -16
  49. data/vendor/libgit2/src/libgit2/blame_git.c +0 -1
  50. data/vendor/libgit2/src/libgit2/branch.c +2 -2
  51. data/vendor/libgit2/src/libgit2/cherrypick.c +3 -3
  52. data/vendor/libgit2/src/libgit2/clone.c +3 -1
  53. data/vendor/libgit2/src/libgit2/commit.c +31 -9
  54. data/vendor/libgit2/src/libgit2/commit_graph.c +110 -43
  55. data/vendor/libgit2/src/libgit2/commit_graph.h +20 -4
  56. data/vendor/libgit2/src/libgit2/commit_list.c +12 -5
  57. data/vendor/libgit2/src/libgit2/commit_list.h +1 -0
  58. data/vendor/libgit2/src/libgit2/config_file.c +14 -8
  59. data/vendor/libgit2/src/libgit2/describe.c +10 -7
  60. data/vendor/libgit2/src/libgit2/diff.c +16 -7
  61. data/vendor/libgit2/src/libgit2/diff.h +6 -6
  62. data/vendor/libgit2/src/libgit2/diff_file.c +7 -7
  63. data/vendor/libgit2/src/libgit2/diff_generate.c +36 -15
  64. data/vendor/libgit2/src/libgit2/diff_parse.c +20 -4
  65. data/vendor/libgit2/src/libgit2/diff_print.c +26 -7
  66. data/vendor/libgit2/src/libgit2/diff_tform.c +4 -4
  67. data/vendor/libgit2/src/libgit2/diff_xdiff.h +1 -1
  68. data/vendor/libgit2/src/libgit2/email.c +4 -3
  69. data/vendor/libgit2/src/libgit2/errors.c +73 -18
  70. data/vendor/libgit2/src/libgit2/fetch.c +37 -9
  71. data/vendor/libgit2/src/libgit2/fetch.h +0 -2
  72. data/vendor/libgit2/src/libgit2/fetchhead.c +11 -9
  73. data/vendor/libgit2/src/libgit2/grafts.c +272 -0
  74. data/vendor/libgit2/src/libgit2/grafts.h +36 -0
  75. data/vendor/libgit2/src/libgit2/ident.c +3 -3
  76. data/vendor/libgit2/src/libgit2/index.c +325 -125
  77. data/vendor/libgit2/src/libgit2/index.h +14 -1
  78. data/vendor/libgit2/src/libgit2/indexer.c +10 -3
  79. data/vendor/libgit2/src/libgit2/iterator.c +20 -5
  80. data/vendor/libgit2/src/libgit2/iterator.h +3 -0
  81. data/vendor/libgit2/src/libgit2/libgit2.c +39 -0
  82. data/vendor/libgit2/src/libgit2/merge.c +14 -9
  83. data/vendor/libgit2/src/libgit2/merge_file.c +0 -2
  84. data/vendor/libgit2/src/libgit2/midx.c +66 -37
  85. data/vendor/libgit2/src/libgit2/midx.h +13 -3
  86. data/vendor/libgit2/src/libgit2/notes.c +9 -8
  87. data/vendor/libgit2/src/libgit2/object.c +40 -15
  88. data/vendor/libgit2/src/libgit2/object.h +6 -0
  89. data/vendor/libgit2/src/libgit2/odb.c +11 -5
  90. data/vendor/libgit2/src/libgit2/odb_pack.c +16 -3
  91. data/vendor/libgit2/src/libgit2/oid.c +7 -1
  92. data/vendor/libgit2/src/libgit2/oidarray.c +49 -3
  93. data/vendor/libgit2/src/libgit2/oidarray.h +5 -1
  94. data/vendor/libgit2/src/libgit2/pack-objects.c +19 -12
  95. data/vendor/libgit2/src/libgit2/pack-objects.h +5 -2
  96. data/vendor/libgit2/src/libgit2/pack.c +3 -3
  97. data/vendor/libgit2/src/libgit2/parse.c +7 -4
  98. data/vendor/libgit2/src/libgit2/parse.h +1 -1
  99. data/vendor/libgit2/src/libgit2/patch.h +7 -1
  100. data/vendor/libgit2/src/libgit2/patch_generate.c +24 -5
  101. data/vendor/libgit2/src/libgit2/patch_parse.c +16 -8
  102. data/vendor/libgit2/src/libgit2/push.c +2 -2
  103. data/vendor/libgit2/src/libgit2/reader.c +1 -1
  104. data/vendor/libgit2/src/libgit2/rebase.c +72 -84
  105. data/vendor/libgit2/src/libgit2/refdb_fs.c +22 -13
  106. data/vendor/libgit2/src/libgit2/refs.c +8 -1
  107. data/vendor/libgit2/src/libgit2/remote.c +15 -6
  108. data/vendor/libgit2/src/libgit2/remote.h +1 -0
  109. data/vendor/libgit2/src/libgit2/repository.c +580 -301
  110. data/vendor/libgit2/src/libgit2/repository.h +17 -2
  111. data/vendor/libgit2/src/libgit2/reset.c +2 -2
  112. data/vendor/libgit2/src/libgit2/revert.c +8 -11
  113. data/vendor/libgit2/src/libgit2/revparse.c +1 -4
  114. data/vendor/libgit2/src/libgit2/revwalk.c +26 -4
  115. data/vendor/libgit2/src/libgit2/stash.c +9 -8
  116. data/vendor/libgit2/src/libgit2/streams/mbedtls.c +0 -1
  117. data/vendor/libgit2/src/libgit2/streams/openssl.c +8 -16
  118. data/vendor/libgit2/src/libgit2/streams/schannel.c +715 -0
  119. data/vendor/libgit2/src/libgit2/streams/schannel.h +28 -0
  120. data/vendor/libgit2/src/libgit2/streams/socket.c +237 -51
  121. data/vendor/libgit2/src/libgit2/streams/socket.h +3 -1
  122. data/vendor/libgit2/src/libgit2/streams/stransport.c +40 -12
  123. data/vendor/libgit2/src/libgit2/streams/tls.c +5 -0
  124. data/vendor/libgit2/src/libgit2/submodule.h +3 -3
  125. data/vendor/libgit2/src/libgit2/threadstate.c +15 -2
  126. data/vendor/libgit2/src/libgit2/threadstate.h +1 -3
  127. data/vendor/libgit2/src/libgit2/transports/auth.h +1 -2
  128. data/vendor/libgit2/src/libgit2/transports/{auth_negotiate.c → auth_gssapi.c} +32 -32
  129. data/vendor/libgit2/src/libgit2/transports/auth_negotiate.h +1 -1
  130. data/vendor/libgit2/src/libgit2/transports/auth_ntlm.h +1 -1
  131. data/vendor/libgit2/src/libgit2/transports/{auth_ntlm.c → auth_ntlmclient.c} +12 -12
  132. data/vendor/libgit2/src/libgit2/transports/auth_sspi.c +341 -0
  133. data/vendor/libgit2/src/libgit2/transports/git.c +7 -8
  134. data/vendor/libgit2/src/libgit2/transports/http.c +7 -2
  135. data/vendor/libgit2/src/libgit2/transports/httpclient.c +5 -0
  136. data/vendor/libgit2/src/libgit2/transports/local.c +13 -4
  137. data/vendor/libgit2/src/libgit2/transports/smart.c +33 -27
  138. data/vendor/libgit2/src/libgit2/transports/smart.h +23 -8
  139. data/vendor/libgit2/src/libgit2/transports/smart_pkt.c +136 -17
  140. data/vendor/libgit2/src/libgit2/transports/smart_protocol.c +154 -47
  141. data/vendor/libgit2/src/libgit2/transports/ssh.c +3 -3
  142. data/vendor/libgit2/src/libgit2/transports/winhttp.c +14 -15
  143. data/vendor/libgit2/src/libgit2/tree-cache.c +26 -16
  144. data/vendor/libgit2/src/libgit2/tree-cache.h +5 -3
  145. data/vendor/libgit2/src/libgit2/tree.c +1 -1
  146. data/vendor/libgit2/src/libgit2/worktree.c +25 -10
  147. data/vendor/libgit2/src/util/alloc.c +65 -6
  148. data/vendor/libgit2/src/util/alloc.h +34 -9
  149. data/vendor/libgit2/src/util/allocators/failalloc.c +0 -60
  150. data/vendor/libgit2/src/util/allocators/failalloc.h +0 -6
  151. data/vendor/libgit2/src/util/allocators/stdalloc.c +2 -105
  152. data/vendor/libgit2/src/util/allocators/win32_leakcheck.c +0 -68
  153. data/vendor/libgit2/src/util/array.h +6 -1
  154. data/vendor/libgit2/src/util/cc-compat.h +2 -0
  155. data/vendor/libgit2/src/util/filebuf.c +6 -1
  156. data/vendor/libgit2/src/util/filebuf.h +19 -6
  157. data/vendor/libgit2/src/util/fs_path.c +1 -1
  158. data/vendor/libgit2/src/util/futils.c +8 -5
  159. data/vendor/libgit2/src/util/git2_features.h.in +9 -3
  160. data/vendor/libgit2/src/util/net.c +308 -157
  161. data/vendor/libgit2/src/util/net.h +25 -0
  162. data/vendor/libgit2/src/util/posix.c +54 -0
  163. data/vendor/libgit2/src/util/posix.h +22 -0
  164. data/vendor/libgit2/src/util/rand.c +6 -4
  165. data/vendor/libgit2/src/util/staticstr.h +66 -0
  166. data/vendor/libgit2/src/util/util.c +15 -10
  167. data/vendor/libgit2/src/util/util.h +24 -16
  168. data/vendor/libgit2/src/util/win32/error.c +1 -1
  169. data/vendor/libgit2/src/util/win32/path_w32.c +8 -8
  170. data/vendor/libgit2/src/util/win32/posix_w32.c +1 -1
  171. data/vendor/libgit2/src/util/win32/utf-conv.c +73 -75
  172. data/vendor/libgit2/src/util/win32/utf-conv.h +81 -14
  173. data/vendor/libgit2/src/util/win32/w32_util.c +1 -1
  174. metadata +29 -23
  175. data/vendor/libgit2/cmake/SelectWinHTTP.cmake +0 -17
  176. data/vendor/libgit2/src/libgit2/netops.c +0 -124
  177. data/vendor/libgit2/src/libgit2/netops.h +0 -68
  178. /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xdiff.h +0 -0
  179. /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xemit.h +0 -0
  180. /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xinclude.h +0 -0
  181. /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xprepare.h +0 -0
  182. /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xtypes.h +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12d371c731e1e760c9398e56d9c483b7dd402b0cb8aa7114876979799f8391d7
4
- data.tar.gz: d8f0d8e3d34848f5c47d417469bed92cadb5f19a22468d82025e0260c068fbdc
3
+ metadata.gz: 612678eb067cc67b95f2bab39559c502a323746387cb79d1f333148e84bf5746
4
+ data.tar.gz: 15a17bdb4bc6c5e60d0ee1605447962d1cd524f0e0330253dec3273774464d6b
5
5
  SHA512:
6
- metadata.gz: 165ab860c19b8520d8bd4cf9aae47fe03206a4ac2fe2eea06d19680a178e85822778bc122a87792b44ec12e63d3139c30e8a0d466556f307acc72c968daf41b7
7
- data.tar.gz: 2a9661cf572ea86ef8939b7e9d58f63ce4188d9050dedc461e48d3bf4face25abd87b1eaddafbeabc25a203cbb95710f884d5338577239763e668c4f14162093
6
+ metadata.gz: f20f497297ac36e2a63acdba4b15962c360f527ac107fd7f87200ee513d73fcf7e85bfe6da1427b10a7e8ae497edcbe14dcce3492ecace08b557fb87a72abf29
7
+ data.tar.gz: 4694b1dbce110bcfaac801bff104b5829d529eeba55d01e9bf939f74841dc11e357a9749e0a72ae02338f36ce2bdd7c1ad2da100ff46bc4b535361e41f67ade6
@@ -13,58 +13,11 @@ static void *rugged_gmalloc(size_t n, const char *file, int line)
13
13
  return xmalloc(n);
14
14
  }
15
15
 
16
- static void *rugged_gcalloc(size_t nelem, size_t elsize, const char *file, int line)
17
- {
18
- return xcalloc(nelem, elsize);
19
- }
20
-
21
- static char *rugged_gstrdup(const char *str, const char *file, int line)
22
- {
23
- return ruby_strdup(str);
24
- }
25
-
26
- static char *rugged_gstrndup(const char *str, size_t n, const char *file, int line)
27
- {
28
- size_t len;
29
- char *newstr;
30
-
31
- len = strnlen(str, n);
32
- if (len < n)
33
- n = len;
34
-
35
- newstr = xmalloc(n+1);
36
- memcpy(newstr, str, n);
37
- newstr[n] = '\0';
38
-
39
- return newstr;
40
- }
41
-
42
- static char *rugged_gsubstrdup(const char *str, size_t n, const char *file, int line)
43
- {
44
- char *newstr;
45
-
46
- newstr = xmalloc(n+1);
47
- memcpy(newstr, str, n);
48
- newstr[n] = '\0';
49
-
50
- return newstr;
51
- }
52
-
53
16
  static void *rugged_grealloc(void *ptr, size_t size, const char *file, int line)
54
17
  {
55
18
  return xrealloc(ptr, size);
56
19
  }
57
20
 
58
- static void *rugged_greallocarray(void *ptr, size_t nelem, size_t elsize, const char *file, int line)
59
- {
60
- return xrealloc2(ptr, nelem, elsize);
61
- }
62
-
63
- static void *rugged_gmallocarray(size_t nelem, size_t elsize, const char *file, int line)
64
- {
65
- return xmalloc2(nelem, elsize);
66
- }
67
-
68
21
  static void rugged_gfree(void *ptr)
69
22
  {
70
23
  xfree(ptr);
@@ -75,14 +28,7 @@ void rugged_set_allocator(void)
75
28
  git_allocator allocator;
76
29
 
77
30
  allocator.gmalloc = rugged_gmalloc;
78
- allocator.gcalloc = rugged_gcalloc;
79
- allocator.gstrdup = rugged_gstrdup;
80
- allocator.gstrndup = rugged_gstrndup;
81
- allocator.gstrndup = rugged_gstrndup;
82
- allocator.gsubstrdup = rugged_gsubstrdup;
83
31
  allocator.grealloc = rugged_grealloc;
84
- allocator.greallocarray = rugged_greallocarray;
85
- allocator.gmallocarray = rugged_gmallocarray;
86
32
  allocator.gfree = rugged_gfree;
87
33
 
88
34
  git_libgit2_opts(GIT_OPT_SET_ALLOCATOR, &allocator);
@@ -4,5 +4,5 @@
4
4
  # For full terms see the included LICENSE file.
5
5
 
6
6
  module Rugged
7
- Version = VERSION = '1.6.5'
7
+ Version = VERSION = '1.7.1'
8
8
  end
@@ -6,7 +6,7 @@
6
6
 
7
7
  cmake_minimum_required(VERSION 3.5.1)
8
8
 
9
- project(libgit2 VERSION "1.6.5" LANGUAGES C)
9
+ project(libgit2 VERSION "1.7.1" LANGUAGES C)
10
10
 
11
11
  # Add find modules to the path
12
12
  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
36
36
  option(USE_SHA256 "Enable SHA256. Can be set to HTTPS/Builtin" ON)
37
37
  option(USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF)
38
38
  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.")
39
40
  set(REGEX_BACKEND "" CACHE STRING "Regular expression implementation. One of regcomp_l, pcre2, pcre, regcomp, or builtin.")
40
41
  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)
41
42
 
@@ -82,12 +83,6 @@ if(MSVC)
82
83
  option(WIN32_LEAKCHECK "Enable leak reporting via crtdbg" OFF)
83
84
  endif()
84
85
 
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
-
91
86
  if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
92
87
  set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
93
88
  endif()
@@ -99,7 +94,7 @@ include(CheckLibraryExists)
99
94
  include(CheckFunctionExists)
100
95
  include(CheckSymbolExists)
101
96
  include(CheckStructHasMember)
102
- include(CheckPrototypeDefinition)
97
+ include(CheckPrototypeDefinitionSafe)
103
98
  include(AddCFlagIfSupported)
104
99
  include(FindPkgLibraries)
105
100
  include(FindThreads)
@@ -0,0 +1,16 @@
1
+ include(CheckPrototypeDefinition)
2
+
3
+ function(check_prototype_definition_safe function prototype return header variable)
4
+ # temporarily save CMAKE_C_FLAGS and disable warnings about unused
5
+ # unused functions and parameters, otherwise they will always fail
6
+ # if ENABLE_WERROR is on
7
+ set(SAVED_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
8
+
9
+ disable_warnings(unused-function)
10
+ disable_warnings(unused-parameter)
11
+
12
+ check_prototype_definition("${function}" "${prototype}" "${return}" "${header}" "${variable}")
13
+
14
+ # restore CMAKE_C_FLAGS
15
+ set(CMAKE_C_FLAGS "${SAVED_CMAKE_C_FLAGS}")
16
+ endfunction()
@@ -29,7 +29,7 @@ if(USE_GSSAPI)
29
29
  list(APPEND LIBGIT2_SYSTEM_LIBS ${GSSFRAMEWORK_LIBRARIES})
30
30
 
31
31
  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})")
33
33
  elseif(USE_GSSAPI STREQUAL "gssapi")
34
34
  if(NOT GSSAPI_FOUND)
35
35
  message(FATAL_ERROR "Asked for gssapi GSS backend, but it wasn't found")
@@ -38,11 +38,11 @@ if(USE_GSSAPI)
38
38
  list(APPEND LIBGIT2_SYSTEM_LIBS ${GSSAPI_LIBRARIES})
39
39
 
40
40
  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})")
42
42
  else()
43
43
  message(FATAL_ERROR "Asked for backend ${USE_GSSAPI} but it wasn't found")
44
44
  endif()
45
45
  else()
46
46
  set(GIT_GSSAPI 0)
47
- add_feature_info(SPNEGO NO "SPNEGO authentication support")
47
+ add_feature_info(GSSAPI NO "GSSAPI support for SPNEGO authentication")
48
48
  endif()
@@ -19,7 +19,7 @@ if(USE_HTTPS)
19
19
  message(STATUS "Security framework is too old, falling back to OpenSSL")
20
20
  set(USE_HTTPS "OpenSSL")
21
21
  endif()
22
- elseif(USE_WINHTTP)
22
+ elseif(WIN32)
23
23
  set(USE_HTTPS "WinHTTP")
24
24
  elseif(OPENSSL_FOUND)
25
25
  set(USE_HTTPS "OpenSSL")
@@ -106,8 +106,27 @@ if(USE_HTTPS)
106
106
  # https://github.com/ARMmbed/mbedtls/issues/228
107
107
  # For now, pass its link flags as our own
108
108
  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")
109
114
  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")
111
130
  elseif(USE_HTTPS STREQUAL "OpenSSL-Dynamic")
112
131
  set(GIT_OPENSSL 1)
113
132
  set(GIT_OPENSSL_DYNAMIC 1)
@@ -13,6 +13,8 @@ if(USE_SHA1 STREQUAL ON)
13
13
  elseif(USE_SHA1 STREQUAL "HTTPS")
14
14
  if(USE_HTTPS STREQUAL "SecureTransport")
15
15
  set(USE_SHA1 "CommonCrypto")
16
+ elseif(USE_HTTPS STREQUAL "Schannel")
17
+ set(USE_SHA1 "Win32")
16
18
  elseif(USE_HTTPS STREQUAL "WinHTTP")
17
19
  set(USE_SHA1 "Win32")
18
20
  elseif(USE_HTTPS)
@@ -51,6 +53,8 @@ endif()
51
53
  if(USE_SHA256 STREQUAL "HTTPS")
52
54
  if(USE_HTTPS STREQUAL "SecureTransport")
53
55
  set(USE_SHA256 "CommonCrypto")
56
+ elseif(USE_HTTPS STREQUAL "Schannel")
57
+ set(USE_SHA256 "Win32")
54
58
  elseif(USE_HTTPS STREQUAL "WinHTTP")
55
59
  set(USE_SHA256 "Win32")
56
60
  elseif(USE_HTTPS)
@@ -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()
@@ -19,13 +19,13 @@ THE BASIC LIBRARY FUNCTIONS
19
19
  ---------------------------
20
20
 
21
21
  Written by: Philip Hazel
22
- Email local part: ph10
23
- Email domain: cam.ac.uk
22
+ Email local part: Philip.Hazel
23
+ Email domain: gmail.com
24
24
 
25
25
  University of Cambridge Computing Service,
26
26
  Cambridge, England.
27
27
 
28
- Copyright (c) 1997-2020 University of Cambridge
28
+ Copyright (c) 1997-2021 University of Cambridge
29
29
  All rights reserved.
30
30
 
31
31
 
@@ -36,7 +36,7 @@ Written by: Zoltan Herczeg
36
36
  Email local part: hzmester
37
37
  Email domain: freemail.hu
38
38
 
39
- Copyright(c) 2010-2020 Zoltan Herczeg
39
+ Copyright(c) 2010-2021 Zoltan Herczeg
40
40
  All rights reserved.
41
41
 
42
42
 
@@ -47,7 +47,7 @@ Written by: Zoltan Herczeg
47
47
  Email local part: hzmester
48
48
  Email domain: freemail.hu
49
49
 
50
- Copyright(c) 2009-2020 Zoltan Herczeg
50
+ Copyright(c) 2009-2021 Zoltan Herczeg
51
51
  All rights reserved.
52
52
 
53
53
 
@@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
42
42
  /* The current PCRE version information. */
43
43
 
44
44
  #define PCRE_MAJOR 8
45
- #define PCRE_MINOR 44
45
+ #define PCRE_MINOR 45
46
46
  #define PCRE_PRERELEASE
47
- #define PCRE_DATE 2020-02-12
47
+ #define PCRE_DATE 2021-06-15
48
48
 
49
49
  #define PCRE_EXP_DECL extern
50
50
 
@@ -6,7 +6,7 @@
6
6
  and semantics are as close as possible to those of the Perl 5 language.
7
7
 
8
8
  Written by Philip Hazel
9
- Copyright (c) 1997-2020 University of Cambridge
9
+ Copyright (c) 1997-2021 University of Cambridge
10
10
 
11
11
  -----------------------------------------------------------------------------
12
12
  Redistribution and use in source and binary forms, with or without
@@ -9104,6 +9104,8 @@ pcre_uchar cworkspace[COMPILE_WORK_SIZE];
9104
9104
  similar way to cworkspace, it can be expanded using malloc() if necessary. */
9105
9105
 
9106
9106
  named_group named_groups[NAMED_GROUP_LIST_SIZE];
9107
+ cd->named_groups = named_groups;
9108
+ cd->named_group_list_size = NAMED_GROUP_LIST_SIZE;
9107
9109
 
9108
9110
  /* Set this early so that early errors get offset 0. */
9109
9111
 
@@ -9377,8 +9379,6 @@ cd->hwm = cworkspace;
9377
9379
  cd->iscondassert = FALSE;
9378
9380
  cd->start_workspace = cworkspace;
9379
9381
  cd->workspace_size = COMPILE_WORK_SIZE;
9380
- cd->named_groups = named_groups;
9381
- cd->named_group_list_size = NAMED_GROUP_LIST_SIZE;
9382
9382
  cd->start_pattern = (const pcre_uchar *)pattern;
9383
9383
  cd->end_pattern = (const pcre_uchar *)(pattern + STRLEN_UC((const pcre_uchar *)pattern));
9384
9384
  cd->req_varyopt = 0;
@@ -9489,6 +9489,7 @@ if (cd->names_found > 0)
9489
9489
  add_name(cd, ng->name, ng->length, ng->number);
9490
9490
  if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE)
9491
9491
  (PUBL(free))((void *)cd->named_groups);
9492
+ cd->named_group_list_size = 0; /* So we don't free it twice */
9492
9493
  }
9493
9494
 
9494
9495
  /* Set up a starting, non-extracting bracket, then compile the expression. On
@@ -9639,6 +9640,8 @@ if (errorcode != 0)
9639
9640
  {
9640
9641
  (PUBL(free))(re);
9641
9642
  PCRE_EARLY_ERROR_RETURN:
9643
+ if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE)
9644
+ (PUBL(free))((void *)cd->named_groups);
9642
9645
  *erroroffset = (int)(ptr - (const pcre_uchar *)pattern);
9643
9646
  PCRE_EARLY_ERROR_RETURN2:
9644
9647
  *errorptr = find_error_text(errorcode);
@@ -6,7 +6,7 @@
6
6
  and semantics are as close as possible to those of the Perl 5 language.
7
7
 
8
8
  Written by Philip Hazel
9
- Copyright (c) 1997-2018 University of Cambridge
9
+ Copyright (c) 1997-2021 University of Cambridge
10
10
 
11
11
  -----------------------------------------------------------------------------
12
12
  Redistribution and use in source and binary forms, with or without
@@ -758,7 +758,7 @@ for (;;)
758
758
  md->mark = NULL; /* In case previously set by assertion */
759
759
  RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md,
760
760
  eptrb, RM55);
761
- if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) &&
761
+ if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT || rrc == MATCH_KETRPOS) &&
762
762
  md->mark == NULL) md->mark = ecode + 2;
763
763
 
764
764
  /* A return of MATCH_SKIP_ARG means that matching failed at SKIP with an
@@ -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()
@@ -27,11 +27,14 @@
27
27
  # endif
28
28
  #endif
29
29
 
30
+ #define XDL_UNUSED GIT_UNUSED_ARG
31
+
30
32
  #define xdl_malloc(x) git__malloc(x)
33
+ #define xdl_calloc(n, sz) git__calloc(n, sz)
31
34
  #define xdl_free(ptr) git__free(ptr)
32
35
  #define xdl_realloc(ptr, x) git__realloc(ptr, x)
33
36
 
34
- #define XDL_BUG(msg) GIT_ASSERT(msg)
37
+ #define XDL_BUG(msg) GIT_ASSERT(!msg)
35
38
 
36
39
  #define xdl_regex_t git_regexp
37
40
  #define xdl_regmatch_t git_regmatch
@@ -315,16 +315,19 @@ int xdl_do_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
315
315
  long *kvd, *kvdf, *kvdb;
316
316
  xdalgoenv_t xenv;
317
317
  diffdata_t dd1, dd2;
318
+ int res;
318
319
 
319
- if (XDF_DIFF_ALG(xpp->flags) == XDF_PATIENCE_DIFF)
320
- return xdl_do_patience_diff(mf1, mf2, xpp, xe);
321
-
322
- if (XDF_DIFF_ALG(xpp->flags) == XDF_HISTOGRAM_DIFF)
323
- return xdl_do_histogram_diff(mf1, mf2, xpp, xe);
320
+ if (xdl_prepare_env(mf1, mf2, xpp, xe) < 0)
321
+ return -1;
324
322
 
325
- if (xdl_prepare_env(mf1, mf2, xpp, xe) < 0) {
323
+ if (XDF_DIFF_ALG(xpp->flags) == XDF_PATIENCE_DIFF) {
324
+ res = xdl_do_patience_diff(xpp, xe);
325
+ goto out;
326
+ }
326
327
 
327
- return -1;
328
+ if (XDF_DIFF_ALG(xpp->flags) == XDF_HISTOGRAM_DIFF) {
329
+ res = xdl_do_histogram_diff(xpp, xe);
330
+ goto out;
328
331
  }
329
332
 
330
333
  /*
@@ -334,7 +337,7 @@ int xdl_do_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
334
337
  * One is to store the forward path and one to store the backward path.
335
338
  */
336
339
  ndiags = xe->xdf1.nreff + xe->xdf2.nreff + 3;
337
- if (!(kvd = (long *) xdl_malloc((2 * ndiags + 2) * sizeof(long)))) {
340
+ if (!XDL_ALLOC_ARRAY(kvd, 2 * ndiags + 2)) {
338
341
 
339
342
  xdl_free_env(xe);
340
343
  return -1;
@@ -359,17 +362,15 @@ int xdl_do_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
359
362
  dd2.rchg = xe->xdf2.rchg;
360
363
  dd2.rindex = xe->xdf2.rindex;
361
364
 
362
- if (xdl_recs_cmp(&dd1, 0, dd1.nrec, &dd2, 0, dd2.nrec,
363
- kvdf, kvdb, (xpp->flags & XDF_NEED_MINIMAL) != 0, &xenv) < 0) {
364
-
365
- xdl_free(kvd);
366
- xdl_free_env(xe);
367
- return -1;
368
- }
369
-
365
+ res = xdl_recs_cmp(&dd1, 0, dd1.nrec, &dd2, 0, dd2.nrec,
366
+ kvdf, kvdb, (xpp->flags & XDF_NEED_MINIMAL) != 0,
367
+ &xenv);
370
368
  xdl_free(kvd);
369
+ out:
370
+ if (res < 0)
371
+ xdl_free_env(xe);
371
372
 
372
- return 0;
373
+ return res;
373
374
  }
374
375
 
375
376
 
@@ -972,7 +973,7 @@ void xdl_free_script(xdchange_t *xscr) {
972
973
  }
973
974
  }
974
975
 
975
- static int xdl_call_hunk_func(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
976
+ static int xdl_call_hunk_func(xdfenv_t *xe XDL_UNUSED, xdchange_t *xscr, xdemitcb_t *ecb,
976
977
  xdemitconf_t const *xecfg)
977
978
  {
978
979
  xdchange_t *xch, *xche;
@@ -56,9 +56,7 @@ int xdl_build_script(xdfenv_t *xe, xdchange_t **xscr);
56
56
  void xdl_free_script(xdchange_t *xscr);
57
57
  int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
58
58
  xdemitconf_t const *xecfg);
59
- int xdl_do_patience_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
60
- xdfenv_t *env);
61
- int xdl_do_histogram_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
62
- xdfenv_t *env);
59
+ int xdl_do_patience_diff(xpparam_t const *xpp, xdfenv_t *env);
60
+ int xdl_do_histogram_diff(xpparam_t const *xpp, xdfenv_t *env);
63
61
 
64
62
  #endif /* #if !defined(XDIFFI_H) */
@@ -65,7 +65,7 @@ xdchange_t *xdl_get_hunk(xdchange_t **xscr, xdemitconf_t const *xecfg)
65
65
  *xscr = xch;
66
66
  }
67
67
 
68
- if (*xscr == NULL)
68
+ if (!*xscr)
69
69
  return NULL;
70
70
 
71
71
  lxch = *xscr;
@@ -95,7 +95,7 @@ xdchange_t *xdl_get_hunk(xdchange_t **xscr, xdemitconf_t const *xecfg)
95
95
  }
96
96
 
97
97
 
98
- static long def_ff(const char *rec, long len, char *buf, long sz, void *priv)
98
+ static long def_ff(const char *rec, long len, char *buf, long sz)
99
99
  {
100
100
  if (len > 0 &&
101
101
  (isalpha((unsigned char)*rec) || /* identifier? */
@@ -117,7 +117,7 @@ static long match_func_rec(xdfile_t *xdf, xdemitconf_t const *xecfg, long ri,
117
117
  const char *rec;
118
118
  long len = xdl_get_rec(xdf, ri, &rec);
119
119
  if (!xecfg->find_func)
120
- return def_ff(rec, len, buf, sz, xecfg->find_func_priv);
120
+ return def_ff(rec, len, buf, sz);
121
121
  return xecfg->find_func(rec, len, buf, sz, xecfg->find_func_priv);
122
122
  }
123
123
 
@@ -251,7 +251,7 @@ static int find_lcs(xpparam_t const *xpp, xdfenv_t *env,
251
251
  int line1, int count1, int line2, int count2)
252
252
  {
253
253
  int b_ptr;
254
- int sz, ret = -1;
254
+ int ret = -1;
255
255
  struct histindex index;
256
256
 
257
257
  memset(&index, 0, sizeof(index));
@@ -265,23 +265,16 @@ static int find_lcs(xpparam_t const *xpp, xdfenv_t *env,
265
265
  index.rcha.head = NULL;
266
266
 
267
267
  index.table_bits = xdl_hashbits(count1);
268
- sz = index.records_size = 1 << index.table_bits;
269
- sz *= sizeof(struct record *);
270
- if (!(index.records = (struct record **) xdl_malloc(sz)))
268
+ index.records_size = 1 << index.table_bits;
269
+ if (!XDL_CALLOC_ARRAY(index.records, index.records_size))
271
270
  goto cleanup;
272
- memset(index.records, 0, sz);
273
271
 
274
- sz = index.line_map_size = count1;
275
- sz *= sizeof(struct record *);
276
- if (!(index.line_map = (struct record **) xdl_malloc(sz)))
272
+ index.line_map_size = count1;
273
+ if (!XDL_CALLOC_ARRAY(index.line_map, index.line_map_size))
277
274
  goto cleanup;
278
- memset(index.line_map, 0, sz);
279
275
 
280
- sz = index.line_map_size;
281
- sz *= sizeof(unsigned int);
282
- if (!(index.next_ptrs = (unsigned int *) xdl_malloc(sz)))
276
+ if (!XDL_CALLOC_ARRAY(index.next_ptrs, index.line_map_size))
283
277
  goto cleanup;
284
- memset(index.next_ptrs, 0, sz);
285
278
 
286
279
  /* lines / 4 + 1 comes from xprepare.c:xdl_prepare_ctx() */
287
280
  if (xdl_cha_init(&index.rcha, sizeof(struct record), count1 / 4 + 1) < 0)
@@ -369,12 +362,8 @@ out:
369
362
  return result;
370
363
  }
371
364
 
372
- int xdl_do_histogram_diff(mmfile_t *file1, mmfile_t *file2,
373
- xpparam_t const *xpp, xdfenv_t *env)
365
+ int xdl_do_histogram_diff(xpparam_t const *xpp, xdfenv_t *env)
374
366
  {
375
- if (xdl_prepare_env(file1, file2, xpp, env) < 0)
376
- return -1;
377
-
378
367
  return histogram_diff(xpp, env,
379
368
  env->xdf1.dstart + 1, env->xdf1.dend - env->xdf1.dstart + 1,
380
369
  env->xdf2.dstart + 1, env->xdf2.dend - env->xdf2.dstart + 1);
@@ -34,7 +34,6 @@
34
34
  #define XDL_ADDBITS(v,b) ((v) + ((v) >> (b)))
35
35
  #define XDL_MASKBITS(b) ((1UL << (b)) - 1)
36
36
  #define XDL_HASHLONG(v,b) (XDL_ADDBITS((unsigned long)(v), b) & XDL_MASKBITS(b))
37
- #define XDL_PTRFREE(p) do { if (p) { xdl_free(p); (p) = NULL; } } while (0)
38
37
  #define XDL_LE32_PUT(p, v) \
39
38
  do { \
40
39
  unsigned char *__p = (unsigned char *) (p); \
@@ -50,5 +49,23 @@ do { \
50
49
  ((unsigned long) __p[2]) << 16 | ((unsigned long) __p[3]) << 24; \
51
50
  } while (0)
52
51
 
52
+ /* Allocate an array of nr elements, returns NULL on failure */
53
+ #define XDL_ALLOC_ARRAY(p, nr) \
54
+ ((p) = SIZE_MAX / sizeof(*(p)) >= (size_t)(nr) \
55
+ ? xdl_malloc((nr) * sizeof(*(p))) \
56
+ : NULL)
57
+
58
+ /* Allocate an array of nr zeroed out elements, returns NULL on failure */
59
+ #define XDL_CALLOC_ARRAY(p, nr) ((p) = xdl_calloc(nr, sizeof(*(p))))
60
+
61
+ /*
62
+ * Ensure array p can accommodate at least nr elements, growing the
63
+ * array and updating alloc (which is the number of allocated
64
+ * elements) as necessary. Frees p and returns -1 on failure, returns
65
+ * 0 on success
66
+ */
67
+ #define XDL_ALLOC_GROW(p, nr, alloc) \
68
+ (-!((nr) <= (alloc) || \
69
+ ((p) = xdl_alloc_grow_helper((p), (nr), &(alloc), sizeof(*(p))))))
53
70
 
54
71
  #endif /* #if !defined(XMACROS_H) */