rugged 0.21.4 → 0.22.0b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -5
  3. data/ext/rugged/extconf.rb +9 -9
  4. data/ext/rugged/rugged.c +4 -2
  5. data/ext/rugged/rugged.h +3 -7
  6. data/ext/rugged/rugged_blob.c +57 -0
  7. data/ext/rugged/rugged_cred.c +23 -0
  8. data/ext/rugged/rugged_index.c +6 -2
  9. data/ext/rugged/rugged_remote.c +65 -52
  10. data/ext/rugged/rugged_remote_collection.c +59 -10
  11. data/ext/rugged/rugged_repo.c +345 -11
  12. data/ext/rugged/rugged_revwalk.c +10 -0
  13. data/ext/rugged/rugged_submodule.c +1042 -0
  14. data/ext/rugged/rugged_submodule_collection.c +236 -0
  15. data/ext/rugged/rugged_tag_collection.c +70 -2
  16. data/ext/rugged/rugged_tree.c +29 -10
  17. data/lib/rugged.rb +3 -0
  18. data/lib/rugged/attributes.rb +41 -0
  19. data/lib/rugged/blob.rb +28 -0
  20. data/lib/rugged/diff.rb +0 -1
  21. data/lib/rugged/diff/line.rb +1 -3
  22. data/lib/rugged/patch.rb +12 -2
  23. data/lib/rugged/repository.rb +7 -0
  24. data/lib/rugged/submodule_collection.rb +48 -0
  25. data/lib/rugged/version.rb +1 -1
  26. data/vendor/libgit2/CMakeLists.txt +27 -3
  27. data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +324 -0
  28. data/vendor/libgit2/deps/http-parser/http_parser.h +2 -0
  29. data/vendor/libgit2/deps/zlib/adler32.c +39 -29
  30. data/vendor/libgit2/deps/zlib/crc32.c +33 -50
  31. data/vendor/libgit2/deps/zlib/crc32.h +1 -1
  32. data/vendor/libgit2/deps/zlib/deflate.c +198 -65
  33. data/vendor/libgit2/deps/zlib/deflate.h +8 -4
  34. data/vendor/libgit2/deps/zlib/infback.c +640 -0
  35. data/vendor/libgit2/deps/zlib/inffast.c +3 -3
  36. data/vendor/libgit2/deps/zlib/inffixed.h +3 -3
  37. data/vendor/libgit2/deps/zlib/inflate.c +84 -52
  38. data/vendor/libgit2/deps/zlib/inftrees.c +15 -39
  39. data/vendor/libgit2/deps/zlib/trees.c +18 -36
  40. data/vendor/libgit2/deps/zlib/zconf.h +4 -0
  41. data/vendor/libgit2/deps/zlib/zlib.h +250 -95
  42. data/vendor/libgit2/deps/zlib/zutil.c +13 -10
  43. data/vendor/libgit2/deps/zlib/zutil.h +41 -62
  44. data/vendor/libgit2/include/git2.h +4 -0
  45. data/vendor/libgit2/include/git2/annotated_commit.h +99 -0
  46. data/vendor/libgit2/include/git2/attr.h +16 -13
  47. data/vendor/libgit2/include/git2/branch.h +11 -0
  48. data/vendor/libgit2/include/git2/buffer.h +16 -0
  49. data/vendor/libgit2/include/git2/checkout.h +12 -12
  50. data/vendor/libgit2/include/git2/cherrypick.h +15 -15
  51. data/vendor/libgit2/include/git2/clone.h +77 -69
  52. data/vendor/libgit2/include/git2/common.h +13 -1
  53. data/vendor/libgit2/include/git2/config.h +0 -14
  54. data/vendor/libgit2/include/git2/describe.h +162 -0
  55. data/vendor/libgit2/include/git2/diff.h +13 -8
  56. data/vendor/libgit2/include/git2/errors.h +5 -0
  57. data/vendor/libgit2/include/git2/global.h +38 -0
  58. data/vendor/libgit2/include/git2/merge.h +38 -64
  59. data/vendor/libgit2/include/git2/net.h +2 -2
  60. data/vendor/libgit2/include/git2/notes.h +17 -0
  61. data/vendor/libgit2/include/git2/oid.h +8 -4
  62. data/vendor/libgit2/include/git2/oidarray.h +40 -0
  63. data/vendor/libgit2/include/git2/rebase.h +261 -0
  64. data/vendor/libgit2/include/git2/reflog.h +1 -1
  65. data/vendor/libgit2/include/git2/remote.h +25 -47
  66. data/vendor/libgit2/include/git2/repository.h +4 -1
  67. data/vendor/libgit2/include/git2/reset.h +10 -1
  68. data/vendor/libgit2/include/git2/revert.h +1 -1
  69. data/vendor/libgit2/include/git2/revwalk.h +28 -23
  70. data/vendor/libgit2/include/git2/status.h +19 -15
  71. data/vendor/libgit2/include/git2/submodule.h +18 -0
  72. data/vendor/libgit2/include/git2/sys/config.h +0 -1
  73. data/vendor/libgit2/{src → include/git2/sys}/hashsig.h +11 -7
  74. data/vendor/libgit2/include/git2/sys/refdb_backend.h +13 -0
  75. data/vendor/libgit2/include/git2/sys/refs.h +0 -11
  76. data/vendor/libgit2/include/git2/sys/repository.h +13 -0
  77. data/vendor/libgit2/include/git2/sys/transport.h +352 -0
  78. data/vendor/libgit2/include/git2/threads.h +10 -20
  79. data/vendor/libgit2/include/git2/transaction.h +111 -0
  80. data/vendor/libgit2/include/git2/transport.h +79 -313
  81. data/vendor/libgit2/include/git2/tree.h +4 -2
  82. data/vendor/libgit2/include/git2/types.h +77 -8
  83. data/vendor/libgit2/include/git2/version.h +2 -2
  84. data/vendor/libgit2/src/annotated_commit.c +121 -0
  85. data/vendor/libgit2/src/annotated_commit.h +22 -0
  86. data/vendor/libgit2/src/attr.c +8 -4
  87. data/vendor/libgit2/src/attr_file.c +24 -2
  88. data/vendor/libgit2/src/blame.c +0 -1
  89. data/vendor/libgit2/src/branch.c +32 -3
  90. data/vendor/libgit2/src/buf_text.c +9 -5
  91. data/vendor/libgit2/src/buf_text.h +3 -2
  92. data/vendor/libgit2/src/buffer.c +67 -10
  93. data/vendor/libgit2/src/buffer.h +4 -2
  94. data/vendor/libgit2/src/cache.c +9 -9
  95. data/vendor/libgit2/src/cache.h +1 -1
  96. data/vendor/libgit2/src/cc-compat.h +2 -0
  97. data/vendor/libgit2/src/checkout.c +263 -82
  98. data/vendor/libgit2/src/checkout.h +1 -0
  99. data/vendor/libgit2/src/cherrypick.c +41 -44
  100. data/vendor/libgit2/src/clone.c +96 -58
  101. data/vendor/libgit2/src/commit.c +5 -31
  102. data/vendor/libgit2/src/commit_list.h +3 -1
  103. data/vendor/libgit2/src/config.c +0 -17
  104. data/vendor/libgit2/src/config_cache.c +0 -2
  105. data/vendor/libgit2/src/config_file.c +12 -15
  106. data/vendor/libgit2/src/crlf.c +2 -1
  107. data/vendor/libgit2/src/describe.c +886 -0
  108. data/vendor/libgit2/src/diff.c +29 -3
  109. data/vendor/libgit2/src/diff_file.c +1 -0
  110. data/vendor/libgit2/src/diff_patch.c +2 -3
  111. data/vendor/libgit2/src/diff_print.c +11 -9
  112. data/vendor/libgit2/src/diff_tform.c +4 -4
  113. data/vendor/libgit2/src/errors.c +9 -7
  114. data/vendor/libgit2/src/fetch.c +6 -6
  115. data/vendor/libgit2/src/fetchhead.h +2 -4
  116. data/vendor/libgit2/src/filebuf.c +0 -2
  117. data/vendor/libgit2/src/filebuf.h +2 -3
  118. data/vendor/libgit2/src/fileops.c +9 -7
  119. data/vendor/libgit2/src/global.c +44 -35
  120. data/vendor/libgit2/src/global.h +2 -0
  121. data/vendor/libgit2/src/graph.c +2 -2
  122. data/vendor/libgit2/src/hash.h +3 -1
  123. data/vendor/libgit2/src/hash/hash_common_crypto.h +44 -0
  124. data/vendor/libgit2/src/hash/hash_win32.c +1 -1
  125. data/vendor/libgit2/src/hashsig.c +1 -1
  126. data/vendor/libgit2/src/ignore.c +5 -88
  127. data/vendor/libgit2/src/index.c +70 -57
  128. data/vendor/libgit2/src/index.h +1 -0
  129. data/vendor/libgit2/src/indexer.c +16 -5
  130. data/vendor/libgit2/src/iterator.c +70 -1
  131. data/vendor/libgit2/src/iterator.h +5 -1
  132. data/vendor/libgit2/src/map.h +0 -1
  133. data/vendor/libgit2/src/merge.c +203 -327
  134. data/vendor/libgit2/src/merge.h +3 -13
  135. data/vendor/libgit2/src/mwindow.c +119 -8
  136. data/vendor/libgit2/src/mwindow.h +9 -1
  137. data/vendor/libgit2/src/netops.c +7 -8
  138. data/vendor/libgit2/src/netops.h +6 -16
  139. data/vendor/libgit2/src/notes.c +31 -4
  140. data/vendor/libgit2/src/notes.h +3 -0
  141. data/vendor/libgit2/src/odb.c +23 -1
  142. data/vendor/libgit2/src/odb_loose.c +1 -1
  143. data/vendor/libgit2/src/odb_pack.c +6 -3
  144. data/vendor/libgit2/src/oid.c +9 -1
  145. data/vendor/libgit2/src/oid.h +11 -0
  146. data/vendor/libgit2/src/oidarray.c +21 -0
  147. data/vendor/libgit2/src/oidarray.h +18 -0
  148. data/vendor/libgit2/src/oidmap.h +16 -0
  149. data/vendor/libgit2/src/pack.c +20 -7
  150. data/vendor/libgit2/src/pack.h +3 -0
  151. data/vendor/libgit2/src/path.c +120 -293
  152. data/vendor/libgit2/src/path.h +21 -44
  153. data/vendor/libgit2/src/pathspec.c +1 -1
  154. data/vendor/libgit2/src/pool.c +5 -11
  155. data/vendor/libgit2/src/pool.h +0 -2
  156. data/vendor/libgit2/src/posix.c +6 -6
  157. data/vendor/libgit2/src/posix.h +48 -28
  158. data/vendor/libgit2/src/push.c +19 -48
  159. data/vendor/libgit2/src/push.h +2 -4
  160. data/vendor/libgit2/src/rebase.c +1125 -0
  161. data/vendor/libgit2/src/refdb.c +19 -0
  162. data/vendor/libgit2/src/refdb.h +2 -1
  163. data/vendor/libgit2/src/refdb_fs.c +101 -29
  164. data/vendor/libgit2/src/reflog.c +1 -1
  165. data/vendor/libgit2/src/refs.c +38 -3
  166. data/vendor/libgit2/src/refs.h +13 -2
  167. data/vendor/libgit2/src/refspec.c +20 -2
  168. data/vendor/libgit2/src/remote.c +288 -154
  169. data/vendor/libgit2/src/remote.h +5 -1
  170. data/vendor/libgit2/src/repository.c +75 -36
  171. data/vendor/libgit2/src/repository.h +3 -25
  172. data/vendor/libgit2/src/reset.c +5 -1
  173. data/vendor/libgit2/src/revert.c +4 -6
  174. data/vendor/libgit2/src/revparse.c +15 -18
  175. data/vendor/libgit2/src/revwalk.c +96 -22
  176. data/vendor/libgit2/src/revwalk.h +5 -4
  177. data/vendor/libgit2/src/settings.c +22 -0
  178. data/vendor/libgit2/src/signature.c +37 -2
  179. data/vendor/libgit2/src/signature.h +3 -0
  180. data/vendor/libgit2/src/stash.c +17 -12
  181. data/vendor/libgit2/src/status.c +13 -3
  182. data/vendor/libgit2/src/strnlen.h +2 -1
  183. data/vendor/libgit2/src/submodule.c +75 -35
  184. data/vendor/libgit2/src/thread-utils.h +4 -9
  185. data/vendor/libgit2/src/trace.h +9 -1
  186. data/vendor/libgit2/src/transaction.c +352 -0
  187. data/vendor/libgit2/src/transport.c +91 -97
  188. data/vendor/libgit2/src/transports/auth.c +71 -0
  189. data/vendor/libgit2/src/transports/auth.h +63 -0
  190. data/vendor/libgit2/src/transports/auth_negotiate.c +275 -0
  191. data/vendor/libgit2/src/transports/auth_negotiate.h +27 -0
  192. data/vendor/libgit2/src/transports/cred.c +58 -0
  193. data/vendor/libgit2/src/transports/cred.h +14 -0
  194. data/vendor/libgit2/src/transports/cred_helpers.c +3 -0
  195. data/vendor/libgit2/src/transports/git.c +1 -0
  196. data/vendor/libgit2/src/transports/http.c +208 -82
  197. data/vendor/libgit2/src/transports/local.c +2 -2
  198. data/vendor/libgit2/src/transports/smart.c +2 -0
  199. data/vendor/libgit2/src/transports/smart.h +2 -0
  200. data/vendor/libgit2/src/transports/smart_protocol.c +10 -10
  201. data/vendor/libgit2/src/transports/ssh.c +243 -57
  202. data/vendor/libgit2/src/transports/winhttp.c +139 -35
  203. data/vendor/libgit2/src/tree-cache.c +118 -31
  204. data/vendor/libgit2/src/tree-cache.h +12 -7
  205. data/vendor/libgit2/src/tree.c +83 -64
  206. data/vendor/libgit2/src/tree.h +2 -3
  207. data/vendor/libgit2/src/unix/map.c +8 -2
  208. data/vendor/libgit2/src/unix/posix.h +23 -9
  209. data/vendor/libgit2/src/unix/realpath.c +8 -7
  210. data/vendor/libgit2/src/userdiff.h +3 -3
  211. data/vendor/libgit2/src/util.c +2 -92
  212. data/vendor/libgit2/src/util.h +3 -15
  213. data/vendor/libgit2/src/win32/findfile.c +0 -1
  214. data/vendor/libgit2/src/win32/map.c +3 -2
  215. data/vendor/libgit2/src/win32/mingw-compat.h +5 -12
  216. data/vendor/libgit2/src/win32/msvc-compat.h +3 -32
  217. data/vendor/libgit2/src/win32/posix.h +20 -32
  218. data/vendor/libgit2/src/win32/posix_w32.c +103 -31
  219. data/vendor/libgit2/src/win32/utf-conv.c +6 -36
  220. data/vendor/libgit2/src/win32/utf-conv.h +39 -0
  221. data/vendor/libgit2/src/win32/w32_util.h +0 -1
  222. metadata +32 -7
  223. data/vendor/libgit2/src/win32/path_w32.c +0 -305
  224. data/vendor/libgit2/src/win32/path_w32.h +0 -82
