rugged 0.23.0b2 → 0.23.0b4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rugged/rugged_blob.c +39 -0
  3. data/ext/rugged/rugged_diff.c +7 -3
  4. data/ext/rugged/rugged_index.c +2 -2
  5. data/ext/rugged/rugged_remote.c +27 -148
  6. data/ext/rugged/rugged_remote_collection.c +134 -12
  7. data/ext/rugged/rugged_repo.c +74 -5
  8. data/ext/rugged/rugged_submodule.c +18 -208
  9. data/ext/rugged/rugged_submodule_collection.c +148 -0
  10. data/lib/rugged/version.rb +1 -1
  11. data/vendor/libgit2/AUTHORS +1 -0
  12. data/vendor/libgit2/CMakeLists.txt +33 -25
  13. data/vendor/libgit2/deps/winhttp/winhttp.def +29 -29
  14. data/vendor/libgit2/include/git2.h +1 -1
  15. data/vendor/libgit2/include/git2/blob.h +4 -6
  16. data/vendor/libgit2/include/git2/checkout.h +10 -1
  17. data/vendor/libgit2/include/git2/clone.h +6 -7
  18. data/vendor/libgit2/include/git2/commit.h +11 -0
  19. data/vendor/libgit2/include/git2/cred_helpers.h +2 -2
  20. data/vendor/libgit2/include/git2/describe.h +1 -1
  21. data/vendor/libgit2/include/git2/diff.h +68 -11
  22. data/vendor/libgit2/include/git2/errors.h +4 -1
  23. data/vendor/libgit2/include/git2/filter.h +16 -0
  24. data/vendor/libgit2/include/git2/index.h +38 -11
  25. data/vendor/libgit2/include/git2/odb.h +1 -1
  26. data/vendor/libgit2/include/git2/odb_backend.h +2 -2
  27. data/vendor/libgit2/include/git2/remote.h +300 -207
  28. data/vendor/libgit2/include/git2/reset.h +1 -0
  29. data/vendor/libgit2/include/git2/stash.h +135 -4
  30. data/vendor/libgit2/include/git2/status.h +1 -0
  31. data/vendor/libgit2/include/git2/submodule.h +46 -75
  32. data/vendor/libgit2/include/git2/sys/odb_backend.h +1 -1
  33. data/vendor/libgit2/include/git2/sys/stream.h +2 -0
  34. data/vendor/libgit2/include/git2/sys/transport.h +1 -21
  35. data/vendor/libgit2/include/git2/transport.h +27 -0
  36. data/vendor/libgit2/include/git2/types.h +20 -10
  37. data/vendor/libgit2/include/git2/version.h +3 -3
  38. data/vendor/libgit2/libgit2.pc.in +4 -2
  39. data/vendor/libgit2/src/attr.c +2 -1
  40. data/vendor/libgit2/src/attr_file.c +18 -37
  41. data/vendor/libgit2/src/blame.c +2 -2
  42. data/vendor/libgit2/src/blob.c +4 -3
  43. data/vendor/libgit2/src/branch.c +6 -3
  44. data/vendor/libgit2/src/buf_text.c +4 -6
  45. data/vendor/libgit2/src/buf_text.h +1 -2
  46. data/vendor/libgit2/src/buffer.c +8 -6
  47. data/vendor/libgit2/src/buffer.h +1 -1
  48. data/vendor/libgit2/src/cache.c +1 -0
  49. data/vendor/libgit2/src/checkout.c +34 -20
  50. data/vendor/libgit2/src/clone.c +29 -29
  51. data/vendor/libgit2/src/commit.c +65 -0
  52. data/vendor/libgit2/src/common.h +5 -0
  53. data/vendor/libgit2/src/config.c +20 -0
  54. data/vendor/libgit2/src/config.h +6 -0
  55. data/vendor/libgit2/src/config_file.c +2 -2
  56. data/vendor/libgit2/src/crlf.c +39 -17
  57. data/vendor/libgit2/src/curl_stream.c +257 -0
  58. data/vendor/libgit2/src/curl_stream.h +14 -0
  59. data/vendor/libgit2/src/diff.c +223 -88
  60. data/vendor/libgit2/src/diff.h +21 -1
  61. data/vendor/libgit2/src/diff_file.c +23 -13
  62. data/vendor/libgit2/src/diff_file.h +4 -2
  63. data/vendor/libgit2/src/diff_patch.c +266 -71
  64. data/vendor/libgit2/src/diff_patch.h +36 -0
  65. data/vendor/libgit2/src/diff_print.c +156 -126
  66. data/vendor/libgit2/src/diff_tform.c +32 -54
  67. data/vendor/libgit2/src/fetch.c +27 -10
  68. data/vendor/libgit2/src/fetch.h +2 -2
  69. data/vendor/libgit2/src/filebuf.c +1 -1
  70. data/vendor/libgit2/src/fileops.c +6 -2
  71. data/vendor/libgit2/src/filter.c +28 -7
  72. data/vendor/libgit2/src/fnmatch.c +5 -5
  73. data/vendor/libgit2/src/global.c +16 -0
  74. data/vendor/libgit2/src/ident.c +2 -2
  75. data/vendor/libgit2/src/ignore.c +1 -0
  76. data/vendor/libgit2/src/index.c +338 -80
  77. data/vendor/libgit2/src/index.h +4 -1
  78. data/vendor/libgit2/src/indexer.c +19 -5
  79. data/vendor/libgit2/src/iterator.c +118 -11
  80. data/vendor/libgit2/src/iterator.h +25 -0
  81. data/vendor/libgit2/src/merge.c +96 -106
  82. data/vendor/libgit2/src/merge.h +14 -4
  83. data/vendor/libgit2/src/netops.c +3 -3
  84. data/vendor/libgit2/src/odb.c +17 -9
  85. data/vendor/libgit2/src/odb.h +1 -1
  86. data/vendor/libgit2/src/odb_loose.c +2 -2
  87. data/vendor/libgit2/src/odb_pack.c +1 -1
  88. data/vendor/libgit2/src/openssl_stream.c +118 -27
  89. data/vendor/libgit2/src/pack-objects.c +28 -0
  90. data/vendor/libgit2/src/pack-objects.h +1 -0
  91. data/vendor/libgit2/src/pack.c +18 -10
  92. data/vendor/libgit2/src/path.c +16 -11
  93. data/vendor/libgit2/src/path.h +1 -1
  94. data/vendor/libgit2/src/push.c +26 -42
  95. data/vendor/libgit2/src/push.h +2 -34
  96. data/vendor/libgit2/src/rebase.c +1 -1
  97. data/vendor/libgit2/src/refs.c +1 -1
  98. data/vendor/libgit2/src/refspec.c +6 -0
  99. data/vendor/libgit2/src/remote.c +381 -274
  100. data/vendor/libgit2/src/remote.h +0 -4
  101. data/vendor/libgit2/src/repository.c +33 -12
  102. data/vendor/libgit2/src/repository.h +0 -1
  103. data/vendor/libgit2/src/reset.c +1 -0
  104. data/vendor/libgit2/src/stash.c +439 -17
  105. data/vendor/libgit2/src/status.c +6 -0
  106. data/vendor/libgit2/src/stransport_stream.c +58 -21
  107. data/vendor/libgit2/src/stream.h +15 -0
  108. data/vendor/libgit2/src/submodule.c +410 -664
  109. data/vendor/libgit2/src/submodule.h +0 -24
  110. data/vendor/libgit2/src/transaction.c +1 -0
  111. data/vendor/libgit2/src/transports/cred.c +55 -1
  112. data/vendor/libgit2/src/transports/http.c +18 -2
  113. data/vendor/libgit2/src/transports/local.c +60 -59
  114. data/vendor/libgit2/src/transports/smart.h +1 -1
  115. data/vendor/libgit2/src/transports/smart_protocol.c +11 -11
  116. data/vendor/libgit2/src/transports/ssh.c +46 -7
  117. data/vendor/libgit2/src/unix/posix.h +4 -0
  118. data/vendor/libgit2/src/util.c +9 -9
  119. data/vendor/libgit2/src/util.h +9 -0
  120. data/vendor/libgit2/src/win32/posix.h +3 -0
  121. data/vendor/libgit2/src/win32/posix_w32.c +38 -0
  122. data/vendor/libgit2/src/win32/w32_util.h +10 -0
  123. metadata +4 -3
  124. data/vendor/libgit2/include/git2/push.h +0 -94
