rugged 0.23.0b1 → 0.23.0b2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rugged/rugged_note.c +7 -2
  3. data/ext/rugged/rugged_revwalk.c +321 -145
  4. data/lib/rugged/version.rb +1 -1
  5. data/vendor/libgit2/CMakeLists.txt +83 -8
  6. data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +9 -0
  7. data/vendor/libgit2/cmake/Modules/FindIconv.cmake +0 -3
  8. data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +9 -0
  9. data/vendor/libgit2/deps/winhttp/urlmon.h +45 -0
  10. data/vendor/libgit2/deps/winhttp/winhttp.def +29 -0
  11. data/vendor/libgit2/deps/winhttp/winhttp.h +592 -0
  12. data/vendor/libgit2/deps/winhttp/winhttp64.def +29 -0
  13. data/vendor/libgit2/include/git2/diff.h +6 -1
  14. data/vendor/libgit2/include/git2/index.h +1 -1
  15. data/vendor/libgit2/include/git2/merge.h +2 -1
  16. data/vendor/libgit2/include/git2/notes.h +2 -2
  17. data/vendor/libgit2/include/git2/pack.h +12 -0
  18. data/vendor/libgit2/include/git2/push.h +30 -0
  19. data/vendor/libgit2/include/git2/rebase.h +36 -16
  20. data/vendor/libgit2/include/git2/remote.h +6 -0
  21. data/vendor/libgit2/include/git2/reset.h +2 -2
  22. data/vendor/libgit2/include/git2/revwalk.h +10 -8
  23. data/vendor/libgit2/include/git2/submodule.h +16 -0
  24. data/vendor/libgit2/include/git2/sys/transport.h +12 -4
  25. data/vendor/libgit2/include/git2/types.h +1 -0
  26. data/vendor/libgit2/src/attr.c +3 -3
  27. data/vendor/libgit2/src/attr_file.c +24 -3
  28. data/vendor/libgit2/src/attr_file.h +3 -1
  29. data/vendor/libgit2/src/checkout.c +31 -7
  30. data/vendor/libgit2/src/config.c +5 -6
  31. data/vendor/libgit2/src/config_file.c +533 -469
  32. data/vendor/libgit2/src/describe.c +1 -1
  33. data/vendor/libgit2/src/diff.c +20 -10
  34. data/vendor/libgit2/src/diff_driver.c +1 -1
  35. data/vendor/libgit2/src/diff_tform.c +8 -2
  36. data/vendor/libgit2/src/filter.c +6 -3
  37. data/vendor/libgit2/src/global.c +17 -15
  38. data/vendor/libgit2/src/global.h +3 -1
  39. data/vendor/libgit2/src/ignore.c +48 -8
  40. data/vendor/libgit2/src/ignore.h +1 -1
  41. data/vendor/libgit2/src/index.c +12 -8
  42. data/vendor/libgit2/src/iterator.c +133 -12
  43. data/vendor/libgit2/src/netops.h +2 -2
  44. data/vendor/libgit2/src/notes.c +40 -21
  45. data/vendor/libgit2/src/openssl_stream.c +5 -1
  46. data/vendor/libgit2/src/pack-objects.c +36 -0
  47. data/vendor/libgit2/src/path.c +277 -140
  48. data/vendor/libgit2/src/path.h +132 -60
  49. data/vendor/libgit2/src/posix.h +0 -1
  50. data/vendor/libgit2/src/push.c +43 -4
  51. data/vendor/libgit2/src/push.h +8 -1
  52. data/vendor/libgit2/src/rebase.c +139 -119
  53. data/vendor/libgit2/src/reflog.c +1 -1
  54. data/vendor/libgit2/src/refs.c +3 -5
  55. data/vendor/libgit2/src/remote.c +6 -5
  56. data/vendor/libgit2/src/repository.c +7 -3
  57. data/vendor/libgit2/src/reset.c +3 -3
  58. data/vendor/libgit2/src/revwalk.c +26 -2
  59. data/vendor/libgit2/src/settings.c +3 -3
  60. data/vendor/libgit2/src/stransport_stream.c +249 -0
  61. data/vendor/libgit2/src/stransport_stream.h +14 -0
  62. data/vendor/libgit2/src/submodule.c +26 -2
  63. data/vendor/libgit2/src/tls_stream.c +28 -0
  64. data/vendor/libgit2/src/tls_stream.h +21 -0
  65. data/vendor/libgit2/src/transport.c +4 -4
  66. data/vendor/libgit2/src/transports/git.c +4 -1
  67. data/vendor/libgit2/src/transports/http.c +6 -4
  68. data/vendor/libgit2/src/transports/local.c +2 -1
  69. data/vendor/libgit2/src/transports/smart.c +1 -1
  70. data/vendor/libgit2/src/transports/ssh.c +5 -1
  71. data/vendor/libgit2/src/transports/winhttp.c +30 -23
  72. data/vendor/libgit2/src/tree.c +2 -2
  73. data/vendor/libgit2/src/unix/posix.h +1 -0
  74. data/vendor/libgit2/src/util.h +117 -0
  75. data/vendor/libgit2/src/win32/buffer.c +55 -0
  76. data/vendor/libgit2/src/win32/buffer.h +18 -0
  77. data/vendor/libgit2/src/win32/path_w32.c +75 -0
  78. data/vendor/libgit2/src/win32/path_w32.h +3 -0
  79. data/vendor/libgit2/src/win32/posix.h +2 -2
  80. data/vendor/libgit2/src/win32/posix_w32.c +2 -118
  81. data/vendor/libgit2/src/win32/pthread.c +2 -0
  82. data/vendor/libgit2/src/win32/utf-conv.c +0 -4
  83. data/vendor/libgit2/src/win32/utf-conv.h +4 -0
  84. data/vendor/libgit2/src/win32/w32_util.h +72 -0
  85. metadata +14 -2