@@ -1,5 +1,5 @@
1
1
  /* zutil.c -- target dependent utility functions for the compression library
2
- * Copyright (C) 1995-2005, 2010 Jean-loup Gailly.
2
+ * Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly.
3
3
  * For conditions of distribution and use, see copyright notice in zlib.h
4
4
  */
5
5
 
@@ -11,7 +11,7 @@
11
11
  struct internal_state {int dummy;}; /* for buggy compilers */
12
12
  #endif
13
13
 
14
- const char * const z_errmsg[10] = {
14
+ z_const char * const z_errmsg[10] = {
15
15
  "need dictionary", /* Z_NEED_DICT 2 */
16
16
  "stream end", /* Z_STREAM_END 1 */
17
17
  "", /* Z_OK 0 */
@@ -85,27 +85,27 @@ uLong ZEXPORT zlibCompileFlags()
85
85
  #ifdef FASTEST
86
86
  flags += 1L << 21;
87
87
  #endif
88
- #ifdef STDC
88
+ #if defined(STDC) || defined(Z_HAVE_STDARG_H)
89
89
  # ifdef NO_vsnprintf
90
- flags += 1L << 25;
90
+ flags += 1L << 25;
91
91
  # ifdef HAS_vsprintf_void
92
- flags += 1L << 26;
92
+ flags += 1L << 26;
93
93
  # endif
94
94
  # else
95
95
  # ifdef HAS_vsnprintf_void
96
- flags += 1L << 26;
96
+ flags += 1L << 26;
97
97
  # endif
98
98
  # endif
99
99
  #else
100
- flags += 1L << 24;
100
+ flags += 1L << 24;
101
101
  # ifdef NO_snprintf
102
- flags += 1L << 25;
102
+ flags += 1L << 25;
103
103
  # ifdef HAS_sprintf_void
104
- flags += 1L << 26;
104
+ flags += 1L << 26;
105
105
  # endif
106
106
  # else
107
107
  # ifdef HAS_snprintf_void
108
- flags += 1L << 26;
108
+ flags += 1L << 26;
109
109
  # endif
110
110
  # endif
111
111
  #endif
@@ -181,6 +181,7 @@ void ZLIB_INTERNAL zmemzero(dest, len)
181
181
  }
182
182
  #endif
183
183
 
184
+ #ifndef Z_SOLO
184
185
 
185
186
  #ifdef SYS16BIT
186
187
 
@@ -316,3 +317,5 @@ void ZLIB_INTERNAL zcfree (opaque, ptr)
316
317
  }