@@ -1,3 +1,3 @@
1
1
  module Rugged
2
- Version = VERSION = '0.23.0b2'
2
+ Version = VERSION = '0.23.0b4'
3
3
  end
@@ -49,6 +49,7 @@ Microsoft Corporation
49
49
  Olivier Ramonat
50
50
  Peter Drahoš
51
51
  Pierre Habouzit
52
+ Pierre-Olivier Latour
52
53
  Przemyslaw Pawelczyk
53
54
  Ramsay Jones
54
55
  Robert G. Jakabosky
@@ -34,12 +34,11 @@ OPTION( PROFILE "Generate profiling information" OFF )
34
34
  OPTION( ENABLE_TRACE "Enables tracing support" OFF )
35
35
  OPTION( LIBGIT2_FILENAME "Name of the produced binary" OFF )
36
36
 
37
- OPTION( ANDROID "Build for android NDK" OFF )
38
-
39
37
  OPTION( USE_ICONV "Link with and use iconv library" OFF )
40
38
  OPTION( USE_SSH "Link with libssh to enable SSH support" ON )
41
39
  OPTION( USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF )
42
40
  OPTION( VALGRIND "Configure build for valgrind" OFF )
41
+ OPTION( CURL "User curl for HTTP if available" ON)
43
42
 
