rugged 0.21.1b2 → 0.21.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -12
- data/ext/rugged/extconf.rb +8 -8
- data/ext/rugged/rugged.h +1 -1
- data/ext/rugged/rugged_blob.c +0 -57
- data/ext/rugged/rugged_cred.c +0 -23
- data/ext/rugged/rugged_index.c +2 -6
- data/ext/rugged/rugged_remote.c +1 -69
- data/ext/rugged/rugged_repo.c +5 -287
- data/ext/rugged/rugged_tag_collection.c +2 -70
- data/ext/rugged/rugged_tree.c +10 -29
- data/lib/rugged.rb +0 -2
- data/lib/rugged/diff.rb +1 -0
- data/lib/rugged/diff/line.rb +3 -1
- data/lib/rugged/patch.rb +2 -12
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +0 -11
- data/vendor/libgit2/deps/http-parser/http_parser.h +0 -2
- data/vendor/libgit2/deps/zlib/adler32.c +29 -39
- data/vendor/libgit2/deps/zlib/crc32.c +50 -33
- data/vendor/libgit2/deps/zlib/crc32.h +1 -1
- data/vendor/libgit2/deps/zlib/deflate.c +65 -198
- data/vendor/libgit2/deps/zlib/deflate.h +4 -8
- data/vendor/libgit2/deps/zlib/inffast.c +3 -3
- data/vendor/libgit2/deps/zlib/inffixed.h +3 -3
- data/vendor/libgit2/deps/zlib/inflate.c +52 -84
- data/vendor/libgit2/deps/zlib/inftrees.c +39 -15
- data/vendor/libgit2/deps/zlib/trees.c +36 -18
- data/vendor/libgit2/deps/zlib/zconf.h +0 -4
- data/vendor/libgit2/deps/zlib/zlib.h +95 -250
- data/vendor/libgit2/deps/zlib/zutil.c +10 -13
- data/vendor/libgit2/deps/zlib/zutil.h +62 -41
- data/vendor/libgit2/include/git2/attr.h +13 -16
- data/vendor/libgit2/include/git2/buffer.h +0 -16
- data/vendor/libgit2/include/git2/checkout.h +12 -12
- data/vendor/libgit2/include/git2/cherrypick.h +15 -15
- data/vendor/libgit2/include/git2/clone.h +69 -77
- data/vendor/libgit2/include/git2/diff.h +0 -7
- data/vendor/libgit2/include/git2/errors.h +0 -2
- data/vendor/libgit2/include/git2/merge.h +0 -16
- data/vendor/libgit2/include/git2/oid.h +4 -8
- data/vendor/libgit2/include/git2/remote.h +32 -13
- data/vendor/libgit2/include/git2/repository.h +1 -4
- data/vendor/libgit2/include/git2/reset.h +0 -4
- data/vendor/libgit2/include/git2/revert.h +1 -1
- data/vendor/libgit2/include/git2/status.h +14 -17
- data/vendor/libgit2/include/git2/submodule.h +0 -18
- data/vendor/libgit2/include/git2/sys/repository.h +0 -13
- data/vendor/libgit2/include/git2/transport.h +313 -79
- data/vendor/libgit2/include/git2/tree.h +2 -4
- data/vendor/libgit2/include/git2/types.h +6 -54
- data/vendor/libgit2/include/git2/version.h +2 -2
- data/vendor/libgit2/src/attr.c +4 -8
- data/vendor/libgit2/src/attr_file.c +1 -14
- data/vendor/libgit2/src/blame.c +1 -0
- data/vendor/libgit2/src/buf_text.c +5 -9
- data/vendor/libgit2/src/buf_text.h +2 -3
- data/vendor/libgit2/src/buffer.c +10 -67
- data/vendor/libgit2/src/buffer.h +2 -4
- data/vendor/libgit2/src/cache.c +9 -9
- data/vendor/libgit2/src/cache.h +1 -1
- data/vendor/libgit2/src/checkout.c +44 -121
- data/vendor/libgit2/src/cherrypick.c +44 -41
- data/vendor/libgit2/src/clone.c +56 -94
- data/vendor/libgit2/src/config_file.c +7 -2
- data/vendor/libgit2/src/crlf.c +1 -2
- data/vendor/libgit2/src/diff.c +0 -21
- data/vendor/libgit2/src/diff_file.c +0 -1
- data/vendor/libgit2/src/diff_print.c +9 -11
- data/vendor/libgit2/src/diff_tform.c +2 -4
- data/vendor/libgit2/src/errors.c +7 -9
- data/vendor/libgit2/src/filebuf.c +2 -0
- data/vendor/libgit2/src/fileops.c +7 -9
- data/vendor/libgit2/src/filter.c +11 -2
- data/vendor/libgit2/src/global.c +20 -3
- data/vendor/libgit2/src/global.h +0 -2
- data/vendor/libgit2/src/graph.c +2 -2
- data/vendor/libgit2/src/hashsig.c +1 -1
- data/vendor/libgit2/{include/git2/sys → src}/hashsig.h +7 -11
- data/vendor/libgit2/src/ignore.c +2 -2
- data/vendor/libgit2/src/indexer.c +1 -13
- data/vendor/libgit2/src/merge.c +145 -99
- data/vendor/libgit2/src/merge.h +1 -1
- data/vendor/libgit2/src/mwindow.c +8 -117
- data/vendor/libgit2/src/mwindow.h +1 -9
- data/vendor/libgit2/src/netops.c +7 -6
- data/vendor/libgit2/src/netops.h +4 -0
- data/vendor/libgit2/src/odb_loose.c +1 -1
- data/vendor/libgit2/src/odb_pack.c +3 -6
- data/vendor/libgit2/src/oid.c +0 -8
- data/vendor/libgit2/src/oid.h +0 -11
- data/vendor/libgit2/src/pack.c +6 -20
- data/vendor/libgit2/src/pack.h +0 -3
- data/vendor/libgit2/src/path.c +64 -134
- data/vendor/libgit2/src/path.h +1 -22
- data/vendor/libgit2/src/posix.h +28 -46
- data/vendor/libgit2/src/refs.h +2 -2
- data/vendor/libgit2/src/refspec.c +2 -14
- data/vendor/libgit2/src/remote.c +26 -29
- data/vendor/libgit2/src/remote.h +1 -3
- data/vendor/libgit2/src/repository.c +14 -54
- data/vendor/libgit2/src/revert.c +6 -4
- data/vendor/libgit2/src/revparse.c +18 -15
- data/vendor/libgit2/src/signature.c +2 -2
- data/vendor/libgit2/src/stash.c +1 -2
- data/vendor/libgit2/src/status.c +2 -11
- data/vendor/libgit2/src/strnlen.h +1 -2
- data/vendor/libgit2/src/submodule.c +33 -73
- data/vendor/libgit2/src/tag.c +3 -2
- data/vendor/libgit2/src/thread-utils.h +7 -0
- data/vendor/libgit2/src/trace.h +1 -9
- data/vendor/libgit2/src/transport.c +90 -93
- data/vendor/libgit2/src/transports/cred.c +0 -58
- data/vendor/libgit2/src/transports/cred_helpers.c +0 -3
- data/vendor/libgit2/src/transports/git.c +0 -1
- data/vendor/libgit2/src/transports/http.c +82 -205
- data/vendor/libgit2/src/transports/smart.c +0 -2
- data/vendor/libgit2/src/transports/smart.h +0 -2
- data/vendor/libgit2/src/transports/smart_protocol.c +5 -7
- data/vendor/libgit2/src/transports/ssh.c +35 -224
- data/vendor/libgit2/src/transports/winhttp.c +34 -140
- data/vendor/libgit2/src/tree.c +60 -64
- data/vendor/libgit2/src/tree.h +3 -2
- data/vendor/libgit2/src/unix/posix.h +9 -23
- data/vendor/libgit2/src/unix/realpath.c +7 -8
- data/vendor/libgit2/src/util.c +1 -2
- data/vendor/libgit2/src/util.h +3 -3
- data/vendor/libgit2/src/win32/mingw-compat.h +12 -5
- data/vendor/libgit2/src/win32/msvc-compat.h +32 -3
- data/vendor/libgit2/src/win32/posix.h +31 -20
- data/vendor/libgit2/src/win32/posix_w32.c +18 -62
- metadata +5 -18
- data/lib/rugged/attributes.rb +0 -41
- data/lib/rugged/blob.rb +0 -28
- data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +0 -324
- data/vendor/libgit2/deps/zlib/infback.c +0 -640
- data/vendor/libgit2/include/git2/oidarray.h +0 -40
- data/vendor/libgit2/include/git2/sys/transport.h +0 -352
- data/vendor/libgit2/src/oidarray.c +0 -21
- data/vendor/libgit2/src/oidarray.h +0 -18
- data/vendor/libgit2/src/transports/auth.c +0 -71
- data/vendor/libgit2/src/transports/auth.h +0 -63
- data/vendor/libgit2/src/transports/auth_negotiate.c +0 -275
- data/vendor/libgit2/src/transports/auth_negotiate.h +0 -27
- data/vendor/libgit2/src/transports/cred.h +0 -14
@@ -1,5 +1,5 @@
|
|
1
1
|
/* zutil.c -- target dependent utility functions for the compression library
|
2
|
-
* Copyright (C) 1995-2005, 2010
|
2
|
+
* Copyright (C) 1995-2005, 2010 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
|
-
|
14
|
+
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
|
-
#
|
88
|
+
#ifdef STDC
|
89
89
|
# ifdef NO_vsnprintf
|
90
|
-
|
90
|
+
flags += 1L << 25;
|
91
91
|
# ifdef HAS_vsprintf_void
|
92
|
-
|
92
|
+
flags += 1L << 26;
|
93
93
|
# endif
|
94
94
|
# else
|
95
95
|
# ifdef HAS_vsnprintf_void
|
96
|
-
|
96
|
+
flags += 1L << 26;
|
97
97
|
# endif
|
98
98
|
# endif
|
99
99
|
#else
|
100
|
-
|
100
|
+
flags += 1L << 24;
|
101
101
|
# ifdef NO_snprintf
|
102
|
-
|
102
|
+
flags += 1L << 25;
|
103
103
|
# ifdef HAS_sprintf_void
|
104
|
-
|
104
|
+
flags += 1L << 26;
|
105
105
|
# endif
|
106
106
|
# else
|
107
107
|
# ifdef HAS_snprintf_void
|
108
|
-
|
108
|
+
flags += 1L << 26;
|
109
109
|
# endif
|
110
110
|
# endif
|
111
111
|
#endif
|
@@ -181,7 +181,6 @@ void ZLIB_INTERNAL zmemzero(dest, len)
|
|
181
181
|
}
|
182
182
|
#endif
|
183
183
|
|
184
|
-
#ifndef Z_SOLO
|
185
184
|
|
186
185
|
#ifdef SYS16BIT
|
187
186
|
|
@@ -317,5 +316,3 @@ void ZLIB_INTERNAL zcfree (opaque, ptr)
|
|
317
316
|
}
|
318
317
|
|
319
318
|
#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-
|
2
|
+
* Copyright (C) 1995-2010 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
|
-
#
|
16
|
+
#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
|
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
|
-
#
|
24
|
+
#ifdef STDC
|
25
25
|
# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
|
26
26
|
# include <stddef.h>
|
27
27
|
# endif
|
@@ -29,10 +29,6 @@
|
|
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
|
-
|
36
32
|
#ifndef local
|
37
33
|
# define local static
|
38
34
|
#endif
|
@@ -44,13 +40,13 @@ typedef unsigned short ush;
|
|
44
40
|
typedef ush FAR ushf;
|
45
41
|
typedef unsigned long ulg;
|
46
42
|
|
47
|
-
extern
|
43
|
+
extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
48
44
|
/* (size given to avoid silly warnings with Visual C++) */
|
49
45
|
|
50
46
|
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
|
51
47
|
|
52
48
|
#define ERR_RETURN(strm,err) \
|
53
|
-
return (strm->msg = ERR_MSG(err), (err))
|
49
|
+
return (strm->msg = (char*)ERR_MSG(err), (err))
|
54
50
|
/* To be used only when the state is known to be valid */
|
55
51
|
|
56
52
|
/* common constants */
|
@@ -82,18 +78,16 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
|
82
78
|
|
83
79
|
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
|
84
80
|
# define OS_CODE 0x00
|
85
|
-
#
|
86
|
-
# if defined(
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
#
|
92
|
-
# include <alloc.h>
|
93
|
-
# endif
|
94
|
-
# else /* MSC or DJGPP */
|
95
|
-
# include <malloc.h>
|
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>
|
96
88
|
# endif
|
89
|
+
# else /* MSC or DJGPP */
|
90
|
+
# include <malloc.h>
|
97
91
|
# endif
|
98
92
|
#endif
|
99
93
|
|
@@ -113,20 +107,18 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
|
113
107
|
|
114
108
|
#ifdef OS2
|
115
109
|
# define OS_CODE 0x06
|
116
|
-
#
|
110
|
+
# ifdef M_I86
|
117
111
|
# include <malloc.h>
|
118
112
|
# endif
|
119
113
|
#endif
|
120
114
|
|
121
115
|
#if defined(MACOS) || defined(TARGET_OS_MAC)
|
122
116
|
# define OS_CODE 0x07
|
123
|
-
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
#
|
127
|
-
#
|
128
|
-
# define fdopen(fd,mode) NULL /* No fdopen() */
|
129
|
-
# endif
|
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() */
|
130
122
|
# endif
|
131
123
|
# endif
|
132
124
|
#endif
|
@@ -161,15 +153,14 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
|
161
153
|
# endif
|
162
154
|
#endif
|
163
155
|
|
164
|
-
#if defined(__BORLANDC__)
|
156
|
+
#if defined(__BORLANDC__)
|
165
157
|
#pragma warn -8004
|
166
158
|
#pragma warn -8008
|
167
159
|
#pragma warn -8066
|
168
160
|
#endif
|
169
161
|
|
170
162
|
/* provide prototypes for these when building zlib without LFS */
|
171
|
-
#if !defined(
|
172
|
-
(!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
|
163
|
+
#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
|
173
164
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
174
165
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
175
166
|
#endif
|
@@ -186,7 +177,42 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
|
186
177
|
|
187
178
|
/* functions */
|
188
179
|
|
189
|
-
#if defined(
|
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)
|
190
216
|
# define NO_MEMCPY
|
191
217
|
#endif
|
192
218
|
#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
|
@@ -235,19 +261,14 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
|
235
261
|
# define Tracecv(c,x)
|
236
262
|
#endif
|
237
263
|
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
#endif
|
264
|
+
|
265
|
+
voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
|
266
|
+
unsigned size));
|
267
|
+
void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
|
243
268
|
|
244
269
|
#define ZALLOC(strm, items, size) \
|
245
270
|
(*((strm)->zalloc))((strm)->opaque, (items), (size))
|
246
271
|
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
|
247
272
|
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
|
248
273
|
|
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
|
-
|
253
274
|
#endif /* ZUTIL_H */
|
@@ -76,28 +76,25 @@ 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
|
-
*/
|
82
79
|
typedef enum {
|
83
|
-
GIT_ATTR_UNSPECIFIED_T = 0,
|
84
|
-
GIT_ATTR_TRUE_T,
|
85
|
-
GIT_ATTR_FALSE_T,
|
86
|
-
GIT_ATTR_VALUE_T,
|
80
|
+
GIT_ATTR_UNSPECIFIED_T = 0,
|
81
|
+
GIT_ATTR_TRUE_T,
|
82
|
+
GIT_ATTR_FALSE_T,
|
83
|
+
GIT_ATTR_VALUE_T,
|
87
84
|
} git_attr_t;
|
88
85
|
|
89
|
-
|
90
|
-
*
|
86
|
+
/*
|
87
|
+
* Return the value type for a given attribute.
|
91
88
|
*
|
92
|
-
*
|
93
|
-
*
|
94
|
-
* actual string.
|
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.
|
95
92
|
*
|
96
|
-
*
|
97
|
-
*
|
93
|
+
* If the attribute has a `VALUE` string, it can be accessed normally
|
94
|
+
* as a NULL-terminated C string.
|
98
95
|
*
|
99
|
-
*
|
100
|
-
*
|
96
|
+
* @param attr The attribute
|
97
|
+
* @return the value type for the attribute
|
101
98
|
*/
|
102
99
|
GIT_EXTERN(git_attr_t) git_attr_value(const char *attr);
|
103
100
|
|
@@ -105,22 +105,6 @@ 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
|
-
|
124
108
|
GIT_END_DECL
|
125
109
|
|
126
110
|
/** @} */
|
@@ -233,18 +233,18 @@ typedef void (*git_checkout_progress_cb)(
|
|
233
233
|
typedef struct git_checkout_options {
|
234
234
|
unsigned int version;
|
235
235
|
|
236
|
-
unsigned int checkout_strategy;
|
236
|
+
unsigned int checkout_strategy; /** default will be a dry run */
|
237
237
|
|
238
|
-
int disable_filters;
|
239
|
-
unsigned int dir_mode;
|
240
|
-
unsigned int file_mode;
|
241
|
-
int file_open_flags;
|
238
|
+
int disable_filters; /** don't apply filters like CRLF conversion */
|
239
|
+
unsigned int dir_mode; /** default is 0755 */
|
240
|
+
unsigned int file_mode; /** default is 0644 or 0755 as dictated by blob */
|
241
|
+
int file_open_flags; /** default is O_CREAT | O_TRUNC | O_WRONLY */
|
242
242
|
|
243
|
-
unsigned int notify_flags;
|
243
|
+
unsigned int notify_flags; /** see `git_checkout_notify_t` above */
|
244
244
|
git_checkout_notify_cb notify_cb;
|
245
245
|
void *notify_payload;
|
246
246
|
|
247
|
-
|
247
|
+
/* Optional callback to notify the consumer of checkout progress. */
|
248
248
|
git_checkout_progress_cb progress_cb;
|
249
249
|
void *progress_payload;
|
250
250
|
|
@@ -254,13 +254,13 @@ typedef struct git_checkout_options {
|
|
254
254
|
*/
|
255
255
|
git_strarray paths;
|
256
256
|
|
257
|
-
git_tree *baseline;
|
257
|
+
git_tree *baseline; /** expected content of workdir, defaults to HEAD */
|
258
258
|
|
259
|
-
const char *target_directory;
|
259
|
+
const char *target_directory; /** alternative checkout path to workdir */
|
260
260
|
|
261
|
-
const char *ancestor_label;
|
262
|
-
const char *our_label;
|
263
|
-
const char *their_label;
|
261
|
+
const char *ancestor_label; /** the name of the common ancestor side of conflicts */
|
262
|
+
const char *our_label; /** the name of the "our" side of conflicts */
|
263
|
+
const char *their_label; /** the name of the "their" side of conflicts */
|
264
264
|
} git_checkout_options;
|
265
265
|
|
266
266
|
#define GIT_CHECKOUT_OPTIONS_VERSION 1
|
@@ -28,21 +28,21 @@ typedef struct {
|
|
28
28
|
|
29
29
|
git_merge_options merge_opts;
|
30
30
|
git_checkout_options checkout_opts;
|
31
|
-
}
|
31
|
+
} git_cherry_pick_options;
|
32
32
|
|
33
|
-
#define
|
34
|
-
#define
|
33
|
+
#define GIT_CHERRY_PICK_OPTIONS_VERSION 1
|
34
|
+
#define GIT_CHERRY_PICK_OPTIONS_INIT {GIT_CHERRY_PICK_OPTIONS_VERSION, 0, GIT_MERGE_OPTIONS_INIT, GIT_CHECKOUT_OPTIONS_INIT}
|
35
35
|
|
36
36
|
/**
|
37
|
-
* Initializes a `
|
38
|
-
* creating an instance with
|
37
|
+
* Initializes a `git_cherry_pick_options` with default values. Equivalent to
|
38
|
+
* creating an instance with GIT_CHERRY_PICK_OPTIONS_INIT.
|
39
39
|
*
|
40
|
-
* @param opts the `
|
41
|
-
* @param version Version of struct; pass `
|
40
|
+
* @param opts the `git_cherry_pick_options` struct to initialize
|
41
|
+
* @param version Version of struct; pass `GIT_CHERRY_PICK_OPTIONS_VERSION`
|
42
42
|
* @return Zero on success; -1 on failure.
|
43
43
|
*/
|
44
|
-
GIT_EXTERN(int)
|
45
|
-
|
44
|
+
GIT_EXTERN(int) git_cherry_pick_init_options(
|
45
|
+
git_cherry_pick_options *opts,
|
46
46
|
unsigned int version);
|
47
47
|
|
48
48
|
/**
|
@@ -53,16 +53,16 @@ GIT_EXTERN(int) git_cherrypick_init_options(
|
|
53
53
|
*
|
54
54
|
* @param out pointer to store the index result in
|
55
55
|
* @param repo the repository that contains the given commits
|
56
|
-
* @param
|
56
|
+
* @param cherry_pick_commit the commit to cherry-pick
|
57
57
|
* @param our_commit the commit to revert against (eg, HEAD)
|
58
58
|
* @param mainline the parent of the revert commit, if it is a merge
|
59
59
|
* @param merge_options the merge options (or null for defaults)
|
60
60
|
* @return zero on success, -1 on failure.
|
61
61
|
*/
|
62
|
-
GIT_EXTERN(int)
|
62
|
+
GIT_EXTERN(int) git_cherry_pick_commit(
|
63
63
|
git_index **out,
|
64
64
|
git_repository *repo,
|
65
|
-
git_commit *
|
65
|
+
git_commit *cherry_pick_commit,
|
66
66
|
git_commit *our_commit,
|
67
67
|
unsigned int mainline,
|
68
68
|
const git_merge_options *merge_options);
|
@@ -72,13 +72,13 @@ GIT_EXTERN(int) git_cherrypick_commit(
|
|
72
72
|
*
|
73
73
|
* @param repo the repository to cherry-pick
|
74
74
|
* @param commit the commit to cherry-pick
|
75
|
-
* @param
|
75
|
+
* @param cherry_pick_options the cherry-pick options (or null for defaults)
|
76
76
|
* @return zero on success, -1 on failure.
|
77
77
|
*/
|
78
|
-
GIT_EXTERN(int)
|
78
|
+
GIT_EXTERN(int) git_cherry_pick(
|
79
79
|
git_repository *repo,
|
80
80
|
git_commit *commit,
|
81
|
-
const
|
81
|
+
const git_cherry_pick_options *cherry_pick_options);
|
82
82
|
|
83
83
|
/** @} */
|
84
84
|
GIT_END_DECL
|
@@ -12,7 +12,6 @@
|
|
12
12
|
#include "indexer.h"
|
13
13
|
#include "checkout.h"
|
14
14
|
#include "remote.h"
|
15
|
-
#include "transport.h"
|
16
15
|
|
17
16
|
|
18
17
|
/**
|
@@ -52,47 +51,6 @@ typedef enum {
|
|
52
51
|
GIT_CLONE_LOCAL_NO_LINKS,
|
53
52
|
} git_clone_local_t;
|
54
53
|
|
55
|
-
/**
|
56
|
-
* The signature of a function matching git_remote_create, with an additional
|
57
|
-
* void* as a callback payload.
|
58
|
-
*
|
59
|
-
* Callers of git_clone may provide a function matching this signature to override
|
60
|
-
* the remote creation and customization process during a clone operation.
|
61
|
-
*
|
62
|
-
* @param out the resulting remote
|
63
|
-
* @param repo the repository in which to create the remote
|
64
|
-
* @param name the remote's name
|
65
|
-
* @param url the remote's url
|
66
|
-
* @param payload an opaque payload
|
67
|
-
* @return 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code
|
68
|
-
*/
|
69
|
-
typedef int (*git_remote_create_cb)(
|
70
|
-
git_remote **out,
|
71
|
-
git_repository *repo,
|
72
|
-
const char *name,
|
73
|
-
const char *url,
|
74
|
-
void *payload);
|
75
|
-
|
76
|
-
/**
|
77
|
-
* The signature of a function matchin git_repository_init, with an
|
78
|
-
* aditional void * as callback payload.
|
79
|
-
*
|
80
|
-
* Callers of git_clone my provide a function matching this signature
|
81
|
-
* to override the repository creation and customization process
|
82
|
-
* during a clone operation.
|
83
|
-
*
|
84
|
-
* @param out the resulting repository
|
85
|
-
* @param path path in which to create the repository
|
86
|
-
* @param bare whether the repository is bare. This is the value from the clone options
|
87
|
-
* @param payload payload specified by the options
|
88
|
-
* @return 0, or a negative value to indicate error
|
89
|
-
*/
|
90
|
-
typedef int (*git_repository_create_cb)(
|
91
|
-
git_repository **out,
|
92
|
-
const char *path,
|
93
|
-
int bare,
|
94
|
-
void *payload);
|
95
|
-
|
96
54
|
/**
|
97
55
|
* Clone options structure
|
98
56
|
*
|
@@ -114,11 +72,7 @@ typedef struct git_clone_options {
|
|
114
72
|
git_checkout_options checkout_opts;
|
115
73
|
|
116
74
|
/**
|
117
|
-
* Callbacks to use for reporting fetch progress
|
118
|
-
* credentials in the event they are needed. This parameter is ignored if
|
119
|
-
* the remote_cb parameter is set; if you provide a remote creation
|
120
|
-
* callback, then you have the opportunity to configure remote callbacks in
|
121
|
-
* provided function.
|
75
|
+
* Callbacks to use for reporting fetch progress.
|
122
76
|
*/
|
123
77
|
git_remote_callbacks remote_callbacks;
|
124
78
|
|
@@ -128,11 +82,23 @@ typedef struct git_clone_options {
|
|
128
82
|
*/
|
129
83
|
int bare;
|
130
84
|
|
85
|
+
/**
|
86
|
+
* Set to 1 if errors validating the remote host's certificate
|
87
|
+
* should be ignored.
|
88
|
+
*/
|
89
|
+
int ignore_cert_errors;
|
90
|
+
|
131
91
|
/**
|
132
92
|
* Whether to use a fetch or copy the object database.
|
133
93
|
*/
|
134
94
|
git_clone_local_t local;
|
135
95
|
|
96
|
+
/**
|
97
|
+
* The name to be given to the remote that will be
|
98
|
+
* created. The default is "origin".
|
99
|
+
*/
|
100
|
+
const char *remote_name;
|
101
|
+
|
136
102
|
/**
|
137
103
|
* The name of the branch to checkout. NULL means use the
|
138
104
|
* remote's default branch.
|
@@ -144,33 +110,6 @@ typedef struct git_clone_options {
|
|
144
110
|
* use the default signature using the config.
|
145
111
|
*/
|
146
112
|
git_signature *signature;
|
147
|
-
|
148
|
-
/**
|
149
|
-
* A callback used to create the new repository into which to
|
150
|
-
* clone. If NULL, the 'bare' field will be used to determine
|
151
|
-
* whether to create a bare repository.
|
152
|
-
*/
|
153
|
-
git_repository_create_cb repository_cb;
|
154
|
-
|
155
|
-
/**
|
156
|
-
* An opaque payload to pass to the git_repository creation callback.
|
157
|
-
* This parameter is ignored unless repository_cb is non-NULL.
|
158
|
-
*/
|
159
|
-
void *repository_cb_payload;
|
160
|
-
|
161
|
-
/**
|
162
|
-
* A callback used to create the git_remote, prior to its being
|
163
|
-
* used to perform the clone operation. See the documentation for
|
164
|
-
* git_remote_create_cb for details. This parameter may be NULL,
|
165
|
-
* indicating that git_clone should provide default behavior.
|
166
|
-
*/
|
167
|
-
git_remote_create_cb remote_cb;
|
168
|
-
|
169
|
-
/**
|
170
|
-
* An opaque payload to pass to the git_remote creation callback.
|
171
|
-
* This parameter is ignored unless remote_cb is non-NULL.
|
172
|
-
*/
|
173
|
-
void *remote_cb_payload;
|
174
113
|
} git_clone_options;
|
175
114
|
|
176
115
|
#define GIT_CLONE_OPTIONS_VERSION 1
|
@@ -191,9 +130,9 @@ GIT_EXTERN(int) git_clone_init_options(
|
|
191
130
|
/**
|
192
131
|
* Clone a remote repository.
|
193
132
|
*
|
194
|
-
*
|
195
|
-
*
|
196
|
-
*
|
133
|
+
* This version handles the simple case. If you'd like to create the
|
134
|
+
* repository or remote with non-default settings, you can create and
|
135
|
+
* configure them and then use `git_clone_into()`.
|
197
136
|
*
|
198
137
|
* @param out pointer that will receive the resulting repository object
|
199
138
|
* @param url the remote repository to clone
|
@@ -210,6 +149,59 @@ GIT_EXTERN(int) git_clone(
|
|
210
149
|
const char *local_path,
|
211
150
|
const git_clone_options *options);
|
212
151
|
|
152
|
+
/**
|
153
|
+
* Clone into a repository
|
154
|
+
*
|
155
|
+
* After creating the repository and remote and configuring them for
|
156
|
+
* paths and callbacks respectively, you can call this function to
|
157
|
+
* perform the clone operation and optionally checkout files.
|
158
|
+
*
|
159
|
+
* @param repo the repository to use
|
160
|
+
* @param remote the remote repository to clone from
|
161
|
+
* @param co_opts options to use during checkout
|
162
|
+
* @param branch the branch to checkout after the clone, pass NULL for the
|
163
|
+
* remote's default branch
|
164
|
+
* @param signature The identity used when updating the reflog.
|
165
|
+
* @return 0 on success, any non-zero return value from a callback
|
166
|
+
* function, or a negative value to indicate an error (use
|
167
|
+
* `giterr_last` for a detailed error message)
|
168
|
+
*/
|
169
|
+
GIT_EXTERN(int) git_clone_into(
|
170
|
+
git_repository *repo,
|
171
|
+
git_remote *remote,
|
172
|
+
const git_checkout_options *co_opts,
|
173
|
+
const char *branch,
|
174
|
+
const git_signature *signature);
|
175
|
+
|
176
|
+
/**
|
177
|
+
* Perform a local clone into a repository
|
178
|
+
*
|
179
|
+
* A "local clone" bypasses any git-aware protocols and simply copies
|
180
|
+
* over the object database from the source repository. It is often
|
181
|
+
* faster than a git-aware clone, but no verification of the data is
|
182
|
+
* performed, and can copy over too much data.
|
183
|
+
*
|
184
|
+
* @param repo the repository to use
|
185
|
+
* @param remote the remote repository to clone from
|
186
|
+
* @param co_opts options to use during checkout
|
187
|
+
* @param branch the branch to checkout after the clone, pass NULL for the
|
188
|
+
* remote's default branch
|
189
|
+
* @param link wether to use hardlinks instead of copying
|
190
|
+
* objects. This is only possible if both repositories are on the same
|
191
|
+
* filesystem.
|
192
|
+
* @param signature the identity used when updating the reflog
|
193
|
+
* @return 0 on success, any non-zero return value from a callback
|
194
|
+
* function, or a negative value to indicate an error (use
|
195
|
+
* `giterr_last` for a detailed error message)
|
196
|
+
*/
|
197
|
+
GIT_EXTERN(int) git_clone_local_into(
|
198
|
+
git_repository *repo,
|
199
|
+
git_remote *remote,
|
200
|
+
const git_checkout_options *co_opts,
|
201
|
+
const char *branch,
|
202
|
+
int link,
|
203
|
+
const git_signature *signature);
|
204
|
+
|
213
205
|
/** @} */
|
214
206
|
GIT_END_DECL
|
215
207
|
#endif
|