317
318
 
318
319
  #endif /* MY_ZCALLOC */
320
+
321
+ #endif /* !Z_SOLO */
@@ -1,5 +1,5 @@
1
1
  /* zutil.h -- internal interface and configuration of the compression library
2
- * Copyright (C) 1995-2010 Jean-loup Gailly.
2
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
3
3
  * For conditions of distribution and use, see copyright notice in zlib.h
4
4
  */
5
5
 
@@ -13,7 +13,7 @@
13
13
  #ifndef ZUTIL_H
14
14
  #define ZUTIL_H
15
15
 
16
- #if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
16
+ #ifdef HAVE_HIDDEN
17
17
  # define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
18
18
  #else
19
19
  # define ZLIB_INTERNAL
@@ -21,7 +21,7 @@
21
21
 
22
22
  #include "zlib.h"
23
23
 
24
- #ifdef STDC
24
+ #if defined(STDC) && !defined(Z_SOLO)
25
25
  # if !(defined(_WIN32_WCE) && defined(_MSC_VER))
26
26
  # include <stddef.h>
27
27
  # endif
@@ -29,6 +29,10 @@
29
29
  # include <stdlib.h>
30
30
  #endif
31
31
 
32
+ #ifdef Z_SOLO
33
+ typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */
34
+ #endif
35
+
32
36
  #ifndef local