44
43
  IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
45
44
  SET( USE_ICONV ON )
@@ -60,10 +59,6 @@ IF(MSVC)
60
59
  # are linking statically
61
60
  OPTION( STATIC_CRT "Link the static CRT libraries" ON )
62
61
 
63
- # If you want to embed a copy of libssh2 into libgit2, pass a
64
- # path to libssh2
65
- OPTION( EMBED_SSH_PATH "Path to libssh2 to embed (Windows)" OFF )
66
-
67
62
  ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
68
63
  ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
69
64
  ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE)
@@ -105,12 +100,14 @@ FUNCTION(TARGET_OS_LIBRARIES target)
105
100
  TARGET_LINK_LIBRARIES(${target} ws2_32)
106
101
  ELSEIF(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
107
102
  TARGET_LINK_LIBRARIES(${target} socket nsl)
108
- SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lsocket -lnsl" PARENT_SCOPE)
103
+ LIST(APPEND LIBGIT2_PC_LIBS "-lsocket" "-lnsl")
104
+ SET(LIBGIT2_PC_LIBS ${LIBGIT2_PC_LIBS} PARENT_SCOPE)
109
105
  ENDIF()
110
106
  CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" NEED_LIBRT)
111
107
  IF(NEED_LIBRT)
112
108
  TARGET_LINK_LIBRARIES(${target} rt)
113
- SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lrt" PARENT_SCOPE)
109
+ LIST(APPEND LIBGIT2_PC_LIBS "-lrt")
110
+ SET(LIBGIT2_PC_LIBS ${LIBGIT2_PC_LIBS} PARENT_SCOPE)
114
111
  ENDIF()
115
112
 
116
113
  IF(THREADSAFE)
@@ -156,22 +153,15 @@ INCLUDE_DIRECTORIES(src include)
156
153
 
157
154
  IF (SECURITY_FOUND)
158
155
  MESSAGE("-- Found Security ${SECURITY_DIRS}")
159
- SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -framework Security")
156
+ LIST(APPEND LIBGIT2_PC_LIBS "-framework Security")
160
157
  ENDIF()
161
158
 
162
159
  IF (COREFOUNDATION_FOUND)
163
160
  MESSAGE("-- Found CoreFoundation ${COREFOUNDATION_DIRS}")
164
- SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -framework CoreFoundation")
161
+ LIST(APPEND LIBGIT2_PC_LIBS "-framework CoreFoundation")
165
162
  ENDIF()
166
163
 
167
164
 
168
- IF (WIN32 AND EMBED_SSH_PATH)
169
- FILE(GLOB SRC_SSH "${EMBED_SSH_PATH}/src/*.c")
170
- INCLUDE_DIRECTORIES("${EMBED_SSH_PATH}/include")
171
- FILE(WRITE "${EMBED_SSH_PATH}/src/libssh2_config.h" "#define HAVE_WINCNG\n#define LIBSSH2_WINCNG\n#include \"../win32/libssh2_config.h\"")
172
- ADD_DEFINITIONS(-DGIT_SSH)
173
- ENDIF()
174
-
175
165
  IF (WIN32 AND WINHTTP)
176
166
  ADD_DEFINITIONS(-DGIT_WINHTTP)
177
167
  INCLUDE_DIRECTORIES(deps/http-parser)
@@ -212,15 +202,26 @@ IF (WIN32 AND WINHTTP)
212
202
 
213
203
  LINK_LIBRARIES(winhttp rpcrt4 crypt32)
214
204
  ELSE ()
205
+ IF (CURL)
206
+ PKG_CHECK_MODULES(CURL libcurl)
207
+ ENDIF ()
208
+
215
209
  IF (NOT AMIGA AND USE_OPENSSL)
216
210
  FIND_PACKAGE(OpenSSL)
217
211
  ENDIF ()
218
212
 
213
+ IF (CURL_FOUND)
214
+ ADD_DEFINITIONS(-DGIT_CURL)
215
+ INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
216
+ LINK_LIBRARIES(${CURL_LIBRARIES})
217
+ LIST(APPEND LIBGIT2_PC_LIBS ${CURL_LDFLAGS})
218
+ ENDIF()
219
+
219
220
  FIND_PACKAGE(HTTP_Parser)
220
221
  IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
221
222
  INCLUDE_DIRECTORIES(${HTTP_PARSER_INCLUDE_DIRS})
222
223
  LINK_LIBRARIES(${HTTP_PARSER_LIBRARIES})
223
- SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lhttp_parser")
224
+ LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser")
224
225
  ELSE()
225
226
  MESSAGE(STATUS "http-parser was not found or is too old; using bundled 3rd-party sources.")
226
227
  INCLUDE_DIRECTORIES(deps/http-parser)
@@ -237,7 +238,7 @@ ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
237
238
  ELSEIF (OPENSSL_FOUND AND NOT SHA1_TYPE STREQUAL "builtin")
238
239
  ADD_DEFINITIONS(-DOPENSSL_SHA1)
239
240
  IF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
240
- SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lssl")
241
+ LIST(APPEND LIBGIT2_PC_LIBS "-lssl")
241
242
  ELSE()
242
243
  SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} openssl")
