rugged 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rugged/rugged_commit.c +1 -1
  3. data/lib/rugged/commit.rb +16 -2
  4. data/lib/rugged/version.rb +1 -1
  5. data/vendor/libgit2/CMakeLists.txt +31 -69
  6. data/vendor/libgit2/cmake/{Modules/AddCFlagIfSupported.cmake → AddCFlagIfSupported.cmake} +0 -0
  7. data/vendor/libgit2/cmake/{Modules/EnableWarnings.cmake → EnableWarnings.cmake} +0 -0
  8. data/vendor/libgit2/cmake/{Modules/FindCoreFoundation.cmake → FindCoreFoundation.cmake} +0 -0
  9. data/vendor/libgit2/cmake/{Modules/FindGSSAPI.cmake → FindGSSAPI.cmake} +0 -0
  10. data/vendor/libgit2/cmake/{Modules/FindGSSFramework.cmake → FindGSSFramework.cmake} +0 -0
  11. data/vendor/libgit2/cmake/{Modules/FindHTTP_Parser.cmake → FindHTTP_Parser.cmake} +0 -0
  12. data/vendor/libgit2/cmake/{Modules/FindIconv.cmake → FindIconv.cmake} +0 -0
  13. data/vendor/libgit2/cmake/{Modules/FindPCRE.cmake → FindPCRE.cmake} +0 -0
  14. data/vendor/libgit2/cmake/{Modules/FindPCRE2.cmake → FindPCRE2.cmake} +0 -0
  15. data/vendor/libgit2/cmake/{Modules/FindPkgLibraries.cmake → FindPkgLibraries.cmake} +0 -0
  16. data/vendor/libgit2/cmake/{Modules/FindSecurity.cmake → FindSecurity.cmake} +0 -0
  17. data/vendor/libgit2/cmake/{Modules/FindStatNsec.cmake → FindStatNsec.cmake} +0 -0
  18. data/vendor/libgit2/cmake/{Modules/FindmbedTLS.cmake → FindmbedTLS.cmake} +0 -0
  19. data/vendor/libgit2/cmake/{Modules/IdeSplitSources.cmake → IdeSplitSources.cmake} +0 -0
  20. data/vendor/libgit2/cmake/{Modules/PkgBuildConfig.cmake → PkgBuildConfig.cmake} +0 -0
  21. data/vendor/libgit2/cmake/{Modules/SanitizeBool.cmake → SanitizeBool.cmake} +0 -0
  22. data/vendor/libgit2/cmake/{Modules/SelectGSSAPI.cmake → SelectGSSAPI.cmake} +18 -26
  23. data/vendor/libgit2/cmake/{Modules/SelectHTTPSBackend.cmake → SelectHTTPSBackend.cmake} +25 -32
  24. data/vendor/libgit2/cmake/{Modules/SelectHashes.cmake → SelectHashes.cmake} +20 -28
  25. data/vendor/libgit2/deps/http-parser/CMakeLists.txt +4 -3
  26. data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +6 -5
  27. data/vendor/libgit2/deps/ntlmclient/compat.h +8 -1
  28. data/vendor/libgit2/deps/ntlmclient/ntlm.c +8 -11
  29. data/vendor/libgit2/deps/pcre/LICENCE +93 -0
  30. data/vendor/libgit2/deps/pcre/pcre.h +2 -2
  31. data/vendor/libgit2/deps/pcre/pcre_compile.c +29 -17
  32. data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +4 -4
  33. data/vendor/libgit2/deps/pcre/pcreposix.c +2 -3
  34. data/vendor/libgit2/deps/zlib/CMakeLists.txt +6 -5
  35. data/vendor/libgit2/deps/zlib/deflate.c +1 -0
  36. data/vendor/libgit2/include/git2/annotated_commit.h +1 -1
  37. data/vendor/libgit2/include/git2/blame.h +2 -0
  38. data/vendor/libgit2/include/git2/common.h +15 -3
  39. data/vendor/libgit2/include/git2/deprecated.h +42 -2
  40. data/vendor/libgit2/include/git2/errors.h +2 -1
  41. data/vendor/libgit2/include/git2/index.h +1 -2
  42. data/vendor/libgit2/include/git2/pack.h +1 -1
  43. data/vendor/libgit2/include/git2/strarray.h +6 -10
  44. data/vendor/libgit2/include/git2/version.h +4 -4
  45. data/vendor/libgit2/src/CMakeLists.txt +53 -41
  46. data/vendor/libgit2/src/apply.c +5 -1
  47. data/vendor/libgit2/src/assert_safe.h +58 -0
  48. data/vendor/libgit2/src/attr_file.c +8 -3
  49. data/vendor/libgit2/src/attrcache.c +2 -3
  50. data/vendor/libgit2/src/blame.c +2 -0
  51. data/vendor/libgit2/src/blame_git.c +6 -3
  52. data/vendor/libgit2/src/blob.c +2 -0
  53. data/vendor/libgit2/src/branch.c +19 -21
  54. data/vendor/libgit2/src/buffer.c +6 -3
  55. data/vendor/libgit2/src/cache.c +1 -22
  56. data/vendor/libgit2/src/checkout.c +49 -72
  57. data/vendor/libgit2/src/cherrypick.c +2 -0
  58. data/vendor/libgit2/src/clone.c +78 -18
  59. data/vendor/libgit2/src/common.h +1 -0
  60. data/vendor/libgit2/src/config.c +3 -7
  61. data/vendor/libgit2/src/config_entries.c +35 -27
  62. data/vendor/libgit2/src/config_parse.c +1 -1
  63. data/vendor/libgit2/src/config_snapshot.c +2 -1
  64. data/vendor/libgit2/src/describe.c +5 -1
  65. data/vendor/libgit2/src/diff.c +12 -11
  66. data/vendor/libgit2/src/diff_file.c +3 -1
  67. data/vendor/libgit2/src/diff_generate.c +10 -11
  68. data/vendor/libgit2/src/diff_parse.c +2 -3
  69. data/vendor/libgit2/src/diff_print.c +63 -60
  70. data/vendor/libgit2/src/diff_stats.c +12 -11
  71. data/vendor/libgit2/src/diff_tform.c +2 -3
  72. data/vendor/libgit2/src/errors.c +2 -0
  73. data/vendor/libgit2/src/fetch.c +2 -0
  74. data/vendor/libgit2/src/filter.c +3 -3
  75. data/vendor/libgit2/src/futils.c +3 -3
  76. data/vendor/libgit2/src/futils.h +3 -3
  77. data/vendor/libgit2/src/global.c +3 -1
  78. data/vendor/libgit2/src/idxmap.c +0 -22
  79. data/vendor/libgit2/src/index.c +12 -7
  80. data/vendor/libgit2/src/indexer.c +10 -4
  81. data/vendor/libgit2/src/iterator.c +4 -4
  82. data/vendor/libgit2/src/merge.c +13 -7
  83. data/vendor/libgit2/src/merge_file.c +4 -6
  84. data/vendor/libgit2/src/midx.c +418 -0
  85. data/vendor/libgit2/src/midx.h +83 -0
  86. data/vendor/libgit2/src/mwindow.c +124 -51
  87. data/vendor/libgit2/src/net.c +6 -1
  88. data/vendor/libgit2/src/object.c +2 -1
  89. data/vendor/libgit2/src/odb.c +9 -6
  90. data/vendor/libgit2/src/odb_loose.c +3 -3
  91. data/vendor/libgit2/src/odb_mempack.c +2 -0
  92. data/vendor/libgit2/src/oid.c +2 -0
  93. data/vendor/libgit2/src/pack-objects.c +29 -21
  94. data/vendor/libgit2/src/pack.c +47 -28
  95. data/vendor/libgit2/src/pack.h +19 -2
  96. data/vendor/libgit2/src/patch_generate.c +1 -3
  97. data/vendor/libgit2/src/patch_parse.c +4 -2
  98. data/vendor/libgit2/src/path.c +4 -4
  99. data/vendor/libgit2/src/pathspec.c +4 -3
  100. data/vendor/libgit2/src/pool.c +21 -15
  101. data/vendor/libgit2/src/pool.h +9 -1
  102. data/vendor/libgit2/src/proxy.c +2 -0
  103. data/vendor/libgit2/src/push.c +2 -0
  104. data/vendor/libgit2/src/rebase.c +2 -0
  105. data/vendor/libgit2/src/refdb.c +135 -0
  106. data/vendor/libgit2/src/refdb.h +69 -0
  107. data/vendor/libgit2/src/refdb_fs.c +19 -81
  108. data/vendor/libgit2/src/reflog.c +2 -6
  109. data/vendor/libgit2/src/refs.c +60 -188
  110. data/vendor/libgit2/src/refs.h +1 -19
  111. data/vendor/libgit2/src/regexp.c +2 -2
  112. data/vendor/libgit2/src/remote.c +32 -17
  113. data/vendor/libgit2/src/repository.c +168 -79
  114. data/vendor/libgit2/src/repository.h +10 -27
  115. data/vendor/libgit2/src/revert.c +2 -0
  116. data/vendor/libgit2/src/revparse.c +5 -4
  117. data/vendor/libgit2/src/revwalk.c +3 -5
  118. data/vendor/libgit2/src/settings.c +9 -0
  119. data/vendor/libgit2/src/sortedcache.c +2 -3
  120. data/vendor/libgit2/src/stash.c +2 -0
  121. data/vendor/libgit2/src/status.c +2 -0
  122. data/vendor/libgit2/src/strarray.c +63 -0
  123. data/vendor/libgit2/src/streams/openssl.c +12 -6
  124. data/vendor/libgit2/src/streams/registry.c +5 -3
  125. data/vendor/libgit2/src/submodule.c +6 -4
  126. data/vendor/libgit2/src/sysdir.c +4 -20
  127. data/vendor/libgit2/src/sysdir.h +0 -11
  128. data/vendor/libgit2/src/tag.c +2 -0
  129. data/vendor/libgit2/src/thread-utils.h +139 -21
  130. data/vendor/libgit2/src/transaction.c +2 -1
  131. data/vendor/libgit2/src/transports/credential.c +2 -0
  132. data/vendor/libgit2/src/transports/credential_helpers.c +2 -0
  133. data/vendor/libgit2/src/transports/httpclient.c +6 -8
  134. data/vendor/libgit2/src/transports/local.c +2 -2
  135. data/vendor/libgit2/src/transports/smart.c +2 -2
  136. data/vendor/libgit2/src/transports/winhttp.c +18 -7
  137. data/vendor/libgit2/src/unix/posix.h +13 -1
  138. data/vendor/libgit2/src/util.c +25 -58
  139. data/vendor/libgit2/src/util.h +2 -2
  140. data/vendor/libgit2/src/win32/git2.rc +18 -3
  141. data/vendor/libgit2/src/win32/path_w32.c +2 -2
  142. data/vendor/libgit2/src/worktree.c +4 -0
  143. metadata +27 -25
  144. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +0 -29
  145. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +0 -96
  146. data/vendor/libgit2/src/refdb_fs.h +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a71025a0b98dfed66af094ccdc24138d61bf4159eb05c49bf8fb9823a5ba34b