@@ -13,6 +13,7 @@
13
13
 
14
14
  PROJECT(libgit2 C)
15
15
  CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
16
+ CMAKE_POLICY(SET CMP0015 NEW)
16
17
 
17
18
  # Add find modules to the path
18
19
  SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
@@ -35,7 +36,6 @@ OPTION( LIBGIT2_FILENAME "Name of the produced binary" OFF )
35
36
 
36
37
  OPTION( ANDROID "Build for android NDK" OFF )
37
38
 
38
- OPTION( USE_OPENSSL "Link with and use openssl library" ON )
39
39
  OPTION( USE_ICONV "Link with and use iconv library" OFF )
40
40
  OPTION( USE_SSH "Link with libssh to enable SSH support" ON )
41
41
  OPTION( USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF )
@@ -43,6 +43,8 @@ OPTION( VALGRIND "Configure build for valgrind" OFF )
43
43
 
44
44
  IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
45
45
  SET( USE_ICONV ON )
46
+ FIND_PACKAGE(Security)
47
+ FIND_PACKAGE(CoreFoundation REQUIRED)
46
48
  ENDIF()
47
49
 
48
50
  IF(MSVC)
@@ -58,10 +60,6 @@ IF(MSVC)
58
60
  # are linking statically
59
61
  OPTION( STATIC_CRT "Link the static CRT libraries" ON )
60
62
 
61
- # By default, libgit2 is built with WinHTTP. To use the built-in
62
- # HTTP transport, invoke CMake with the "-DWINHTTP=OFF" argument.
63
- OPTION( WINHTTP "Use Win32 WinHTTP routines" ON )
64
-
65
63
  # If you want to embed a copy of libssh2 into libgit2, pass a
66
64
  # path to libssh2
67
65
  OPTION( EMBED_SSH_PATH "Path to libssh2 to embed (Windows)" OFF )
@@ -71,6 +69,22 @@ IF(MSVC)
71
69
  ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE)
72
70
  ENDIF()
73
71
 
72
+
73
+ IF(WIN32)
74
+ # By default, libgit2 is built with WinHTTP. To use the built-in
75
+ # HTTP transport, invoke CMake with the "-DWINHTTP=OFF" argument.
76
+ OPTION( WINHTTP "Use Win32 WinHTTP routines" ON )
77
+ ENDIF()
78
+
79
+ IF(MSVC)
80
+ # Enable MSVC CRTDBG memory leak reporting when in debug mode.
81
+ OPTION(MSVC_CRTDBG "Enable CRTDBG memory leak reporting" OFF)
82
+ ENDIF()
83
+
84
+ IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
85
+ OPTION( USE_OPENSSL "Link with and use openssl library" ON )
86
+ ENDIF()
87
+
74
88
  # This variable will contain the libraries we need to put into