33
37
  # define local static
34
38
  #endif
@@ -40,13 +44,13 @@ typedef unsigned short ush;
40
44
  typedef ush FAR ushf;
41
45
  typedef unsigned long ulg;
42
46
 
43
- extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
47
+ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
44
48
  /* (size given to avoid silly warnings with Visual C++) */
45
49
 
46
50
  #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
47
51
 
48
52
  #define ERR_RETURN(strm,err) \
49
- return (strm->msg = (char*)ERR_MSG(err), (err))
53
+ return (strm->msg = ERR_MSG(err), (err))
50
54
  /* To be used only when the state is known to be valid */
51
55
 
52
56
  /* common constants */
@@ -78,16 +82,18 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
78
82
 
79
83
  #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
80
84
  # define OS_CODE 0x00
81
- # if defined(__TURBOC__) || defined(__BORLANDC__)
82
- # if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
83
- /* Allow compilation with ANSI keywords only enabled */
84
- void _Cdecl farfree( void *block );
85
- void *_Cdecl farmalloc( unsigned long nbytes );
86
- # else
87
- # include <alloc.h>
85
+ # ifndef Z_SOLO
86
+ # if defined(__TURBOC__) || defined(__BORLANDC__)
87
+ # if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
88
+ /* Allow compilation with ANSI keywords only enabled */
89
+ void _Cdecl farfree( void *block );
90
+ void *_Cdecl farmalloc( unsigned long nbytes );
91
+ # else
92
+ # include <alloc.h>
93
+ # endif
94
+ # else /* MSC or DJGPP */
95
+ # include <malloc.h>
88
96
  # endif