243
244
  ENDIF ()
@@ -251,7 +252,7 @@ IF (ENABLE_TRACE STREQUAL "ON")
251
252
  ENDIF()
252
253
 
253
254
  # Include POSIX regex when it is required
254
- IF(WIN32 OR AMIGA OR ANDROID OR CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
255
+ IF(WIN32 OR AMIGA OR CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
255
256
  INCLUDE_DIRECTORIES(deps/regex)
256
257
  SET(SRC_REGEX deps/regex/regex.c)
257
258
  ENDIF()
@@ -262,7 +263,7 @@ IF (ZLIB_FOUND)
262
263
  INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
263
264
  LINK_LIBRARIES(${ZLIB_LIBRARIES})
264
265
  IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
265
- SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lz")
266
+ LIST(APPEND LIBGIT2_PC_LIBS "-lz")
266
267
  ELSE()
267
268
  SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} zlib")
268
269
  ENDIF()
@@ -281,8 +282,14 @@ IF (LIBSSH2_FOUND)
281
282
  ADD_DEFINITIONS(-DGIT_SSH)
282
283
  INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIRS})
283
284
  LINK_DIRECTORIES(${LIBSSH2_LIBRARY_DIRS})
284
- SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} libssh2")
285
+ LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS})
286
+ #SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} ${LIBSSH2_LDFLAGS}")
285
287
  SET(SSH_LIBRARIES ${LIBSSH2_LIBRARIES})
288
+
289
+ CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "" HAVE_LIBSSH2_MEMORY_CREDENTIALS)
290
+ IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS)
291
+ ADD_DEFINITIONS(-DGIT_SSH_MEMORY_CREDENTIALS)
292
+ ENDIF()
286
293
  ELSE()
287
294
  MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.")
288
295
  ENDIF()
@@ -302,7 +309,7 @@ ENDIF()
302
309
  IF (ICONV_FOUND)
