rugged 0.21.0 → 0.21.1b0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -5
- data/ext/rugged/extconf.rb +8 -8
- data/ext/rugged/rugged.h +1 -1
- data/ext/rugged/rugged_cred.c +23 -0
- data/ext/rugged/rugged_index.c +5 -1
- data/ext/rugged/rugged_remote.c +68 -0
- data/ext/rugged/rugged_repo.c +287 -5
- data/ext/rugged/rugged_tag_collection.c +70 -2
- data/ext/rugged/rugged_tree.c +29 -10
- data/lib/rugged.rb +1 -0
- data/lib/rugged/attributes.rb +41 -0
- data/lib/rugged/diff.rb +0 -1
- data/lib/rugged/diff/line.rb +1 -3
- data/lib/rugged/patch.rb +12 -2
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +11 -0
- data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +324 -0
- data/vendor/libgit2/deps/http-parser/http_parser.h +2 -0
- data/vendor/libgit2/deps/zlib/adler32.c +39 -29
- data/vendor/libgit2/deps/zlib/crc32.c +33 -50
- data/vendor/libgit2/deps/zlib/crc32.h +1 -1
- data/vendor/libgit2/deps/zlib/deflate.c +198 -65
- data/vendor/libgit2/deps/zlib/deflate.h +8 -4
- data/vendor/libgit2/deps/zlib/infback.c +640 -0
- 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 +84 -52
- data/vendor/libgit2/deps/zlib/inftrees.c +15 -39
- data/vendor/libgit2/deps/zlib/trees.c +18 -36
- data/vendor/libgit2/deps/zlib/zconf.h +4 -0
- data/vendor/libgit2/deps/zlib/zlib.h +250 -95
- data/vendor/libgit2/deps/zlib/zutil.c +13 -10
- data/vendor/libgit2/deps/zlib/zutil.h +41 -62
- data/vendor/libgit2/include/git2/attr.h +16 -13
- data/vendor/libgit2/include/git2/buffer.h +16 -0
- 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 +77 -69
- data/vendor/libgit2/include/git2/diff.h +7 -0
- data/vendor/libgit2/include/git2/errors.h +1 -0
- data/vendor/libgit2/include/git2/merge.h +16 -0
- data/vendor/libgit2/include/git2/oid.h +8 -4
- data/vendor/libgit2/include/git2/oidarray.h +40 -0
- data/vendor/libgit2/include/git2/remote.h +5 -24
- data/vendor/libgit2/include/git2/repository.h +4 -1
- data/vendor/libgit2/include/git2/reset.h +4 -0
- data/vendor/libgit2/include/git2/status.h +17 -14
- data/vendor/libgit2/include/git2/submodule.h +18 -0
- data/vendor/libgit2/include/git2/sys/transport.h +354 -0
- data/vendor/libgit2/include/git2/transport.h +34 -327
- data/vendor/libgit2/include/git2/types.h +16 -6
- data/vendor/libgit2/src/array.h +1 -1
- data/vendor/libgit2/src/attr_file.c +14 -1
- data/vendor/libgit2/src/blame.c +0 -1
- data/vendor/libgit2/src/buffer.c +67 -10
- data/vendor/libgit2/src/buffer.h +4 -2
- data/vendor/libgit2/src/cache.c +9 -9
- data/vendor/libgit2/src/cache.h +1 -1
- data/vendor/libgit2/src/checkout.c +118 -23
- data/vendor/libgit2/src/cherrypick.c +41 -44
- data/vendor/libgit2/src/clone.c +94 -56
- data/vendor/libgit2/src/config_file.c +4 -4
- data/vendor/libgit2/src/diff.c +21 -0
- data/vendor/libgit2/src/diff_file.c +1 -0
- data/vendor/libgit2/src/diff_print.c +11 -9
- data/vendor/libgit2/src/diff_tform.c +3 -1
- data/vendor/libgit2/src/errors.c +9 -7
- data/vendor/libgit2/src/fileops.c +5 -3
- data/vendor/libgit2/src/global.c +9 -1
- data/vendor/libgit2/src/global.h +1 -0
- data/vendor/libgit2/src/graph.c +2 -2
- data/vendor/libgit2/src/indexer.c +6 -1
- data/vendor/libgit2/src/merge.c +98 -144
- data/vendor/libgit2/src/merge.h +1 -1
- data/vendor/libgit2/src/netops.c +4 -0
- data/vendor/libgit2/src/oid.c +8 -0
- data/vendor/libgit2/src/oid.h +11 -0
- data/vendor/libgit2/src/oidarray.c +21 -0
- data/vendor/libgit2/src/oidarray.h +18 -0
- data/vendor/libgit2/src/pack.c +1 -4
- data/vendor/libgit2/src/path.c +93 -33
- data/vendor/libgit2/src/path.h +21 -0
- data/vendor/libgit2/src/pool.c +1 -1
- data/vendor/libgit2/src/posix.h +46 -28
- data/vendor/libgit2/src/refs.h +2 -2
- data/vendor/libgit2/src/refspec.c +54 -18
- data/vendor/libgit2/src/remote.c +31 -8
- data/vendor/libgit2/src/remote.h +3 -0
- data/vendor/libgit2/src/repository.c +27 -11
- data/vendor/libgit2/src/revert.c +4 -6
- data/vendor/libgit2/src/revparse.c +15 -18
- data/vendor/libgit2/src/revwalk.c +0 -3
- data/vendor/libgit2/src/signature.c +2 -2
- data/vendor/libgit2/src/stash.c +2 -1
- data/vendor/libgit2/src/status.c +11 -2
- data/vendor/libgit2/src/strnlen.h +2 -1
- data/vendor/libgit2/src/submodule.c +73 -33
- data/vendor/libgit2/src/thread-utils.h +0 -7
- data/vendor/libgit2/src/trace.h +9 -1
- data/vendor/libgit2/src/transport.c +93 -90
- data/vendor/libgit2/src/transports/auth.c +71 -0
- data/vendor/libgit2/src/transports/auth.h +63 -0
- data/vendor/libgit2/src/transports/auth_negotiate.c +275 -0
- data/vendor/libgit2/src/transports/auth_negotiate.h +27 -0
- data/vendor/libgit2/src/transports/cred.c +58 -0
- data/vendor/libgit2/src/transports/cred.h +14 -0
- data/vendor/libgit2/src/transports/cred_helpers.c +3 -0
- data/vendor/libgit2/src/transports/git.c +1 -0
- data/vendor/libgit2/src/transports/http.c +168 -76
- data/vendor/libgit2/src/transports/smart.h +1 -0
- data/vendor/libgit2/src/transports/smart_protocol.c +4 -2
- data/vendor/libgit2/src/transports/ssh.c +214 -38
- data/vendor/libgit2/src/transports/winhttp.c +26 -6
- data/vendor/libgit2/src/unix/posix.h +23 -9
- data/vendor/libgit2/src/unix/realpath.c +8 -7
- data/vendor/libgit2/src/util.c +2 -1
- data/vendor/libgit2/src/util.h +3 -3
- data/vendor/libgit2/src/win32/mingw-compat.h +5 -12
- data/vendor/libgit2/src/win32/msvc-compat.h +3 -32
- data/vendor/libgit2/src/win32/posix.h +20 -31
- data/vendor/libgit2/src/win32/posix_w32.c +33 -4
- metadata +81 -69
@@ -11,10 +11,6 @@
|
|
11
11
|
#include "net.h"
|
12
12
|
#include "types.h"
|
13
13
|
|
14
|
-
#ifdef GIT_SSH
|
15
|
-
#include <libssh2.h>
|
16
|
-
#endif
|
17
|
-
|
18
14
|
/**
|
19
15
|
* @file git2/transport.h
|
20
16
|
* @brief Git transport interfaces and functions
|
@@ -24,10 +20,6 @@
|
|
24
20
|
*/
|
25
21
|
GIT_BEGIN_DECL
|
26
22
|
|
27
|
-
/*
|
28
|
-
*** Begin interface for credentials acquisition ***
|
29
|
-
*/
|
30
|
-
|
31
23
|
/** Authentication type requested */
|
32
24
|
typedef enum {
|
33
25
|
/* git_cred_userpass_plaintext */
|
@@ -44,6 +36,14 @@ typedef enum {
|
|
44
36
|
|
45
37
|
/* git_cred_ssh_interactive */
|
46
38
|
GIT_CREDTYPE_SSH_INTERACTIVE = (1u << 4),
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Username-only information
|
42
|
+
*
|
43
|
+
* If the SSH transport does not know which username to use,
|
44
|
+
* it will ask via this credential type.
|
45
|
+
*/
|
46
|
+
GIT_CREDTYPE_USERNAME = (1u << 5),
|
47
47
|
} git_credtype_t;
|
48
48
|
|
49
49
|
/* The base structure for all credential types */
|
@@ -61,14 +61,20 @@ typedef struct {
|
|
61
61
|
char *password;
|
62
62
|
} git_cred_userpass_plaintext;
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
64
|
+
|
65
|
+
/*
|
66
|
+
* If the user hasn't included libssh2.h before git2.h, we need to
|
67
|
+
* define a few types for the callback signatures.
|
68
|
+
*/
|
69
|
+
#ifndef LIBSSH2_VERSION
|
70
|
+
typedef struct _LIBSSH2_SESSION LIBSSH2_SESSION;
|
71
|
+
typedef struct _LIBSSH2_USERAUTH_KBDINT_PROMPT LIBSSH2_USERAUTH_KBDINT_PROMPT;
|
72
|
+
typedef struct _LIBSSH2_USERAUTH_KBDINT_RESPONSE LIBSSH2_USERAUTH_KBDINT_RESPONSE;
|
70
73
|
#endif
|
71
74
|
|
75
|
+
typedef int (*git_cred_sign_callback)(LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len, const unsigned char *data, size_t data_len, void **abstract);
|
76
|
+
typedef void (*git_cred_ssh_interactive_callback)(const char* name, int name_len, const char* instruction, int instruction_len, int num_prompts, const LIBSSH2_USERAUTH_KBDINT_PROMPT* prompts, LIBSSH2_USERAUTH_KBDINT_RESPONSE* responses, void **abstract);
|
77
|
+
|
72
78
|
/**
|
73
79
|
* A ssh key from disk
|
74
80
|
*/
|
@@ -105,6 +111,12 @@ typedef struct git_cred_ssh_custom {
|
|
105
111
|
/** A key for NTLM/Kerberos "default" credentials */
|
106
112
|
typedef struct git_cred git_cred_default;
|
107
113
|
|
114
|
+
/** Username-only credential information */
|
115
|
+
typedef struct git_cred_username {
|
116
|
+
git_cred parent;
|
117
|
+
char username[1];
|
118
|
+
} git_cred_username;
|
119
|
+
|
108
120
|
/**
|
109
121
|
* Check whether a credential object contains username information.
|
110
122
|
*
|
@@ -206,6 +218,14 @@ GIT_EXTERN(int) git_cred_ssh_custom_new(
|
|
206
218
|
*/
|
207
219
|
GIT_EXTERN(int) git_cred_default_new(git_cred **out);
|
208
220
|
|
221
|
+
/**
|
222
|
+
* Create a credential to specify a username.
|
223
|
+
*
|
224
|
+
* This is used with ssh authentication to query for the username if
|
225
|
+
* none is specified in the url.
|
226
|
+
*/
|
227
|
+
GIT_EXTERN(int) git_cred_username_new(git_cred **cred, const char *username);
|
228
|
+
|
209
229
|
/**
|
210
230
|
* Signature of a function which acquires a credential object.
|
211
231
|
*
|
@@ -225,319 +245,6 @@ typedef int (*git_cred_acquire_cb)(
|
|
225
245
|
unsigned int allowed_types,
|
226
246
|
void *payload);
|
227
247
|
|
228
|
-
/*
|
229
|
-
*** End interface for credentials acquisition ***
|
230
|
-
*** Begin base transport interface ***
|
231
|
-
*/
|
232
|
-
|
233
|
-
typedef enum {
|
234
|
-
GIT_TRANSPORTFLAGS_NONE = 0,
|
235
|
-
/* If the connection is secured with SSL/TLS, the authenticity
|
236
|
-
* of the server certificate should not be verified. */
|
237
|
-
GIT_TRANSPORTFLAGS_NO_CHECK_CERT = 1
|
238
|
-
} git_transport_flags_t;
|
239
|
-
|
240
|
-
typedef int (*git_transport_message_cb)(const char *str, int len, void *data);
|
241
|
-
|
242
|
-
typedef struct git_transport git_transport;
|
243
|
-
|
244
|
-
struct git_transport {
|
245
|
-
unsigned int version;
|
246
|
-
/* Set progress and error callbacks */
|
247
|
-
int (*set_callbacks)(
|
248
|
-
git_transport *transport,
|
249
|
-
git_transport_message_cb progress_cb,
|
250
|
-
git_transport_message_cb error_cb,
|
251
|
-
void *payload);
|
252
|
-
|
253
|
-
/* Connect the transport to the remote repository, using the given
|
254
|
-
* direction. */
|
255
|
-
int (*connect)(
|
256
|
-
git_transport *transport,
|
257
|
-
const char *url,
|
258
|
-
git_cred_acquire_cb cred_acquire_cb,
|
259
|
-
void *cred_acquire_payload,
|
260
|
-
int direction,
|
261
|
-
int flags);
|
262
|
-
|
263
|
-
/* This function may be called after a successful call to
|
264
|
-
* connect(). The array returned is owned by the transport and
|
265
|
-
* is guranteed until the next call of a transport function. */
|
266
|
-
int (*ls)(
|
267
|
-
const git_remote_head ***out,
|
268
|
-
size_t *size,
|
269
|
-
git_transport *transport);
|
270
|
-
|
271
|
-
/* Executes the push whose context is in the git_push object. */
|
272
|
-
int (*push)(git_transport *transport, git_push *push);
|
273
|
-
|
274
|
-
/* This function may be called after a successful call to connect(), when
|
275
|
-
* the direction is FETCH. The function performs a negotiation to calculate
|
276
|
-
* the wants list for the fetch. */
|
277
|
-
int (*negotiate_fetch)(
|
278
|
-
git_transport *transport,
|
279
|
-
git_repository *repo,
|
280
|
-
const git_remote_head * const *refs,
|
281
|
-
size_t count);
|
282
|
-
|
283
|
-
/* This function may be called after a successful call to negotiate_fetch(),
|
284
|
-
* when the direction is FETCH. This function retrieves the pack file for
|
285
|
-
* the fetch from the remote end. */
|
286
|
-
int (*download_pack)(
|
287
|
-
git_transport *transport,
|
288
|
-
git_repository *repo,
|
289
|
-
git_transfer_progress *stats,
|
290
|
-
git_transfer_progress_cb progress_cb,
|
291
|
-
void *progress_payload);
|
292
|
-
|
293
|
-
/* Checks to see if the transport is connected */
|
294
|
-
int (*is_connected)(git_transport *transport);
|
295
|
-
|
296
|
-
/* Reads the flags value previously passed into connect() */
|
297
|
-
int (*read_flags)(git_transport *transport, int *flags);
|
298
|
-
|
299
|
-
/* Cancels any outstanding transport operation */
|
300
|
-
void (*cancel)(git_transport *transport);
|
301
|
-
|
302
|
-
/* This function is the reverse of connect() -- it terminates the
|
303
|
-
* connection to the remote end. */
|
304
|
-
int (*close)(git_transport *transport);
|
305
|
-
|
306
|
-
/* Frees/destructs the git_transport object. */
|
307
|
-
void (*free)(git_transport *transport);
|
308
|
-
};
|
309
|
-
|
310
|
-
#define GIT_TRANSPORT_VERSION 1
|
311
|
-
#define GIT_TRANSPORT_INIT {GIT_TRANSPORT_VERSION}
|
312
|
-
|
313
|
-
/**
|
314
|
-
* Initializes a `git_transport` with default values. Equivalent to
|
315
|
-
* creating an instance with GIT_TRANSPORT_INIT.
|
316
|
-
*
|
317
|
-
* @param opts the `git_transport` struct to initialize
|
318
|
-
* @param version Version of struct; pass `GIT_TRANSPORT_VERSION`
|
319
|
-
* @return Zero on success; -1 on failure.
|
320
|
-
*/
|
321
|
-
GIT_EXTERN(int) git_transport_init(
|
322
|
-
git_transport *opts,
|
323
|
-
unsigned int version);
|
324
|
-
|
325
|
-
/**
|
326
|
-
* Function to use to create a transport from a URL. The transport database
|
327
|
-
* is scanned to find a transport that implements the scheme of the URI (i.e.
|
328
|
-
* git:// or http://) and a transport object is returned to the caller.
|
329
|
-
*
|
330
|
-
* @param out The newly created transport (out)
|
331
|
-
* @param owner The git_remote which will own this transport
|
332
|
-
* @param url The URL to connect to
|
333
|
-
* @return 0 or an error code
|
334
|
-
*/
|
335
|
-
GIT_EXTERN(int) git_transport_new(git_transport **out, git_remote *owner, const char *url);
|
336
|
-
|
337
|
-
/* Signature of a function which creates a transport */
|
338
|
-
typedef int (*git_transport_cb)(git_transport **out, git_remote *owner, void *param);
|
339
|
-
|
340
|
-
/**
|
341
|
-
* Add a custom transport definition, to be used in addition to the built-in
|
342
|
-
* set of transports that come with libgit2.
|
343
|
-
*
|
344
|
-
* The caller is responsible for synchronizing calls to git_transport_register
|
345
|
-
* and git_transport_unregister with other calls to the library that
|
346
|
-
* instantiate transports.
|
347
|
-
*
|
348
|
-
* @param prefix The scheme (ending in "://") to match, i.e. "git://"
|
349
|
-
* @param priority The priority of this transport relative to others with
|
350
|
-
* the same prefix. Built-in transports have a priority of 1.
|
351
|
-
* @param cb The callback used to create an instance of the transport
|
352
|
-
* @param param A fixed parameter to pass to cb at creation time
|
353
|
-
* @return 0 or an error code
|
354
|
-
*/
|
355
|
-
GIT_EXTERN(int) git_transport_register(
|
356
|
-
const char *prefix,
|
357
|
-
unsigned priority,
|
358
|
-
git_transport_cb cb,
|
359
|
-
void *param);
|
360
|
-
|
361
|
-
/**
|
362
|
-
*
|
363
|
-
* Unregister a custom transport definition which was previously registered
|
364
|
-
* with git_transport_register.
|
365
|
-
*
|
366
|
-
* @param prefix From the previous call to git_transport_register
|
367
|
-
* @param priority From the previous call to git_transport_register
|
368
|
-
* @return 0 or an error code
|
369
|
-
*/
|
370
|
-
GIT_EXTERN(int) git_transport_unregister(
|
371
|
-
const char *prefix,
|
372
|
-
unsigned priority);
|
373
|
-
|
374
|
-
/* Transports which come with libgit2 (match git_transport_cb). The expected
|
375
|
-
* value for "param" is listed in-line below. */
|
376
|
-
|
377
|
-
/**
|
378
|
-
* Create an instance of the dummy transport.
|
379
|
-
*
|
380
|
-
* @param out The newly created transport (out)
|
381
|
-
* @param owner The git_remote which will own this transport
|
382
|
-
* @param payload You must pass NULL for this parameter.
|
383
|
-
* @return 0 or an error code
|
384
|
-
*/
|
385
|
-
GIT_EXTERN(int) git_transport_dummy(
|
386
|
-
git_transport **out,
|
387
|
-
git_remote *owner,
|
388
|
-
/* NULL */ void *payload);
|
389
|
-
|
390
|
-
/**
|
391
|
-
* Create an instance of the local transport.
|
392
|
-
*
|
393
|
-
* @param out The newly created transport (out)
|
394
|
-
* @param owner The git_remote which will own this transport
|
395
|
-
* @param payload You must pass NULL for this parameter.
|
396
|
-
* @return 0 or an error code
|
397
|
-
*/
|
398
|
-
GIT_EXTERN(int) git_transport_local(
|
399
|
-
git_transport **out,
|
400
|
-
git_remote *owner,
|
401
|
-
/* NULL */ void *payload);
|
402
|
-
|
403
|
-
/**
|
404
|
-
* Create an instance of the smart transport.
|
405
|
-
*
|
406
|
-
* @param out The newly created transport (out)
|
407
|
-
* @param owner The git_remote which will own this transport
|
408
|
-
* @param payload A pointer to a git_smart_subtransport_definition
|
409
|
-
* @return 0 or an error code
|
410
|
-
*/
|
411
|
-
GIT_EXTERN(int) git_transport_smart(
|
412
|
-
git_transport **out,
|
413
|
-
git_remote *owner,
|
414
|
-
/* (git_smart_subtransport_definition *) */ void *payload);
|
415
|
-
|
416
|
-
/*
|
417
|
-
*** End of base transport interface ***
|
418
|
-
*** Begin interface for subtransports for the smart transport ***
|
419
|
-
*/
|
420
|
-
|
421
|
-
/* The smart transport knows how to speak the git protocol, but it has no
|
422
|
-
* knowledge of how to establish a connection between it and another endpoint,
|
423
|
-
* or how to move data back and forth. For this, a subtransport interface is
|
424
|
-
* declared, and the smart transport delegates this work to the subtransports.
|
425
|
-
* Three subtransports are implemented: git, http, and winhttp. (The http and
|
426
|
-
* winhttp transports each implement both http and https.) */
|
427
|
-
|
428
|
-
/* Subtransports can either be RPC = 0 (persistent connection) or RPC = 1
|
429
|
-
* (request/response). The smart transport handles the differences in its own
|
430
|
-
* logic. The git subtransport is RPC = 0, while http and winhttp are both
|
431
|
-
* RPC = 1. */
|
432
|
-
|
433
|
-
/* Actions that the smart transport can ask
|
434
|
-
* a subtransport to perform */
|
435
|
-
typedef enum {
|
436
|
-
GIT_SERVICE_UPLOADPACK_LS = 1,
|
437
|
-
GIT_SERVICE_UPLOADPACK = 2,
|
438
|
-
GIT_SERVICE_RECEIVEPACK_LS = 3,
|
439
|
-
GIT_SERVICE_RECEIVEPACK = 4,
|
440
|
-
} git_smart_service_t;
|
441
|
-
|
442
|
-
typedef struct git_smart_subtransport git_smart_subtransport;
|
443
|
-
typedef struct git_smart_subtransport_stream git_smart_subtransport_stream;
|
444
|
-
|
445
|
-
/* A stream used by the smart transport to read and write data
|
446
|
-
* from a subtransport */
|
447
|
-
struct git_smart_subtransport_stream {
|
448
|
-
/* The owning subtransport */
|
449
|
-
git_smart_subtransport *subtransport;
|
450
|
-
|
451
|
-
int (*read)(
|
452
|
-
git_smart_subtransport_stream *stream,
|
453
|
-
char *buffer,
|
454
|
-
size_t buf_size,
|
455
|
-
size_t *bytes_read);
|
456
|
-
|
457
|
-
int (*write)(
|
458
|
-
git_smart_subtransport_stream *stream,
|
459
|
-
const char *buffer,
|
460
|
-
size_t len);
|
461
|
-
|
462
|
-
void (*free)(
|
463
|
-
git_smart_subtransport_stream *stream);
|
464
|
-
};
|
465
|
-
|
466
|
-
/* An implementation of a subtransport which carries data for the
|
467
|
-
* smart transport */
|
468
|
-
struct git_smart_subtransport {
|
469
|
-
int (* action)(
|
470
|
-
git_smart_subtransport_stream **out,
|
471
|
-
git_smart_subtransport *transport,
|
472
|
-
const char *url,
|
473
|
-
git_smart_service_t action);
|
474
|
-
|
475
|
-
/* Subtransports are guaranteed a call to close() between
|
476
|
-
* calls to action(), except for the following two "natural" progressions
|
477
|
-
* of actions against a constant URL.
|
478
|
-
*
|
479
|
-
* 1. UPLOADPACK_LS -> UPLOADPACK
|
480
|
-
* 2. RECEIVEPACK_LS -> RECEIVEPACK */
|
481
|
-
int (*close)(git_smart_subtransport *transport);
|
482
|
-
|
483
|
-
void (*free)(git_smart_subtransport *transport);
|
484
|
-
};
|
485
|
-
|
486
|
-
/* A function which creates a new subtransport for the smart transport */
|
487
|
-
typedef int (*git_smart_subtransport_cb)(
|
488
|
-
git_smart_subtransport **out,
|
489
|
-
git_transport* owner);
|
490
|
-
|
491
|
-
typedef struct git_smart_subtransport_definition {
|
492
|
-
/* The function to use to create the git_smart_subtransport */
|
493
|
-
git_smart_subtransport_cb callback;
|
494
|
-
|
495
|
-
/* True if the protocol is stateless; false otherwise. For example,
|
496
|
-
* http:// is stateless, but git:// is not. */
|
497
|
-
unsigned rpc;
|
498
|
-
} git_smart_subtransport_definition;
|
499
|
-
|
500
|
-
/* Smart transport subtransports that come with libgit2 */
|
501
|
-
|
502
|
-
/**
|
503
|
-
* Create an instance of the http subtransport. This subtransport
|
504
|
-
* also supports https. On Win32, this subtransport may be implemented
|
505
|
-
* using the WinHTTP library.
|
506
|
-
*
|
507
|
-
* @param out The newly created subtransport
|
508
|
-
* @param owner The smart transport to own this subtransport
|
509
|
-
* @return 0 or an error code
|
510
|
-
*/
|
511
|
-
GIT_EXTERN(int) git_smart_subtransport_http(
|
512
|
-
git_smart_subtransport **out,
|
513
|
-
git_transport* owner);
|
514
|
-
|
515
|
-
/**
|
516
|
-
* Create an instance of the git subtransport.
|
517
|
-
*
|
518
|
-
* @param out The newly created subtransport
|
519
|
-
* @param owner The smart transport to own this subtransport
|
520
|
-
* @return 0 or an error code
|
521
|
-
*/
|
522
|
-
GIT_EXTERN(int) git_smart_subtransport_git(
|
523
|
-
git_smart_subtransport **out,
|
524
|
-
git_transport* owner);
|
525
|
-
|
526
|
-
/**
|
527
|
-
* Create an instance of the ssh subtransport.
|
528
|
-
*
|
529
|
-
* @param out The newly created subtransport
|
530
|
-
* @param owner The smart transport to own this subtransport
|
531
|
-
* @return 0 or an error code
|
532
|
-
*/
|
533
|
-
GIT_EXTERN(int) git_smart_subtransport_ssh(
|
534
|
-
git_smart_subtransport **out,
|
535
|
-
git_transport* owner);
|
536
|
-
|
537
|
-
/*
|
538
|
-
*** End interface for subtransports for the smart transport ***
|
539
|
-
*/
|
540
|
-
|
541
248
|
/** @} */
|
542
249
|
GIT_END_DECL
|
543
250
|
#endif
|
@@ -198,12 +198,12 @@ typedef enum {
|
|
198
198
|
|
199
199
|
/** Valid modes for index and tree entries. */
|
200
200
|
typedef enum {
|
201
|
-
|
202
|
-
GIT_FILEMODE_TREE
|
203
|
-
GIT_FILEMODE_BLOB
|
204
|
-
GIT_FILEMODE_BLOB_EXECUTABLE
|
205
|
-
GIT_FILEMODE_LINK
|
206
|
-
GIT_FILEMODE_COMMIT
|
201
|
+
GIT_FILEMODE_UNREADABLE = 0000000,
|
202
|
+
GIT_FILEMODE_TREE = 0040000,
|
203
|
+
GIT_FILEMODE_BLOB = 0100644,
|
204
|
+
GIT_FILEMODE_BLOB_EXECUTABLE = 0100755,
|
205
|
+
GIT_FILEMODE_LINK = 0120000,
|
206
|
+
GIT_FILEMODE_COMMIT = 0160000,
|
207
207
|
} git_filemode_t;
|
208
208
|
|
209
209
|
typedef struct git_refspec git_refspec;
|
@@ -243,6 +243,16 @@ typedef struct git_transfer_progress {
|
|
243
243
|
*/
|
244
244
|
typedef int (*git_transfer_progress_cb)(const git_transfer_progress *stats, void *payload);
|
245
245
|
|
246
|
+
/**
|
247
|
+
* Type for messages delivered by the transport. Return a negative value
|
248
|
+
* to cancel the network operation.
|
249
|
+
*
|
250
|
+
* @param str The message from the transport
|
251
|
+
* @param len The length of the message
|
252
|
+
* @param payload Payload provided by the caller
|
253
|
+
*/
|
254
|
+
typedef int (*git_transport_message_cb)(const char *str, int len, void *payload);
|
255
|
+
|
246
256
|
/**
|
247
257
|
* Opaque structure representing a submodule.
|
248
258
|
*/
|
data/vendor/libgit2/src/array.h
CHANGED
@@ -44,7 +44,7 @@ typedef git_array_t(char) git_array_generic_t;
|
|
44
44
|
/* use a generic array for growth so this can return the new item */
|
45
45
|
GIT_INLINE(void *) git_array_grow(void *_a, size_t item_size)
|
46
46
|
{
|
47
|
-
git_array_generic_t *a = _a;
|
47
|
+
volatile git_array_generic_t *a = _a;
|
48
48
|
uint32_t new_size = (a->size < 8) ? 8 : a->asize * 3 / 2;
|
49
49
|
char *new_array = git__realloc(a->ptr, new_size * item_size);
|
50
50
|
if (!new_array) {
|