89
- # else /* MSC or DJGPP */
90
- # include <malloc.h>
91
97
  # endif
92
98
  #endif
93
99
 
@@ -107,18 +113,20 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
107
113
 
108
114
  #ifdef OS2
109
115
  # define OS_CODE 0x06
110
- # ifdef M_I86
116
+ # if defined(M_I86) && !defined(Z_SOLO)
111
117
  # include <malloc.h>
112
118
  # endif
113
119
  #endif
114
120
 
115
121
  #if defined(MACOS) || defined(TARGET_OS_MAC)
116
122
  # define OS_CODE 0x07
117
- # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
118
- # include <unix.h> /* for fdopen */
119
- # else
120
- # ifndef fdopen
121
- # define fdopen(fd,mode) NULL /* No fdopen() */
123
+ # ifndef Z_SOLO
124
+ # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
125
+ # include <unix.h> /* for fdopen */
126
+ # else
127
+ # ifndef fdopen
128
+ # define fdopen(fd,mode) NULL /* No fdopen() */
129
+ # endif
122
130
  # endif
123
131
  # endif
124
132
  #endif
@@ -153,14 +161,15 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
153
161
  # endif
154
162
  #endif
155
163
 
156
- #if defined(__BORLANDC__)
164
+ #if defined(__BORLANDC__) && !defined(MSDOS)
157
165
  #pragma warn -8004