303
310
  ADD_DEFINITIONS(-DGIT_USE_ICONV)
304
311
  INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
305
- SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} ${ICONV_LIBRARIES}")
312
+ LIST(APPEND LIBGIT2_PC_LIBS ${ICONV_LIBRARIES})
306
313
  ENDIF()
307
314
 
308
315
  # Platform specific compilation flags
@@ -482,7 +489,7 @@ ELSE()
482
489
  ENDIF()
483
490
 
484
491
  # Compile and link libgit2
485
- ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1} ${WIN_RC})
492
+ ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SHA1} ${WIN_RC})
486
493
  TARGET_LINK_LIBRARIES(git2 ${SECURITY_DIRS})
487
494
  TARGET_LINK_LIBRARIES(git2 ${COREFOUNDATION_DIRS})
488
495
  TARGET_LINK_LIBRARIES(git2 ${SSL_LIBRARIES})
@@ -507,6 +514,7 @@ IF (SONAME)
507
514
  SET_TARGET_PROPERTIES(git2 PROPERTIES OUTPUT_NAME ${LIBGIT2_FILENAME})
508
515
  ENDIF()
509
516
  ENDIF()
517
+ STRING(REPLACE ";" " " LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS}")
510
518
  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libgit2.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libgit2.pc @ONLY)
511
519
 
512
520
  IF (MSVC_IDE)
@@ -551,7 +559,7 @@ IF (BUILD_CLAR)
551
559
  ${CLAR_PATH}/clar.c
552
560
  PROPERTIES OBJECT_DEPENDS ${CLAR_PATH}/clar.suite)
553
561
 
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})
562
+ ADD_EXECUTABLE(libgit2_clar ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_CLAR} ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SHA1})
555
563
 
556
564
  TARGET_LINK_LIBRARIES(libgit2_clar ${COREFOUNDATION_DIRS})
557
565
  TARGET_LINK_LIBRARIES(libgit2_clar ${SECURITY_DIRS})
@@ -1,29 +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
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
@@ -40,7 +40,6 @@
40
40
  #include "git2/pack.h"
41
41
  #include "git2/patch.h"
42
42
  #include "git2/pathspec.h"
43
- #include "git2/push.h"
44
43
  #include "git2/rebase.h"
45
44
  #include "git2/refdb.h"
46
45
  #include "git2/reflog.h"
@@ -58,6 +57,7 @@
58
57
  #include "git2/submodule.h"
59
58
  #include "git2/tag.h"
60
59
  #include "git2/transport.h"
60
+ #include "git2/transaction.h"
61
61
  #include "git2/tree.h"
62
62
  #include "git2/types.h"
63
63
  #include "git2/version.h"
@@ -107,12 +107,10 @@ GIT_EXTERN(git_off_t) git_blob_rawsize(const git_blob *blob);
107
107
  * The output is written into a `git_buf` which the caller must free
108
108
  * when done (via `git_buf_free`).
109
109
  *
110
- * If no filters need to be applied, then the `out` buffer will just be
111
- * populated with a pointer to the raw content of the blob. In that case,
112
- * be careful to *not* free the blob until done with the buffer. To keep
113
- * the data detached from the blob, call `git_buf_grow` on the buffer
114
- * with a `want_size` of 0 and the buffer will be reallocated to be
115
- * detached from the blob.
110
+ * If no filters need to be applied, then the `out` buffer will just
111
+ * be populated with a pointer to the raw content of the blob. In
112
+ * that case, be careful to *not* free the blob until done with the
113
+ * buffer or copy it into memory you own.
116
114
  *
117
115
  * @param out The git_buf to be filled in
118
116
  * @param blob Pointer to the blob