4
- data.tar.gz: c1e1978022f16609de31a310a476c8f0d96cc26018c92f41bd7c10d5fac42cd2
3
+ metadata.gz: bbddd8ed7b9186720e00287a27151807d91fb5bae97754109b7889ef9518d9b9
4
+ data.tar.gz: 21b205847f5ebeb4acaa10025ccb2703efc89791825df5790960447e7cdf8a57
5
5
  SHA512:
6
- metadata.gz: 3a17566ce7dc49b8fe819e4b6c1ef44a7afc6fd538895f93177332273330cd1aedcf855f2ee3093a0deb74a2fff16d22f9b4a3e602a3d6a9e9ed782a013d9227
7
- data.tar.gz: 2f36b64dab2fe738396b5ab5fc9c64354266d4bd3338ff77a8298a8bd0a659e37915945101583436113bf72d7db47d063e0a6aef27a877a84e1a175f13fcc7df
6
+ metadata.gz: e5b9bfd98f318ada120b757c77d25509ead843a1902065b26fb5427e3507ee67493679d2e8c6dc622daa50fb31c4cc787d59b030ce450679cec5c4d2e09aacb2
7
+ data.tar.gz: 7a6fc974d28c9205662f980c0d2067cb077d4b825798d9781a31fffddb7d0041739b6d68d36fc4cf59082ff8f4fc4e500810a40c54081e1df7f59cabdcbdbebc
@@ -425,7 +425,7 @@ struct commit_data {
425
425
  * Note that parents may be set even when the function errors, so make
426
426
  * sure to free this data.
427
427
  */
428
- static VALUE parse_commit_options(struct commit_data *out, git_repository *repo, VALUE rb_data)
428
+ static int parse_commit_options(struct commit_data *out, git_repository *repo, VALUE rb_data)
429
429
  {
430
430
  VALUE rb_message, rb_tree, rb_parents, rb_ref;
431
431
  int error = 0, parent_count, i;
@@ -19,10 +19,24 @@ module Rugged
19
19
 
20
20
  # Return a diff between this commit and its first parent or another commit or tree.
21
21
  #
22
+ # The commit is treated as the new side of the diff by default
23
+ #
22
24
  # See Rugged::Tree#diff for more details.
23
25
  def diff(*args)
24
- args.unshift(parents.first) if args.size == 1 && args.first.is_a?(Hash)
25
- self.tree.diff(*args)
26
+ raise ArgumentError("wrong number of arguments (given #{args.length}, expected 0..2") if args.length > 2
27
+ other, opts = args
28
+ if other.is_a?(Hash)
29
+ opts = other
30
+ other = nil
31
+ end
32
+ opts ||= {}
33
+ # if other is not provided at all (as opposed to explicitly nil, or given)
34
+ # then diff against the prior commit
35
+ if args.empty? || args.first.is_a?(Hash)
36
+ other = parents.first
37
+ opts[:reverse] = !opts[:reverse]
38
+ end
39
+ self.tree.diff(other, opts)
26
40
  end
27
41
 
28
42
  # Return a diff between this commit and the workdir.
@@ -4,5 +4,5 @@
4
4
  # For full terms see the included LICENSE file.
5
5
 
6
6
  module Rugged
7
- Version = VERSION = '1.0.1'
7
+ Version = VERSION = '1.1.0'
8
8
  end
@@ -11,21 +11,12 @@
11
11
  # Install:
12
12
  # > cmake --build . --target install
13
13
 
14
- PROJECT(libgit2 C)
15
14
  CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1)
16
- CMAKE_POLICY(SET CMP0015 NEW)
17
- IF(POLICY CMP0051)
18
- CMAKE_POLICY(SET CMP0051 NEW)
19
- ENDIF()
20
- IF(POLICY CMP0042)
21
- CMAKE_POLICY(SET CMP0042 NEW)
22
- ENDIF()
23
- IF(POLICY CMP0054)
24
- CMAKE_POLICY(SET CMP0054 NEW)
25
- ENDIF()
15
+
16
+ project(libgit2 VERSION "1.1.0" LANGUAGES C)
26
17
 
27
18
  # Add find modules to the path
28
- SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${libgit2_SOURCE_DIR}/cmake/Modules/")
19
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${libgit2_SOURCE_DIR}/cmake/")
29
20
 
30
21
  INCLUDE(CheckLibraryExists)
31
22
  INCLUDE(CheckFunctionExists)
@@ -49,8 +40,6 @@ OPTION(THREADSAFE "Build libgit2 as threadsafe" ON)
49
40
  OPTION(BUILD_CLAR "Build Tests using the Clar suite" ON)
50
41
  OPTION(BUILD_EXAMPLES "Build library usage example apps" OFF)
51
42
  OPTION(BUILD_FUZZERS "Build the fuzz targets" OFF)
52
- OPTION(TAGS "Generate tags" OFF)
53
- OPTION(PROFILE "Generate profiling information" OFF)
54
43
  OPTION(ENABLE_TRACE "Enables tracing support" ON)
55
44
  OPTION(LIBGIT2_FILENAME "Name of the produced binary" OFF)
56
45
  OPTION(USE_SSH "Link with libssh2 to enable SSH support" ON)
@@ -104,16 +93,6 @@ IF(MSVC)
104
93
  OPTION(MSVC_CRTDBG "Enable CRTDBG memory leak reporting" OFF)
105
94
  ENDIF()
106
95
 
107
- FILE(STRINGS "${libgit2_SOURCE_DIR}/include/git2/version.h" GIT2_HEADER REGEX "^#define LIBGIT2_VERSION \"[^\"]*\"$")
108
-
109
- STRING(REGEX REPLACE "^.*LIBGIT2_VERSION \"([0-9]+).*$" "\\1" LIBGIT2_VERSION_MAJOR "${GIT2_HEADER}")
110
- STRING(REGEX REPLACE "^.*LIBGIT2_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" LIBGIT2_VERSION_MINOR "${GIT2_HEADER}")
111
- STRING(REGEX REPLACE "^.*LIBGIT2_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" LIBGIT2_VERSION_REV "${GIT2_HEADER}")
112
- SET(LIBGIT2_VERSION_STRING "${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}.${LIBGIT2_VERSION_REV}")
113
-
114
- FILE(STRINGS "${libgit2_SOURCE_DIR}/include/git2/version.h" GIT2_HEADER_SOVERSION REGEX "^#define LIBGIT2_SOVERSION \"([0-9.]+)\"$")
115
- STRING(REGEX REPLACE "^.*LIBGIT2_SOVERSION \"([0-9.]+)\"$" "\\1" LIBGIT2_SOVERSION "${GIT2_HEADER_SOVERSION}")
116
-
117
96
  IF (DEPRECATE_HARD)
118
97
  ADD_DEFINITIONS(-DGIT_DEPRECATE_HARD)
119
98
  ENDIF()
@@ -137,6 +116,11 @@ IF (MSVC)
137
116
  # /Gd - explicitly set cdecl calling convention
138
117
  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd")
139
118
 
119
+ IF (NOT (MSVC_VERSION LESS 1900))
120
+ # /guard:cf - Enable Control Flow Guard
121
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:cf")
122
+ ENDIF()
123
+
140
124
  IF (STATIC_CRT)
141
125
  SET(CRT_FLAG_DEBUG "/MTd")
142
126
  SET(CRT_FLAG_RELEASE "/MT")
@@ -181,7 +165,12 @@ IF (MSVC)
181
165
  # /NXCOMPAT - Data execution prevention (DEP)
182
166
  # /LARGEADDRESSAWARE - >2GB user address space on x86
183
167
  # /VERSION - Embed version information in PE header
184
- SET(CMAKE_EXE_LINKER_FLAGS "/DYNAMICBASE /NXCOMPAT /LARGEADDRESSAWARE /VERSION:${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}")
168
+ SET(CMAKE_EXE_LINKER_FLAGS "/DYNAMICBASE /NXCOMPAT /LARGEADDRESSAWARE /VERSION:${libgit2_VERSION_MAJOR}.${libgit2_VERSION_MINOR}")
169
+
170
+ IF (NOT (MSVC_VERSION LESS 1900))
171
+ # /GUARD:CF - Enable Control Flow Guard
172
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /GUARD:CF")
173
+ ENDIF()
185
174
 
186
175
  # /DEBUG - Create a PDB
187
176
  # /LTCG - Link time code generation (whole program optimization)
@@ -232,35 +221,27 @@ ELSE ()
232
221
  ADD_DEFINITIONS(-D__USE_MINGW_ANSI_STDIO=1)
233
222
  ENDIF ()
234
223
 
235
- ENABLE_WARNINGS(documentation)
236
- DISABLE_WARNINGS(missing-field-initializers)
237
- ENABLE_WARNINGS(strict-aliasing)
238
- ENABLE_WARNINGS(strict-prototypes)
239
- ENABLE_WARNINGS(declaration-after-statement)
240
- ENABLE_WARNINGS(shift-count-overflow)
241
- ENABLE_WARNINGS(unused-const-variable)
242
- ENABLE_WARNINGS(unused-function)
243
- ENABLE_WARNINGS(int-conversion)
224
+ enable_warnings(documentation)
225
+ disable_warnings(documentation-deprecated-sync)
226
+ disable_warnings(missing-field-initializers)
227
+ enable_warnings(strict-aliasing)
228
+ enable_warnings(strict-prototypes)
229
+ enable_warnings(declaration-after-statement)
230
+ enable_warnings(shift-count-overflow)
231
+ enable_warnings(unused-const-variable)
232
+ enable_warnings(unused-function)
233
+ enable_warnings(int-conversion)
244
234
 
245
235
  # MinGW uses gcc, which expects POSIX formatting for printf, but
246
236
  # uses the Windows C library, which uses its own format specifiers.
247
237
  # Disable format specifier warnings.
248
- IF(MINGW)
249
- DISABLE_WARNINGS(format)
250
- DISABLE_WARNINGS(format-security)
251
- ELSE()
252
- ENABLE_WARNINGS(format)
253
- ENABLE_WARNINGS(format-security)
254
- ENDIF()
255
-
256
- IF("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
257
- DISABLE_WARNINGS(documentation-deprecated-sync)
258
- ENDIF()
259
-
260
- IF (PROFILE)
261
- SET(CMAKE_C_FLAGS "-pg ${CMAKE_C_FLAGS}")
262
- SET(CMAKE_EXE_LINKER_FLAGS "-pg ${CMAKE_EXE_LINKER_FLAGS}")
263
- ENDIF ()
238
+ if(MINGW)
239
+ disable_warnings(format)
240
+ disable_warnings(format-security)
241
+ else()
242
+ enable_warnings(format)
243
+ enable_warnings(format-security)
244
+ endif()
264
245
  ENDIF()
265
246
 
266
247
  # Ensure that MinGW provides the correct header files.
@@ -300,25 +281,6 @@ IF (BUILD_CLAR)
300
281
  ADD_SUBDIRECTORY(tests)
301
282
  ENDIF ()
302
283
 
303
- IF (TAGS)
304
- FIND_PROGRAM(CTAGS ctags)
305
- IF (NOT CTAGS)
306
- MESSAGE(FATAL_ERROR "Could not find ctags command")
307
- ENDIF ()
308
-
309
- FILE(GLOB_RECURSE SRC_ALL *.[ch])
310
-
311
- ADD_CUSTOM_COMMAND(
312
- OUTPUT tags
313
- COMMAND ${CTAGS} -a ${SRC_ALL}
314
- DEPENDS ${SRC_ALL}
315
- )
316
- ADD_CUSTOM_TARGET(
317
- do_tags ALL
318
- DEPENDS tags
319
- )
320
- ENDIF ()
321
-
322
284
  IF (BUILD_EXAMPLES)
323
285
  ADD_SUBDIRECTORY(examples)
324
286
  ENDIF ()
@@ -1,35 +1,27 @@
1
- # Select the backend to use
2
-
3
- # We try to find any packages our backends might use
4
-
5
1
  INCLUDE(SanitizeBool)
6
2
 
3
+ # We try to find any packages our backends might use
7
4
  FIND_PACKAGE(GSSAPI)
8
5
  IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
9
6
  INCLUDE(FindGSSFramework)
10
7
  ENDIF()
11
8
 
12
- # Auto-select GSS backend
13
- SanitizeBool(USE_GSSAPI)
14
- IF (USE_GSSAPI STREQUAL ON)
15
- IF (GSSFRAMEWORK_FOUND)
16
- SET(GSS_BACKEND "GSS.framework")
17
- ELSEIF(GSSAPI_FOUND)
18
- SET(GSS_BACKEND "gssapi")
19
- ELSE()
20
- MESSAGE(FATAL_ERROR "Unable to autodetect a usable GSS backend."
21
- "Please pass the backend name explicitly (-DUSE_GSS=backend)")
9
+ IF(USE_GSSAPI)
10
+ # Auto-select GSS backend
11
+ SanitizeBool(USE_GSSAPI)
12
+ IF (USE_GSSAPI STREQUAL ON)
13
+ IF (GSSFRAMEWORK_FOUND)
14
+ SET(USE_GSSAPI "GSS.framework")
15
+ ELSEIF(GSSAPI_FOUND)
16
+ SET(USE_GSSAPI "gssapi")
17
+ ELSE()
18
+ MESSAGE(FATAL_ERROR "Unable to autodetect a usable GSS backend."
19
+ "Please pass the backend name explicitly (-DUSE_GSS=backend)")
20
+ ENDIF()
22
21
  ENDIF()
23
- ELSEIF(USE_GSSAPI)
24
- # Backend was explicitly set
25
- SET(GSS_BACKEND ${USE_GSSAPI})
26
- ELSE()
27
- SET(GSS_BACKEND NO)
28
- ENDIF()
29
22
 
30
- IF(GSS_BACKEND)
31
23
  # Check that we can find what's required for the selected backend
32
- IF (GSS_BACKEND STREQUAL "GSS.framework")
24
+ IF (USE_GSSAPI STREQUAL "GSS.framework")
33
25
  IF (NOT GSSFRAMEWORK_FOUND)
34
26
  MESSAGE(FATAL_ERROR "Asked for GSS.framework backend, but it wasn't found")
35
27
  ENDIF()
@@ -37,8 +29,8 @@ IF(GSS_BACKEND)
37
29
  LIST(APPEND LIBGIT2_LIBS ${GSSFRAMEWORK_LIBRARIES})
38
30
 
39
31
  SET(GIT_GSSFRAMEWORK 1)
40
- ADD_FEATURE_INFO(SPNEGO GIT_GSSFRAMEWORK "SPNEGO authentication support (${GSS_BACKEND})")
41
- ELSEIF (GSS_BACKEND STREQUAL "gssapi")
32
+ ADD_FEATURE_INFO(SPNEGO GIT_GSSFRAMEWORK "SPNEGO authentication support (${USE_GSSAPI})")
33
+ ELSEIF (USE_GSSAPI STREQUAL "gssapi")
42
34
  IF (NOT GSSAPI_FOUND)
43
35
  MESSAGE(FATAL_ERROR "Asked for gssapi GSS backend, but it wasn't found")
44
36
  ENDIF()
@@ -46,9 +38,9 @@ IF(GSS_BACKEND)
46
38
  LIST(APPEND LIBGIT2_LIBS ${GSSAPI_LIBRARIES})
47
39
 
48
40
  SET(GIT_GSSAPI 1)
49
- ADD_FEATURE_INFO(SPNEGO GIT_GSSAPI "SPNEGO authentication support (${GSS_BACKEND})")
41
+ ADD_FEATURE_INFO(SPNEGO GIT_GSSAPI "SPNEGO authentication support (${USE_GSSAPI})")
50
42
  ELSE()
51
- MESSAGE(FATAL_ERROR "Asked for backend ${GSS_BACKEND} but it wasn't found")
43
+ MESSAGE(FATAL_ERROR "Asked for backend ${USE_GSSAPI} but it wasn't found")
52
44
  ENDIF()
53
45
  ELSE()
54
46
  SET(GIT_GSSAPI 0)
@@ -1,5 +1,3 @@
1
- # Select the backend to use
2
-
3
1
  INCLUDE(SanitizeBool)
4
2
 
5
3
  # We try to find any packages our backends might use
@@ -10,36 +8,31 @@ IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
10
8
  FIND_PACKAGE(CoreFoundation)
11
9
  ENDIF()
12
10
 
13
- # Auto-select TLS backend
14
- SanitizeBool(USE_HTTPS)
15
- IF (USE_HTTPS STREQUAL ON)
16
- IF (SECURITY_FOUND)
17
- IF (SECURITY_HAS_SSLCREATECONTEXT)
18
- SET(HTTPS_BACKEND "SecureTransport")
11
+ IF(USE_HTTPS)
12
+ # Auto-select TLS backend
13
+ SanitizeBool(USE_HTTPS)
14
+ IF (USE_HTTPS STREQUAL ON)
15
+ IF (SECURITY_FOUND)
16
+ IF (SECURITY_HAS_SSLCREATECONTEXT)
17
+ SET(USE_HTTPS "SecureTransport")
18
+ ELSE()
19
+ MESSAGE(STATUS "Security framework is too old, falling back to OpenSSL")
20
+ SET(USE_HTTPS "OpenSSL")
21
+ ENDIF()
22
+ ELSEIF (WINHTTP)
23
+ SET(USE_HTTPS "WinHTTP")
24
+ ELSEIF(OPENSSL_FOUND)
25
+ SET(USE_HTTPS "OpenSSL")
26
+ ELSEIF(MBEDTLS_FOUND)
27
+ SET(USE_HTTPS "mbedTLS")
19
28
  ELSE()
20
- MESSAGE(STATUS "Security framework is too old, falling back to OpenSSL")
21
- SET(HTTPS_BACKEND "OpenSSL")
29
+ MESSAGE(FATAL_ERROR "Unable to autodetect a usable HTTPS backend."
30
+ "Please pass the backend name explicitly (-DUSE_HTTPS=backend)")
22
31
  ENDIF()
23
- ELSEIF (WINHTTP)
24
- SET(HTTPS_BACKEND "WinHTTP")
25
- ELSEIF(OPENSSL_FOUND)
26
- SET(HTTPS_BACKEND "OpenSSL")
27
- ELSEIF(MBEDTLS_FOUND)
28
- SET(HTTPS_BACKEND "mbedTLS")
29
- ELSE()
30
- MESSAGE(FATAL_ERROR "Unable to autodetect a usable HTTPS backend."
31
- "Please pass the backend name explicitly (-DUSE_HTTPS=backend)")
32
32
  ENDIF()
33
- ELSEIF(USE_HTTPS)
34
- # HTTPS backend was explicitly set
35
- SET(HTTPS_BACKEND ${USE_HTTPS})
36
- ELSE()
37
- SET(HTTPS_BACKEND NO)
38
- ENDIF()
39
33
 
40
- IF(HTTPS_BACKEND)
41
34
  # Check that we can find what's required for the selected backend
42
- IF (HTTPS_BACKEND STREQUAL "SecureTransport")
35
+ IF (USE_HTTPS STREQUAL "SecureTransport")
43
36
  IF (NOT COREFOUNDATION_FOUND)
44
37
  MESSAGE(FATAL_ERROR "Cannot use SecureTransport backend, CoreFoundation.framework not found")
45
38
  ENDIF()
@@ -54,7 +47,7 @@ IF(HTTPS_BACKEND)
54
47
  LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${SECURITY_INCLUDE_DIR})
55
48
  LIST(APPEND LIBGIT2_LIBS ${COREFOUNDATION_LDFLAGS} ${SECURITY_LDFLAGS})
56
49
  LIST(APPEND LIBGIT2_PC_LIBS ${COREFOUNDATION_LDFLAGS} ${SECURITY_LDFLAGS})
57
- ELSEIF (HTTPS_BACKEND STREQUAL "OpenSSL")
50
+ ELSEIF (USE_HTTPS STREQUAL "OpenSSL")
58
51
  IF (NOT OPENSSL_FOUND)
59
52
  MESSAGE(FATAL_ERROR "Asked for OpenSSL TLS backend, but it wasn't found")
60
53
  ENDIF()
@@ -64,7 +57,7 @@ IF(HTTPS_BACKEND)
64
57
  LIST(APPEND LIBGIT2_LIBS ${OPENSSL_LIBRARIES})
65
58
  LIST(APPEND LIBGIT2_PC_LIBS ${OPENSSL_LDFLAGS})
66
59
  LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
67
- ELSEIF(HTTPS_BACKEND STREQUAL "mbedTLS")
60
+ ELSEIF(USE_HTTPS STREQUAL "mbedTLS")
68
61
  IF (NOT MBEDTLS_FOUND)
69
62
  MESSAGE(FATAL_ERROR "Asked for mbedTLS backend, but it wasn't found")
70
63
  ENDIF()
@@ -113,14 +106,14 @@ IF(HTTPS_BACKEND)
113
106
  # https://github.com/ARMmbed/mbedtls/issues/228
114
107
  # For now, pass its link flags as our own
115
108
  LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
116
- ELSEIF (HTTPS_BACKEND STREQUAL "WinHTTP")
109
+ ELSEIF (USE_HTTPS STREQUAL "WinHTTP")
117
110
  # WinHTTP setup was handled in the WinHTTP-specific block above
118
111
  ELSE()
119
- MESSAGE(FATAL_ERROR "Asked for backend ${HTTPS_BACKEND} but it wasn't found")
112
+ MESSAGE(FATAL_ERROR "Asked for backend ${USE_HTTPS} but it wasn't found")
120
113
  ENDIF()
121
114
 
122
115
  SET(GIT_HTTPS 1)
123
- ADD_FEATURE_INFO(HTTPS GIT_HTTPS "using ${HTTPS_BACKEND}")
116
+ ADD_FEATURE_INFO(HTTPS GIT_HTTPS "using ${USE_HTTPS}")
124
117
  ELSE()
125
118
  SET(GIT_HTTPS 0)
126
119
  ADD_FEATURE_INFO(HTTPS NO "")
@@ -5,37 +5,28 @@ INCLUDE(SanitizeBool)
5
5
  # USE_SHA1=CollisionDetection(ON)/HTTPS/Generic/OFF
6
6
 
7
7
  SanitizeBool(USE_SHA1)
8
- IF(USE_SHA1 STREQUAL ON OR USE_SHA1 STREQUAL "CollisionDetection")
9
- SET(SHA1_BACKEND "CollisionDetection")
8
+ IF(USE_SHA1 STREQUAL ON)
9
+ SET(USE_SHA1 "CollisionDetection")
10
10
  ELSEIF(USE_SHA1 STREQUAL "HTTPS")
11
- message(STATUS "Checking HTTPS backend… ${HTTPS_BACKEND}")
12
- IF(HTTPS_BACKEND STREQUAL "SecureTransport")
13
- SET(SHA1_BACKEND "CommonCrypto")
14
- ELSEIF(HTTPS_BACKEND STREQUAL "WinHTTP")
15
- SET(SHA1_BACKEND "Win32")
16
- ELSEIF(HTTPS_BACKEND)
17
- SET(SHA1_BACKEND ${HTTPS_BACKEND})
11
+ IF(USE_HTTPS STREQUAL "SecureTransport")
12
+ SET(USE_SHA1 "CommonCrypto")
13
+ ELSEIF(USE_HTTPS STREQUAL "WinHTTP")
14
+ SET(USE_SHA1 "Win32")
15
+ ELSEIF(USE_HTTPS)
16
+ SET(USE_SHA1 ${USE_HTTPS})
18
17
  ELSE()
18
+ SET(USE_SHA1 "CollisionDetection")
19
19
  ENDIF()
20
- IF(NOT HTTPS_BACKEND)
21
- SET(SHA1_BACKEND "CollisionDetection")
22
- ENDIF()
23
- message(STATUS "Using SHA1 backend ${SHA1_BACKEND}")
24
- ELSEIF(USE_SHA1 STREQUAL "Generic")
25
- SET(SHA1_BACKEND "Generic")
26
- # ELSEIF(NOT USE_SHA1)
27
- ELSE()
28
- MESSAGE(FATAL_ERROR "Invalid value for USE_SHA1: ${USE_SHA1}")
29
20
  ENDIF()
30
21
 
31
- IF(SHA1_BACKEND STREQUAL "CollisionDetection")
22
+ IF(USE_SHA1 STREQUAL "CollisionDetection")
32
23
  SET(GIT_SHA1_COLLISIONDETECT 1)
33
24
  ADD_DEFINITIONS(-DSHA1DC_NO_STANDARD_INCLUDES=1)
34
25
  ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\")
35
26
  ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\")
36
27
  FILE(GLOB SRC_SHA1 hash/sha1/collisiondetect.* hash/sha1/sha1dc/*)
37
- ELSEIF(SHA1_BACKEND STREQUAL "OpenSSL")
38
- # OPENSSL_FOUND should already be set, we're checking HTTPS_BACKEND
28
+ ELSEIF(USE_SHA1 STREQUAL "OpenSSL")
29
+ # OPENSSL_FOUND should already be set, we're checking USE_HTTPS
39
30
 
40
31
  SET(GIT_SHA1_OPENSSL 1)
41
32
  IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
@@ -44,10 +35,10 @@ ELSEIF(SHA1_BACKEND STREQUAL "OpenSSL")
44
35
  LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
45
36
  ENDIF()
46
37
  FILE(GLOB SRC_SHA1 hash/sha1/openssl.*)
47
- ELSEIF(SHA1_BACKEND STREQUAL "CommonCrypto")
38
+ ELSEIF(USE_SHA1 STREQUAL "CommonCrypto")
48
39
  SET(GIT_SHA1_COMMON_CRYPTO 1)
49
40
  FILE(GLOB SRC_SHA1 hash/sha1/common_crypto.*)
50
- ELSEIF(SHA1_BACKEND STREQUAL "mbedTLS")
41
+ ELSEIF(USE_SHA1 STREQUAL "mbedTLS")
51
42
  SET(GIT_SHA1_MBEDTLS 1)
52
43
  FILE(GLOB SRC_SHA1 hash/sha1/mbedtls.*)
53
44
  LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${MBEDTLS_INCLUDE_DIR})
@@ -56,14 +47,15 @@ ELSEIF(SHA1_BACKEND STREQUAL "mbedTLS")
56
47
  # https://github.com/ARMmbed/mbedtls/issues/228
57
48
  # For now, pass its link flags as our own
58
49
  LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
59
- ELSEIF(SHA1_BACKEND STREQUAL "Win32")
50
+ ELSEIF(USE_SHA1 STREQUAL "Win32")
60
51
  SET(GIT_SHA1_WIN32 1)
61
52
  FILE(GLOB SRC_SHA1 hash/sha1/win32.*)
62
- ELSEIF(SHA1_BACKEND STREQUAL "Generic")
53
+ ELSEIF(USE_SHA1 STREQUAL "Generic")
63
54
  FILE(GLOB SRC_SHA1 hash/sha1/generic.*)
64
- # ELSEIF(NOT USE_SHA1)
65
55
  ELSE()
66
- MESSAGE(FATAL_ERROR "Asked for unknown SHA1 backend: ${SHA1_BACKEND}")
56
+ MESSAGE(FATAL_ERROR "Asked for unknown SHA1 backend: ${USE_SHA1}")
67
57
  ENDIF()
68
58
 
69
- ADD_FEATURE_INFO(SHA ON "using ${SHA1_BACKEND}")
59
+ list(SORT SRC_SHA1)
60
+
61
+ ADD_FEATURE_INFO(SHA ON "using ${USE_SHA1}")