158
166
  #pragma warn -8008
159
167
  #pragma warn -8066
160
168
  #endif
161
169
 
162
170
  /* provide prototypes for these when building zlib without LFS */
163
- #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
171
+ #if !defined(_WIN32) && \
172
+ (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
164
173
  ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
165
174
  ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
166
175
  #endif
@@ -177,42 +186,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
177
186
 
178
187
  /* functions */
179
188
 
180
- #if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
181
- # ifndef HAVE_VSNPRINTF
182
- # define HAVE_VSNPRINTF
183
- # endif
184
- #endif
185
- #if defined(__CYGWIN__)
186
- # ifndef HAVE_VSNPRINTF
187
- # define HAVE_VSNPRINTF
188
- # endif
189
- #endif
190
- #ifndef HAVE_VSNPRINTF
191
- # ifdef MSDOS
192
- /* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
193
- but for now we just assume it doesn't. */
194
- # define NO_vsnprintf
195
- # endif
196
- # ifdef __TURBOC__
197
- # define NO_vsnprintf
198
- # endif
199
- # ifdef WIN32
200
- /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
201
- # if !defined(vsnprintf) && !defined(NO_vsnprintf)
202
- # if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
203
- # define vsnprintf _vsnprintf
204
- # endif
205
- # endif
206
- # endif
207
- # ifdef __SASC
208
- # define NO_vsnprintf
209
- # endif
210
- #endif
211
- #ifdef VMS
212
- # define NO_vsnprintf
213
- #endif
214
-
215
- #if defined(pyr)
189
+ #if defined(pyr) || defined(Z_SOLO)
216
190
  # define NO_MEMCPY
217
191
  #endif
218
192
  #if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
@@ -261,14 +235,19 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
261
235
  # define Tracecv(c,x)
262
236
  #endif
263
237
 
264
-
265
- voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
266
- unsigned size));
267
- void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
238
+ #ifndef Z_SOLO
239
+ voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
240
+ unsigned size));
241
+ void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
242
+ #endif
268
243
 
269
244
  #define ZALLOC(strm, items, size) \
270
245
  (*((strm)->zalloc))((strm)->opaque, (items), (size))
271
246
  #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
272
247
  #define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
273
248
 