@@ -272,7 +272,16 @@ typedef struct git_checkout_options {
272
272
  */
273
273
  git_strarray paths;
274
274
 
275
- git_tree *baseline; /**< expected content of workdir, defaults to HEAD */
275
+ /** The expected content of the working directory; defaults to HEAD.
276
+ * If the working directory does not match this baseline information,
277
+ * that will produce a checkout conflict.
278
+ */
279
+ git_tree *baseline;
280
+
281
+ /** Like `baseline` above, though expressed as an index. This
282
+ * option overrides `baseline`.
283
+ */
284
+ git_index *baseline_index; /**< expected content of workdir, expressed as an index. */
276
285
 
277
286
  const char *target_directory; /**< alternative checkout path to workdir */
278
287
 
@@ -111,13 +111,12 @@ typedef struct git_clone_options {
111
111
  git_checkout_options checkout_opts;
112
112
 
113
113
  /**
114
- * Callbacks to use for reporting fetch progress, and for acquiring
115
- * credentials in the event they are needed. This parameter is ignored if
116
- * the remote_cb parameter is set; if you provide a remote creation
117
- * callback, then you have the opportunity to configure remote callbacks in
118
- * provided function.
114
+ * Options which control the fetch, including callbacks.
115
+ *
116
+ * The callbacks are used for reporting fetch progress, and for acquiring
117
+ * credentials in the event they are needed.
119
118
  */
120
- git_remote_callbacks remote_callbacks;
119
+ git_fetch_options fetch_opts;
121
120
 
122
121
  /**
123
122
  * Set to zero (false) to create a standard repo, or non-zero
@@ -167,7 +166,7 @@ typedef struct git_clone_options {
167
166
  #define GIT_CLONE_OPTIONS_VERSION 1
168
167
  #define GIT_CLONE_OPTIONS_INIT { GIT_CLONE_OPTIONS_VERSION, \
169
168
  { GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE }, \
170
- GIT_REMOTE_CALLBACKS_INIT }
169
+ GIT_FETCH_OPTIONS_INIT }
171
170
 
172
171
  /**
173
172
  * Initializes a `git_clone_options` with default values. Equivalent to
@@ -239,6 +239,17 @@ GIT_EXTERN(int) git_commit_nth_gen_ancestor(
239
239
  const git_commit *commit,
240
240
  unsigned int n);
241
241
 
242
+ /**
243
+ * Get an arbitrary header field
244
+ *
245
+ * @param out the buffer to fill
246
+ * @param commit the commit to look in
247
+ * @param field the header field to return
248
+ * @return 0 on succeess, GIT_ENOTFOUND if the field does not exist,
249
+ * or an error code
250
+ */
251
+ GIT_EXTERN(int) git_commit_header_field(git_buf *out, const git_commit *commit, const char *field);
252
+
242
253
  /**
243
254
  * Create new commit in the repository from a list of `git_object` pointers
244
255
  *
@@ -22,8 +22,8 @@ GIT_BEGIN_DECL
22
22
  * Payload for git_cred_stock_userpass_plaintext.
23
23
  */
24
24
  typedef struct git_cred_userpass_payload {
25
- char *username;
26
- char *password;
25
+ const char *username;
26
+ const char *password;
27
27
  } git_cred_userpass_payload;
28
28
 
29
29
 
@@ -94,7 +94,7 @@ typedef struct {
94
94
  * If the workdir is dirty and this is set, this string will
95
95
  * be appended to the description string.
96
96
  */
97
- char *dirty_suffix;
97
+ const char *dirty_suffix;
98
98
  } git_describe_format_options;
99
99
 
100
100
  #define GIT_DESCRIBE_FORMAT_OPTIONS_VERSION 1
@@ -226,6 +226,7 @@ typedef enum {
226
226
  GIT_DIFF_FLAG_BINARY = (1u << 0), /**< file(s) treated as binary data */
227
227
  GIT_DIFF_FLAG_NOT_BINARY = (1u << 1), /**< file(s) treated as text data */
228
228
  GIT_DIFF_FLAG_VALID_ID = (1u << 2), /**< `id` value is known correct */
229
+ GIT_DIFF_FLAG_EXISTS = (1u << 3), /**< file exists at this side of the delta */
229
230
  } git_diff_flag_t;
230
231
 
231
232
  /**
@@ -239,16 +240,17 @@ typedef enum {
239
240
  * DELETED pairs).
240
241
  */
241
242
  typedef enum {
242
- GIT_DELTA_UNMODIFIED = 0, /**< no changes */
243
- GIT_DELTA_ADDED = 1, /**< entry does not exist in old version */
244
- GIT_DELTA_DELETED = 2, /**< entry does not exist in new version */
245
- GIT_DELTA_MODIFIED = 3, /**< entry content changed between old and new */
246
- GIT_DELTA_RENAMED = 4, /**< entry was renamed between old and new */
247
- GIT_DELTA_COPIED = 5, /**< entry was copied from another old entry */
248
- GIT_DELTA_IGNORED = 6, /**< entry is ignored item in workdir */
249
- GIT_DELTA_UNTRACKED = 7, /**< entry is untracked item in workdir */
250
- GIT_DELTA_TYPECHANGE = 8, /**< type of entry changed between old and new */
251
- GIT_DELTA_UNREADABLE = 9, /**< entry is unreadable */
243
+ GIT_DELTA_UNMODIFIED = 0, /**< no changes */
244
+ GIT_DELTA_ADDED = 1, /**< entry does not exist in old version */
245
+ GIT_DELTA_DELETED = 2, /**< entry does not exist in new version */
246
+ GIT_DELTA_MODIFIED = 3, /**< entry content changed between old and new */
247
+ GIT_DELTA_RENAMED = 4, /**< entry was renamed between old and new */
248
+ GIT_DELTA_COPIED = 5, /**< entry was copied from another old entry */
249
+ GIT_DELTA_IGNORED = 6, /**< entry is ignored item in workdir */
250
+ GIT_DELTA_UNTRACKED = 7, /**< entry is untracked item in workdir */
251
+ GIT_DELTA_TYPECHANGE = 8, /**< type of entry changed between old and new */
252
+ GIT_DELTA_UNREADABLE = 9, /**< entry is unreadable */
253
+ GIT_DELTA_CONFLICTED = 10, /**< entry in the index is conflicted */
252
254
  } git_delta_t;
253
255
 
254
256
  /**
@@ -397,7 +399,7 @@ typedef struct {
397
399
  * `git_diff_options_init` programmatic initialization.
398
400
  */
399
401
  #define GIT_DIFF_OPTIONS_INIT \
400
- {GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_DEFAULT, {NULL,0}, NULL, NULL, 3}
402
+ {GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_UNSPECIFIED, {NULL,0}, NULL, NULL, 3}
401
403
 
402
404
  /**
403
405
  * Initializes a `git_diff_options` with default values. Equivalent to
@@ -423,6 +425,53 @@ typedef int (*git_diff_file_cb)(
423
425
  float progress,
424
426
  void *payload);
425
427
 
428
+ /**
429
+ * When producing a binary diff, the binary data returned will be
430
+ * either the deflated full ("literal") contents of the file, or
431
+ * the deflated binary delta between the two sides (whichever is
432
+ * smaller).
433
+ */
434
+ typedef enum {
435
+ /** There is no binary delta. */
436
+ GIT_DIFF_BINARY_NONE,
437
+
438
+ /** The binary data is the literal contents of the file. */
439
+ GIT_DIFF_BINARY_LITERAL,
440
+
441
+ /** The binary data is the delta from one side to the other. */
442
+ GIT_DIFF_BINARY_DELTA,
443
+ } git_diff_binary_t;
444
+
445
+ /** The contents of one of the files in a binary diff. */
446
+ typedef struct {
447
+ /** The type of binary data for this file. */
448
+ git_diff_binary_t type;
449
+
450
+ /** The binary data, deflated. */
451
+ const char *data;
452
+
453
+ /** The length of the binary data. */
454
+ size_t datalen;
455
+
456
+ /** The length of the binary data after inflation. */
457
+ size_t inflatedlen;
458
+ } git_diff_binary_file;
459
+
460
+ /** Structure describing the binary contents of a diff. */
461
+ typedef struct {
462
+ git_diff_binary_file old_file; /**< The contents of the old file. */
463
+ git_diff_binary_file new_file; /**< The contents of the new file. */
464
+ } git_diff_binary;
465
+
466
+ /**
467
+ * When iterating over a diff, callback that will be made for
468
+ * binary content within the diff.
469
+ */
470
+ typedef int(*git_diff_binary_cb)(
471
+ const git_diff_delta *delta,
472
+ const git_diff_binary *binary,
473
+ void *payload);
474
+
426
475
  /**
427
476
  * Structure describing a hunk of a diff.
428
477
  */
@@ -895,6 +944,7 @@ GIT_EXTERN(int) git_diff_is_sorted_icase(const git_diff *diff);
895
944
  *
896
945
  * @param diff A git_diff generated by one of the above functions.
897
946
  * @param file_cb Callback function to make per file in the diff.
947
+ * @param binary_cb Optional callback to make for binary files.
898
948
  * @param hunk_cb Optional callback to make per hunk of text diff. This
899
949
  * callback is called to describe a range of lines in the
900
950
  * diff. It will not be issued for binary files.
@@ -907,6 +957,7 @@ GIT_EXTERN(int) git_diff_is_sorted_icase(const git_diff *diff);
907
957
  GIT_EXTERN(int) git_diff_foreach(
908
958
  git_diff *diff,
909
959
  git_diff_file_cb file_cb,
960
+ git_diff_binary_cb binary_cb,
910
961
  git_diff_hunk_cb hunk_cb,
911
962
  git_diff_line_cb line_cb,
912
963
  void *payload);
@@ -982,6 +1033,7 @@ GIT_EXTERN(int) git_diff_print(
982
1033
  * @param new_as_path Treat new blob as if it had this filename; can be NULL
983
1034
  * @param options Options for diff, or NULL for default options
984
1035
  * @param file_cb Callback for "file"; made once if there is a diff; can be NULL
1036
+ * @param binary_cb Callback for binary files; can be NULL
985
1037
  * @param hunk_cb Callback for each hunk in diff; can be NULL
986
1038
  * @param line_cb Callback for each line in diff; can be NULL
987
1039
  * @param payload Payload passed to each callback function
@@ -994,6 +1046,7 @@ GIT_EXTERN(int) git_diff_blobs(
994
1046
  const char *new_as_path,
995
1047
  const git_diff_options *options,
996
1048
  git_diff_file_cb file_cb,
1049
+ git_diff_binary_cb binary_cb,
997
1050
  git_diff_hunk_cb hunk_cb,
998
1051
  git_diff_line_cb line_cb,
999
1052
  void *payload);
@@ -1017,6 +1070,7 @@ GIT_EXTERN(int) git_diff_blobs(
1017
1070
  * @param buffer_as_path Treat buffer as if it had this filename; can be NULL
1018
1071
  * @param options Options for diff, or NULL for default options
1019
1072
  * @param file_cb Callback for "file"; made once if there is a diff; can be NULL
1073
+ * @param binary_cb Callback for binary files; can be NULL
1020
1074
  * @param hunk_cb Callback for each hunk in diff; can be NULL
1021
1075
  * @param line_cb Callback for each line in diff; can be NULL
1022
1076
  * @param payload Payload passed to each callback function
@@ -1030,6 +1084,7 @@ GIT_EXTERN(int) git_diff_blob_to_buffer(
1030
1084
  const char *buffer_as_path,
1031
1085
  const git_diff_options *options,
1032
1086
  git_diff_file_cb file_cb,
1087
+ git_diff_binary_cb binary_cb,
1033
1088
  git_diff_hunk_cb hunk_cb,
1034
1089
  git_diff_line_cb line_cb,
1035
1090
  void *payload);
@@ -1049,6 +1104,7 @@ GIT_EXTERN(int) git_diff_blob_to_buffer(
1049
1104
  * @param new_as_path Treat buffer as if it had this filename; can be NULL
1050
1105
  * @param options Options for diff, or NULL for default options
1051
1106
  * @param file_cb Callback for "file"; made once if there is a diff; can be NULL
1107
+ * @param binary_cb Callback for binary files; can be NULL
1052
1108
  * @param hunk_cb Callback for each hunk in diff; can be NULL
1053
1109
  * @param line_cb Callback for each line in diff; can be NULL
1054
1110
  * @param payload Payload passed to each callback function
@@ -1063,6 +1119,7 @@ GIT_EXTERN(int) git_diff_buffers(
1063
1119
  const char *new_as_path,
1064
1120
  const git_diff_options *options,
1065
1121
  git_diff_file_cb file_cb,
1122
+ git_diff_binary_cb binary_cb,
1066
1123
  git_diff_hunk_cb hunk_cb,
1067
1124
  git_diff_line_cb line_cb,
1068
1125
  void *payload);