75
89
  # libgit2.pc's Requires.private. That is, what we're linking to or
76
90
  # what someone who's statically linking us needs to link to.
@@ -140,6 +154,17 @@ STRING(REGEX REPLACE "^.*LIBGIT2_SOVERSION ([0-9]+)$" "\\1" LIBGIT2_SOVERSION "$
140
154
  # Find required dependencies
141
155
  INCLUDE_DIRECTORIES(src include)
142
156
 
157
+ IF (SECURITY_FOUND)
158
+ MESSAGE("-- Found Security ${SECURITY_DIRS}")
159
+ SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -framework Security")
160
+ ENDIF()
161
+
162
+ IF (COREFOUNDATION_FOUND)
163
+ MESSAGE("-- Found CoreFoundation ${COREFOUNDATION_DIRS}")
164
+ SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -framework CoreFoundation")
165
+ ENDIF()
166
+
167
+
143
168
  IF (WIN32 AND EMBED_SSH_PATH)
144
169
  FILE(GLOB SRC_SSH "${EMBED_SSH_PATH}/src/*.c")
145
170
  INCLUDE_DIRECTORIES("${EMBED_SSH_PATH}/include")
@@ -147,10 +172,45 @@ IF (WIN32 AND EMBED_SSH_PATH)
147
172
  ADD_DEFINITIONS(-DGIT_SSH)
148
173
  ENDIF()
149
174
 
150
- IF (WIN32 AND WINHTTP AND NOT MINGW)
175
+ IF (WIN32 AND WINHTTP)
151
176
  ADD_DEFINITIONS(-DGIT_WINHTTP)
152
177
  INCLUDE_DIRECTORIES(deps/http-parser)
153
178
  FILE(GLOB SRC_HTTP deps/http-parser/*.c deps/http-parser/*.h)
179
+
180
+ # Since MinGW does not come with headers or an import library for winhttp,
181
+ # we have to include a private header and generate our own import library
182
+ IF (MINGW)
183
+ FIND_PROGRAM(DLLTOOL dlltool CMAKE_FIND_ROOT_PATH_BOTH)
184
+ IF (NOT DLLTOOL)
185
+ MESSAGE(FATAL_ERROR "Could not find dlltool command")
186
+ ENDIF ()
187
+
188
+ SET(LIBWINHTTP_PATH "${CMAKE_CURRENT_BINARY_DIR}/deps/winhttp")
189
+ FILE(MAKE_DIRECTORY ${LIBWINHTTP_PATH})
190
+
191
+ IF ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
192
+ set(WINHTTP_DEF "${CMAKE_CURRENT_SOURCE_DIR}/deps/winhttp/winhttp64.def")
193
+ ELSE()
194
+ set(WINHTTP_DEF "${CMAKE_CURRENT_SOURCE_DIR}/deps/winhttp/winhttp.def")
195
+ ENDIF()
196
+
197
+ ADD_CUSTOM_COMMAND(
198
+ OUTPUT ${LIBWINHTTP_PATH}/libwinhttp.a
199
+ COMMAND ${DLLTOOL} -d ${WINHTTP_DEF} -k -D winhttp.dll -l libwinhttp.a
200
+ DEPENDS ${WINHTTP_DEF}
201
+ WORKING_DIRECTORY ${LIBWINHTTP_PATH}
202
+ )
203
+
204
+ SET_SOURCE_FILES_PROPERTIES(
205
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/transports/winhttp.c
206
+ PROPERTIES OBJECT_DEPENDS ${LIBWINHTTP_PATH}/libwinhttp.a
207
+ )
208
+
209
+ INCLUDE_DIRECTORIES(deps/winhttp)
210
+ LINK_DIRECTORIES(${LIBWINHTTP_PATH})
211
+ ENDIF ()
212
+
213
+ LINK_LIBRARIES(winhttp rpcrt4 crypt32)
154
214
  ELSE ()
155
215
  IF (NOT AMIGA AND USE_OPENSSL)
156
216
  FIND_PACKAGE(OpenSSL)
@@ -267,6 +327,10 @@ IF (MSVC)
267
327
  SET(CRT_FLAG_RELEASE "/MD")
268
328
  ENDIF()
269
329
 
330
+ IF (MSVC_CRTDBG)
331
+ SET(CRT_FLAG_DEBUG "${CRT_FLAG_DEBUG} /DGIT_MSVC_CRTDBG")
332
+ ENDIF()
333
+
270
334
  # /Zi - Create debugging information
271
335
  # /Od - Disable optimization
272
336
  # /D_DEBUG - #define _DEBUG
@@ -368,12 +432,19 @@ ELSE()
368
432
  # that uses CMAKE_CONFIGURATION_TYPES and not CMAKE_BUILD_TYPE
369
433
  ENDIF()
370
434
 
435
+ IF (SECURITY_FOUND)
436
+ ADD_DEFINITIONS(-DGIT_SECURE_TRANSPORT)
437
+ INCLUDE_DIRECTORIES(${SECURITY_INCLUDE_DIR})
438
+ ENDIF ()
439
+
371
440
  IF (OPENSSL_FOUND)
372
- ADD_DEFINITIONS(-DGIT_SSL)
441
+ ADD_DEFINITIONS(-DGIT_OPENSSL)
373
442
  INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
374
443
  SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES})
375
444
  ENDIF()
376
445
 
446
+
447
+
377
448
  IF (THREADSAFE)
378
449
  IF (NOT WIN32)
379
450
  FIND_PACKAGE(Threads REQUIRED)
@@ -412,6 +483,8 @@ ENDIF()
412
483
 
413
484
  # Compile and link libgit2
414
485
  ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1} ${WIN_RC})
486
+ TARGET_LINK_LIBRARIES(git2 ${SECURITY_DIRS})
487
+ TARGET_LINK_LIBRARIES(git2 ${COREFOUNDATION_DIRS})
415
488
  TARGET_LINK_LIBRARIES(git2 ${SSL_LIBRARIES})
416
489
  TARGET_LINK_LIBRARIES(git2 ${SSH_LIBRARIES})
417
490
  TARGET_LINK_LIBRARIES(git2 ${GSSAPI_LIBRARIES})
@@ -480,6 +553,8 @@ IF (BUILD_CLAR)
480
553
 
481
554
  ADD_EXECUTABLE(libgit2_clar ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_CLAR} ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1})
482
555
 
556
+ TARGET_LINK_LIBRARIES(libgit2_clar ${COREFOUNDATION_DIRS})
557
+ TARGET_LINK_LIBRARIES(libgit2_clar ${SECURITY_DIRS})
483
558
  TARGET_LINK_LIBRARIES(libgit2_clar ${SSL_LIBRARIES})
484
559
  TARGET_LINK_LIBRARIES(libgit2_clar ${SSH_LIBRARIES})
485
560
  TARGET_LINK_LIBRARIES(libgit2_clar ${GSSAPI_LIBRARIES})
@@ -493,7 +568,7 @@ IF (BUILD_CLAR)
493
568
  ENDIF ()
494
569
 
495
570
  ENABLE_TESTING()
496
- IF (WINHTTP OR OPENSSL_FOUND)
571
+ IF (WINHTTP OR OPENSSL_FOUND OR SECURITY_FOUND)
497
572
  ADD_TEST(libgit2_clar libgit2_clar -ionline)
498
573
  ELSE ()
499
574
  ADD_TEST(libgit2_clar libgit2_clar -v)
@@ -0,0 +1,9 @@
1
+ IF (COREFOUNDATION_INCLUDE_DIR AND COREFOUNDATION_DIRS)
2
+ SET(COREFOUNDATION_FOUND TRUE)
3
+ ELSE ()
4
+ FIND_PATH(COREFOUNDATION_INCLUDE_DIR NAMES CoreFoundation.h)
5
+ FIND_LIBRARY(COREFOUNDATION_DIRS NAMES CoreFoundation)
6
+ IF (COREFOUNDATION_INCLUDE_DIR AND COREFOUNDATION_DIRS)
7
+ SET(COREFOUNDATION_FOUND TRUE)
8
+ ENDIF ()
9
+ ENDIF ()
@@ -11,10 +11,7 @@ IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
11
11
  SET(ICONV_FIND_QUIETLY TRUE)
12
12
  ENDIF()
13
13
 
14
- FIND_PATH(ICONV_INCLUDE_DIR iconv.h PATHS /opt/local/include NO_DEFAULT_PATH)
15
14
  FIND_PATH(ICONV_INCLUDE_DIR iconv.h)
16
-
17
- FIND_LIBRARY(iconv_lib NAMES iconv libiconv libiconv-2 c NO_DEFAULT_PATH PATHS /opt/local/lib)
18
15
  FIND_LIBRARY(iconv_lib NAMES iconv libiconv libiconv-2 c)
19
16
 
20
17
  IF(ICONV_INCLUDE_DIR AND iconv_lib)
@@ -0,0 +1,9 @@
1
+ IF (SECURITY_INCLUDE_DIR AND SECURITY_DIRS)
2
+ SET(SECURITY_FOUND TRUE)
3
+ ELSE ()
4
+ FIND_PATH(SECURITY_INCLUDE_DIR NAMES Security/Security.h)
5
+ FIND_LIBRARY(SECURITY_DIRS NAMES Security)
6
+ IF (SECURITY_INCLUDE_DIR AND SECURITY_DIRS)
7
+ SET(SECURITY_FOUND TRUE)
8
+ ENDIF ()
9
+ ENDIF ()
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Copyright (C) the libgit2 contributors. All rights reserved.
3
+ *
4
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
5
+ * a Linking Exception. For full terms see the included COPYING file.
6
+ */
7
+
8
+ #if defined(__MINGW_VERSION) || defined(__MINGW32_VERSION)
9
+
10
+ #ifndef __CUSTOM_URLMON_H
11
+ #define __CUSTOM_URLMON_H
12
+
13
+ typedef struct IInternetSecurityManager IInternetSecurityManager;
14
+
15
+ typedef struct IInternetSecurityManagerVtbl
16
+ {
17
+ HRESULT(STDMETHODCALLTYPE *QueryInterface)(IInternetSecurityManager *, REFIID, void **);
18
+ ULONG(STDMETHODCALLTYPE *AddRef)(IInternetSecurityManager *);
19
+ ULONG(STDMETHODCALLTYPE *Release)(IInternetSecurityManager *);
20
+ LPVOID SetSecuritySite;
21
+ LPVOID GetSecuritySite;
22
+ HRESULT(STDMETHODCALLTYPE *MapUrlToZone)(IInternetSecurityManager *, LPCWSTR, DWORD *, DWORD);
23
+ LPVOID GetSecurityId;
24
+ LPVOID ProcessUrlAction;
25
+ LPVOID QueryCustomPolicy;
26
+ LPVOID SetZoneMapping;
27
+ LPVOID GetZoneMappings;
28
+ } IInternetSecurityManagerVtbl;
29
+
30
+ struct IInternetSecurityManager
31
+ {
32
+ CONST_VTBL struct IInternetSecurityManagerVtbl *lpVtbl;
33
+ };
34
+
35
+ #define URLZONE_LOCAL_MACHINE 0
36
+ #define URLZONE_INTRANET 1
37
+ #define URLZONE_TRUSTED 2
38
+
39
+ #endif /* __CUSTOM_URLMON_H */
40
+
41
+ #else
42
+
43
+ #include_next <urlmon.h>
44
+
45
+ #endif
@@ -0,0 +1,29 @@
1
+ LIBRARY WINHTTP
2
+ EXPORTS
3
+ WinHttpAddRequestHeaders@16
4
+ WinHttpCheckPlatform@0
5
+ WinHttpCloseHandle@4
6
+ WinHttpConnect@16
7
+ WinHttpCrackUrl@16
8
+ WinHttpCreateUrl@16
9
+ WinHttpDetectAutoProxyConfigUrl@8
10
+ WinHttpGetDefaultProxyConfiguration@4
11
+ WinHttpGetIEProxyConfigForCurrentUser@4
12
+ WinHttpGetProxyForUrl@16
13
+ WinHttpOpen@20
14
+ WinHttpOpenRequest@28
15
+ WinHttpQueryAuthSchemes@16
16
+ WinHttpQueryDataAvailable@8
17
+ WinHttpQueryHeaders@24
18
+ WinHttpQueryOption@16
19
+ WinHttpReadData@16
20
+ WinHttpReceiveResponse@8
21
+ WinHttpSendRequest@28
22
+ WinHttpSetCredentials@24
23
+ WinHttpSetDefaultProxyConfiguration@4
24
+ WinHttpSetOption@16
25
+ WinHttpSetStatusCallback@16
26
+ WinHttpSetTimeouts@20
27
+ WinHttpTimeFromSystemTime@8
28
+ WinHttpTimeToSystemTime@8
29
+ WinHttpWriteData@16