249
+ /* Reverse the bytes in a 32-bit value */
250
+ #define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
251
+ (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
252
+
274
253
  #endif /* ZUTIL_H */
@@ -8,6 +8,7 @@
8
8
  #ifndef INCLUDE_git_git_h__
9
9
  #define INCLUDE_git_git_h__
10
10
 
11
+ #include "git2/annotated_commit.h"
11
12
  #include "git2/attr.h"
12
13
  #include "git2/blob.h"
13
14
  #include "git2/blame.h"
@@ -19,9 +20,11 @@
19
20
  #include "git2/commit.h"
20
21
  #include "git2/common.h"
21
22
  #include "git2/config.h"
23
+ #include "git2/describe.h"
22
24
  #include "git2/diff.h"
23
25
  #include "git2/errors.h"
24
26
  #include "git2/filter.h"
27
+ #include "git2/global.h"
25
28
  #include "git2/graph.h"
26
29
  #include "git2/ignore.h"
27
30
  #include "git2/index.h"
@@ -38,6 +41,7 @@
38
41
  #include "git2/patch.h"
39
42
  #include "git2/pathspec.h"
40
43
  #include "git2/push.h"
44
+ #include "git2/rebase.h"
41
45
  #include "git2/refdb.h"
42
46
  #include "git2/reflog.h"
43
47
  #include "git2/refs.h"
@@ -0,0 +1,99 @@
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
+ #ifndef INCLUDE_git_annotated_commit_h__
8
+ #define INCLUDE_git_annotated_commit_h__
9
+
10
+ #include "common.h"
11
+ #include "repository.h"
12
+ #include "types.h"
13
+
14
+ /**
15
+ * @file git2/annotated_commit.h
16
+ * @brief Git annotated commit routines
17
+ * @defgroup git_annotated_commit Git annotated commit routines
18
+ * @ingroup Git
19
+ * @{
20
+ */
21
+ GIT_BEGIN_DECL
22
+
23
+ /**
24
+ * Creates a `git_annotated_commit` from the given reference.
25
+ * The resulting git_annotated_commit must be freed with
26
+ * `git_annotated_commit_free`.
27
+ *
28
+ * @param out pointer to store the git_annotated_commit result in
29
+ * @param repo repository that contains the given reference
30
+ * @param ref reference to use to lookup the git_annotated_commit
31
+ * @return 0 on success or error code
32
+ */
33
+ GIT_EXTERN(int) git_annotated_commit_from_ref(
34
+ git_annotated_commit **out,
35
+ git_repository *repo,
36
+ const git_reference *ref);
37
+
38
+ /**
39
+ * Creates a `git_annotated_commit` from the given fetch head data.
40
+ * The resulting git_annotated_commit must be freed with
41
+ * `git_annotated_commit_free`.
42
+ *
43
+ * @param out pointer to store the git_annotated_commit result in
44
+ * @param repo repository that contains the given commit
45
+ * @param branch_name name of the (remote) branch
46
+ * @param remote_url url of the remote
47
+ * @param oid the commit object id of the remote branch
48
+ * @return 0 on success or error code
49
+ */
50
+ GIT_EXTERN(int) git_annotated_commit_from_fetchhead(
51
+ git_annotated_commit **out,
52
+ git_repository *repo,
53
+ const char *branch_name,
54
+ const char *remote_url,
55
+ const git_oid *id);
56
+
57
+ /**
58
+ * Creates a `git_annotated_commit` from the given commit id.
59
+ * The resulting git_annotated_commit must be freed with
60
+ * `git_annotated_commit_free`.
61
+ *
62
+ * An annotated commit contains information about how it was
63
+ * looked up, which may be useful for functions like merge or
64
+ * rebase to provide context to the operation. For example,
65
+ * conflict files will include the name of the source or target
66
+ * branches being merged. It is therefore preferable to use the
67
+ * most specific function (eg `git_annotated_commit_from_ref`)
68
+ * instead of this one when that data is known.
69
+ *
70
+ * @param out pointer to store the git_annotated_commit result in
71
+ * @param repo repository that contains the given commit
72
+ * @param id the commit object id to lookup
73
+ * @return 0 on success or error code
74
+ */
75
+ GIT_EXTERN(int) git_annotated_commit_lookup(
76
+ git_annotated_commit **out,
77
+ git_repository *repo,
78
+ const git_oid *id);
79
+
80
+ /**
81
+ * Gets the commit ID that the given `git_annotated_commit` refers to.
82
+ *
83
+ * @param head the given annotated commit
84
+ * @return commit id
85
+ */
86
+ GIT_EXTERN(const git_oid *) git_annotated_commit_id(
87
+ const git_annotated_commit *commit);
88
+
89
+ /**
90
+ * Frees a `git_annotated_commit`.
91
+ *
92
+ * @param annotated_commit annotated commit to free
93
+ */
94
+ GIT_EXTERN(void) git_annotated_commit_free(
95
+ git_annotated_commit *commit);
96
+
97
+ /** @} */
98
+ GIT_END_DECL
99
+ #endif
@@ -76,25 +76,28 @@ GIT_BEGIN_DECL
76
76
  */
77
77
  #define GIT_ATTR_HAS_VALUE(attr) (git_attr_value(attr) == GIT_ATTR_VALUE_T)
78
78
 
79
+ /**
80
+ * Possible states for an attribute
81
+ */
79
82
  typedef enum {
80
- GIT_ATTR_UNSPECIFIED_T = 0,
81
- GIT_ATTR_TRUE_T,
82
- GIT_ATTR_FALSE_T,
83
- GIT_ATTR_VALUE_T,
83
+ GIT_ATTR_UNSPECIFIED_T = 0, /**< The attribute has been left unspecified */
84
+ GIT_ATTR_TRUE_T, /**< The attribute has been set */
85
+ GIT_ATTR_FALSE_T, /**< The attribute has been unset */
86
+ GIT_ATTR_VALUE_T, /**< This attribute has a value */
84
87
  } git_attr_t;
85
88
 
86
- /*
87
- * Return the value type for a given attribute.
89
+ /**
90
+ * Return the value type for a given attribute.
88
91
  *
89
- * This can be either `TRUE`, `FALSE`, `UNSPECIFIED` (if the attribute
90
- * was not set at all), or `VALUE`, if the attribute was set to
91
- * an actual string.
92
+ * This can be either `TRUE`, `FALSE`, `UNSPECIFIED` (if the attribute
93
+ * was not set at all), or `VALUE`, if the attribute was set to an
94
+ * actual string.
92
95
  *
93
- * If the attribute has a `VALUE` string, it can be accessed normally
94
- * as a NULL-terminated C string.
96
+ * If the attribute has a `VALUE` string, it can be accessed normally
97
+ * as a NULL-terminated C string.
95
98
  *
96
- * @param attr The attribute
97
- * @return the value type for the attribute
99
+ * @param attr The attribute
100
+ * @return the value type for the attribute
98
101
  */
99
102
  GIT_EXTERN(git_attr_t) git_attr_value(const char *attr);
100
103
 
@@ -260,6 +260,17 @@ GIT_EXTERN(int) git_branch_remote_name(
260
260
  git_repository *repo,
261
261
  const char *canonical_branch_name);
262
262
 
263
+
264
+ /**
265
+ * Retrieve the name fo the upstream remote of a local branch
266
+ *
267
+ * @param buf the buffer into which to write the name
268
+ * @param repo the repository in which to look
269
+ * @param refname the full name of the branch
270
+ * @return 0 or an error code
271
+ */
272
+ GIT_EXTERN(int) git_branch_upstream_remote(git_buf *buf, git_repository *repo, const char *refname);
273
+
263
274
  /** @} */
264
275
  GIT_END_DECL
265
276
  #endif
@@ -105,6 +105,22 @@ GIT_EXTERN(int) git_buf_grow(git_buf *buffer, size_t target_size);
105
105
  GIT_EXTERN(int) git_buf_set(
106
106
  git_buf *buffer, const void *data, size_t datalen);
107
107
 
108
+ /**
109
+ * Check quickly if buffer looks like it contains binary data
110
+ *
111
+ * @param buf Buffer to check
112
+ * @return 1 if buffer looks like non-text data
113
+ */
114
+ GIT_EXTERN(int) git_buf_is_binary(const git_buf *buf);
115
+
116
+ /**
117
+ * Check quickly if buffer contains a NUL byte
118
+ *
119
+ * @param buf Buffer to check
120
+ * @return 1 if buffer contains a NUL byte
121
+ */
122
+ GIT_EXTERN(int) git_buf_contains_nul(const git_buf *buf);
123
+
108
124
  GIT_END_DECL
109
125
 
110
126
  /** @} */