rugged 0.17.0.b7 → 0.18.0.b1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/README.md +88 -32
- data/ext/rugged/extconf.rb +4 -2
- data/ext/rugged/rugged.c +72 -10
- data/ext/rugged/rugged.h +14 -10
- data/ext/rugged/rugged_blob.c +8 -10
- data/ext/rugged/rugged_branch.c +11 -14
- data/ext/rugged/rugged_commit.c +31 -24
- data/ext/rugged/rugged_config.c +2 -2
- data/ext/rugged/rugged_index.c +133 -198
- data/ext/rugged/rugged_note.c +372 -0
- data/ext/rugged/rugged_object.c +50 -22
- data/ext/rugged/rugged_reference.c +122 -130
- data/ext/rugged/rugged_remote.c +72 -29
- data/ext/rugged/rugged_repo.c +402 -20
- data/ext/rugged/rugged_revwalk.c +7 -3
- data/ext/rugged/rugged_settings.c +110 -0
- data/ext/rugged/rugged_signature.c +23 -7
- data/ext/rugged/rugged_tag.c +32 -16
- data/ext/rugged/rugged_tree.c +44 -15
- data/lib/rugged.rb +1 -0
- data/lib/rugged/index.rb +8 -0
- data/lib/rugged/remote.rb +13 -0
- data/lib/rugged/repository.rb +3 -3
- data/lib/rugged/version.rb +1 -1
- data/test/blob_test.rb +13 -15
- data/test/branch_test.rb +32 -67
- data/test/commit_test.rb +50 -12
- data/test/config_test.rb +12 -11
- data/test/coverage/HEAD.json +1 -1
- data/test/coverage/cover.rb +40 -21
- data/test/errors_test.rb +34 -0
- data/test/fixtures/alternate/objects/14/6ae76773c91e3b1d00cf7a338ec55ae58297e2 +0 -0
- data/test/fixtures/alternate/objects/14/9c32d47e99d0a3572ff1e70a2e0051bbf347a9 +0 -0
- data/test/fixtures/alternate/objects/14/fb3108588f9421bf764041e5e3ac305eb6277f +0 -0
- data/test/fixtures/testrepo.git/logs/refs/notes/commits +1 -0
- data/test/fixtures/testrepo.git/objects/44/1034f860c1d5d90e4188d11ae0d325176869a8 +1 -0
- data/test/fixtures/testrepo.git/objects/60/d415052a33de2150bf68757f6461df4f563ae4 +0 -0
- data/test/fixtures/testrepo.git/objects/68/8a8f4ef7496901d15322972f96e212a9e466cc +1 -0
- data/test/fixtures/testrepo.git/objects/94/eca2de348d5f672faf56b0decafa5937e3235e +0 -0
- data/test/fixtures/testrepo.git/objects/9b/7384fe1676186192842f5d3e129457b62db9e3 +0 -0
- data/test/fixtures/testrepo.git/objects/b7/4713326bc972cc15751ed504dca6f6f3b91f7a +3 -0
- data/test/fixtures/testrepo.git/refs/notes/commits +1 -0
- data/test/index_test.rb +65 -69
- data/test/lib_test.rb +76 -11
- data/test/note_test.rb +158 -0
- data/test/object_test.rb +8 -11
- data/test/reference_test.rb +77 -85
- data/test/remote_test.rb +86 -8
- data/test/repo_pack_test.rb +9 -7
- data/test/repo_reset_test.rb +80 -0
- data/test/repo_test.rb +176 -53
- data/test/tag_test.rb +44 -7
- data/test/test_helper.rb +63 -35
- data/test/tree_test.rb +34 -13
- data/test/walker_test.rb +14 -14
- data/vendor/libgit2/Makefile.embed +1 -1
- data/vendor/libgit2/deps/http-parser/http_parser.c +974 -578
- data/vendor/libgit2/deps/http-parser/http_parser.h +106 -70
- data/vendor/libgit2/deps/regex/regcomp.c +7 -6
- data/vendor/libgit2/deps/regex/regex_internal.c +1 -1
- data/vendor/libgit2/deps/regex/regex_internal.h +12 -3
- data/vendor/libgit2/deps/regex/regexec.c +5 -5
- data/vendor/libgit2/include/git2.h +5 -1
- data/vendor/libgit2/include/git2/attr.h +4 -2
- data/vendor/libgit2/include/git2/blob.h +39 -12
- data/vendor/libgit2/include/git2/branch.h +123 -35
- data/vendor/libgit2/include/git2/checkout.h +206 -48
- data/vendor/libgit2/include/git2/clone.h +72 -27
- data/vendor/libgit2/include/git2/commit.h +20 -17
- data/vendor/libgit2/include/git2/common.h +67 -1
- data/vendor/libgit2/include/git2/config.h +81 -60
- data/vendor/libgit2/include/git2/cred_helpers.h +53 -0
- data/vendor/libgit2/include/git2/diff.h +459 -150
- data/vendor/libgit2/include/git2/errors.h +9 -1
- data/vendor/libgit2/include/git2/graph.h +41 -0
- data/vendor/libgit2/include/git2/ignore.h +7 -6
- data/vendor/libgit2/include/git2/index.h +323 -97
- data/vendor/libgit2/include/git2/indexer.h +27 -59
- data/vendor/libgit2/include/git2/inttypes.h +4 -0
- data/vendor/libgit2/include/git2/merge.h +13 -3
- data/vendor/libgit2/include/git2/message.h +14 -8
- data/vendor/libgit2/include/git2/net.h +9 -7
- data/vendor/libgit2/include/git2/notes.h +88 -29
- data/vendor/libgit2/include/git2/object.h +16 -6
- data/vendor/libgit2/include/git2/odb.h +80 -17
- data/vendor/libgit2/include/git2/odb_backend.h +47 -11
- data/vendor/libgit2/include/git2/oid.h +26 -17
- data/vendor/libgit2/include/git2/pack.h +62 -8
- data/vendor/libgit2/include/git2/push.h +131 -0
- data/vendor/libgit2/include/git2/refdb.h +103 -0
- data/vendor/libgit2/include/git2/refdb_backend.h +109 -0
- data/vendor/libgit2/include/git2/reflog.h +30 -21
- data/vendor/libgit2/include/git2/refs.h +215 -193
- data/vendor/libgit2/include/git2/refspec.h +22 -2
- data/vendor/libgit2/include/git2/remote.h +158 -37
- data/vendor/libgit2/include/git2/repository.h +150 -31
- data/vendor/libgit2/include/git2/reset.h +43 -9
- data/vendor/libgit2/include/git2/revparse.h +48 -4
- data/vendor/libgit2/include/git2/revwalk.h +25 -10
- data/vendor/libgit2/include/git2/signature.h +20 -12
- data/vendor/libgit2/include/git2/stash.h +121 -0
- data/vendor/libgit2/include/git2/status.h +122 -53
- data/vendor/libgit2/include/git2/strarray.h +17 -11
- data/vendor/libgit2/include/git2/submodule.h +42 -7
- data/vendor/libgit2/include/git2/tag.h +72 -59
- data/vendor/libgit2/include/git2/threads.h +4 -2
- data/vendor/libgit2/include/git2/trace.h +68 -0
- data/vendor/libgit2/include/git2/transport.h +328 -0
- data/vendor/libgit2/include/git2/tree.h +149 -120
- data/vendor/libgit2/include/git2/types.h +13 -12
- data/vendor/libgit2/include/git2/version.h +3 -3
- data/vendor/libgit2/src/amiga/map.c +2 -2
- data/vendor/libgit2/src/attr.c +58 -48
- data/vendor/libgit2/src/attr.h +4 -18
- data/vendor/libgit2/src/attr_file.c +30 -6
- data/vendor/libgit2/src/attr_file.h +6 -8
- data/vendor/libgit2/src/attrcache.h +24 -0
- data/vendor/libgit2/src/blob.c +30 -7
- data/vendor/libgit2/src/blob.h +1 -1
- data/vendor/libgit2/src/branch.c +361 -68
- data/vendor/libgit2/src/branch.h +17 -0
- data/vendor/libgit2/src/bswap.h +1 -1
- data/vendor/libgit2/src/buf_text.c +291 -0
- data/vendor/libgit2/src/buf_text.h +122 -0
- data/vendor/libgit2/src/buffer.c +27 -101
- data/vendor/libgit2/src/buffer.h +54 -39
- data/vendor/libgit2/src/cache.c +15 -6
- data/vendor/libgit2/src/cache.h +1 -1
- data/vendor/libgit2/src/cc-compat.h +3 -1
- data/vendor/libgit2/src/checkout.c +1165 -222
- data/vendor/libgit2/src/checkout.h +24 -0
- data/vendor/libgit2/src/clone.c +171 -86
- data/vendor/libgit2/src/commit.c +44 -45
- data/vendor/libgit2/src/commit.h +3 -3
- data/vendor/libgit2/src/commit_list.c +194 -0
- data/vendor/libgit2/src/commit_list.h +49 -0
- data/vendor/libgit2/src/common.h +44 -10
- data/vendor/libgit2/src/compress.c +1 -1
- data/vendor/libgit2/src/compress.h +1 -1
- data/vendor/libgit2/src/config.c +211 -124
- data/vendor/libgit2/src/config.h +23 -4
- data/vendor/libgit2/src/config_cache.c +2 -2
- data/vendor/libgit2/src/config_file.c +129 -53
- data/vendor/libgit2/src/config_file.h +10 -8
- data/vendor/libgit2/src/crlf.c +66 -67
- data/vendor/libgit2/src/date.c +12 -12
- data/vendor/libgit2/src/delta-apply.c +14 -1
- data/vendor/libgit2/src/delta-apply.h +18 -1
- data/vendor/libgit2/src/delta.c +40 -107
- data/vendor/libgit2/src/delta.h +19 -17
- data/vendor/libgit2/src/diff.c +347 -496
- data/vendor/libgit2/src/diff.h +27 -1
- data/vendor/libgit2/src/diff_output.c +564 -249
- data/vendor/libgit2/src/diff_output.h +15 -8
- data/vendor/libgit2/src/diff_tform.c +687 -0
- data/vendor/libgit2/src/errors.c +27 -36
- data/vendor/libgit2/src/fetch.c +13 -351
- data/vendor/libgit2/src/fetch.h +13 -3
- data/vendor/libgit2/src/fetchhead.c +295 -0
- data/vendor/libgit2/src/fetchhead.h +34 -0
- data/vendor/libgit2/src/filebuf.c +42 -15
- data/vendor/libgit2/src/filebuf.h +4 -2
- data/vendor/libgit2/src/fileops.c +466 -113
- data/vendor/libgit2/src/fileops.h +154 -28
- data/vendor/libgit2/src/filter.c +3 -75
- data/vendor/libgit2/src/filter.h +1 -29
- data/vendor/libgit2/src/fnmatch.c +1 -1
- data/vendor/libgit2/src/fnmatch.h +1 -1
- data/vendor/libgit2/src/global.c +54 -10
- data/vendor/libgit2/src/global.h +10 -1
- data/vendor/libgit2/src/graph.c +178 -0
- data/vendor/libgit2/src/hash.c +25 -52
- data/vendor/libgit2/src/hash.h +21 -9
- data/vendor/libgit2/src/{sha1/sha1.c → hash/hash_generic.c} +20 -12
- data/vendor/libgit2/src/hash/hash_generic.h +24 -0
- data/vendor/libgit2/src/hash/hash_openssl.h +45 -0
- data/vendor/libgit2/src/hash/hash_win32.c +291 -0
- data/vendor/libgit2/src/hash/hash_win32.h +140 -0
- data/vendor/libgit2/src/hashsig.c +368 -0
- data/vendor/libgit2/src/hashsig.h +72 -0
- data/vendor/libgit2/src/ignore.c +22 -15
- data/vendor/libgit2/src/ignore.h +6 -1
- data/vendor/libgit2/src/index.c +770 -171
- data/vendor/libgit2/src/index.h +13 -5
- data/vendor/libgit2/src/indexer.c +286 -431
- data/vendor/libgit2/src/iterator.c +854 -466
- data/vendor/libgit2/src/iterator.h +134 -109
- data/vendor/libgit2/src/map.h +1 -1
- data/vendor/libgit2/src/merge.c +296 -0
- data/vendor/libgit2/src/merge.h +22 -0
- data/vendor/libgit2/src/message.c +1 -1
- data/vendor/libgit2/src/message.h +1 -1
- data/vendor/libgit2/src/mwindow.c +35 -30
- data/vendor/libgit2/src/mwindow.h +2 -2
- data/vendor/libgit2/src/netops.c +162 -98
- data/vendor/libgit2/src/netops.h +50 -15
- data/vendor/libgit2/src/notes.c +109 -58
- data/vendor/libgit2/src/notes.h +2 -1
- data/vendor/libgit2/src/object.c +46 -57
- data/vendor/libgit2/src/object.h +1 -8
- data/vendor/libgit2/src/odb.c +151 -40
- data/vendor/libgit2/src/odb.h +5 -1
- data/vendor/libgit2/src/odb_loose.c +4 -5
- data/vendor/libgit2/src/odb_pack.c +122 -80
- data/vendor/libgit2/src/offmap.h +65 -0
- data/vendor/libgit2/src/oid.c +12 -4
- data/vendor/libgit2/src/oidmap.h +1 -1
- data/vendor/libgit2/src/pack-objects.c +88 -61
- data/vendor/libgit2/src/pack-objects.h +8 -8
- data/vendor/libgit2/src/pack.c +293 -28
- data/vendor/libgit2/src/pack.h +49 -4
- data/vendor/libgit2/src/path.c +103 -14
- data/vendor/libgit2/src/path.h +23 -7
- data/vendor/libgit2/src/pathspec.c +168 -0
- data/vendor/libgit2/src/pathspec.h +40 -0
- data/vendor/libgit2/src/pool.c +29 -4
- data/vendor/libgit2/src/pool.h +8 -1
- data/vendor/libgit2/src/posix.c +26 -27
- data/vendor/libgit2/src/posix.h +2 -3
- data/vendor/libgit2/src/pqueue.c +23 -1
- data/vendor/libgit2/src/pqueue.h +23 -1
- data/vendor/libgit2/src/push.c +653 -0
- data/vendor/libgit2/src/push.h +51 -0
- data/vendor/libgit2/src/refdb.c +185 -0
- data/vendor/libgit2/src/refdb.h +46 -0
- data/vendor/libgit2/src/refdb_fs.c +1024 -0
- data/vendor/libgit2/src/refdb_fs.h +15 -0
- data/vendor/libgit2/src/reflog.c +77 -45
- data/vendor/libgit2/src/reflog.h +1 -3
- data/vendor/libgit2/src/refs.c +366 -1326
- data/vendor/libgit2/src/refs.h +22 -13
- data/vendor/libgit2/src/refspec.c +46 -7
- data/vendor/libgit2/src/refspec.h +11 -1
- data/vendor/libgit2/src/remote.c +758 -120
- data/vendor/libgit2/src/remote.h +10 -5
- data/vendor/libgit2/src/repo_template.h +6 -6
- data/vendor/libgit2/src/repository.c +315 -96
- data/vendor/libgit2/src/repository.h +5 -3
- data/vendor/libgit2/src/reset.c +99 -81
- data/vendor/libgit2/src/revparse.c +157 -84
- data/vendor/libgit2/src/revwalk.c +68 -470
- data/vendor/libgit2/src/revwalk.h +44 -0
- data/vendor/libgit2/src/sha1_lookup.c +1 -1
- data/vendor/libgit2/src/sha1_lookup.h +1 -1
- data/vendor/libgit2/src/signature.c +68 -200
- data/vendor/libgit2/src/signature.h +1 -1
- data/vendor/libgit2/src/stash.c +663 -0
- data/vendor/libgit2/src/status.c +101 -79
- data/vendor/libgit2/src/strmap.h +1 -1
- data/vendor/libgit2/src/submodule.c +67 -51
- data/vendor/libgit2/src/submodule.h +1 -1
- data/vendor/libgit2/src/tag.c +35 -29
- data/vendor/libgit2/src/tag.h +1 -1
- data/vendor/libgit2/src/thread-utils.c +1 -1
- data/vendor/libgit2/src/thread-utils.h +2 -2
- data/vendor/libgit2/src/trace.c +39 -0
- data/vendor/libgit2/src/trace.h +56 -0
- data/vendor/libgit2/src/transport.c +81 -34
- data/vendor/libgit2/src/transports/cred.c +60 -0
- data/vendor/libgit2/src/transports/cred_helpers.c +49 -0
- data/vendor/libgit2/src/transports/git.c +234 -127
- data/vendor/libgit2/src/transports/http.c +761 -433
- data/vendor/libgit2/src/transports/local.c +460 -64
- data/vendor/libgit2/src/transports/smart.c +345 -0
- data/vendor/libgit2/src/transports/smart.h +179 -0
- data/vendor/libgit2/src/{pkt.c → transports/smart_pkt.c} +131 -12
- data/vendor/libgit2/src/transports/smart_protocol.c +856 -0
- data/vendor/libgit2/src/transports/winhttp.c +1136 -0
- data/vendor/libgit2/src/tree-cache.c +2 -2
- data/vendor/libgit2/src/tree-cache.h +1 -1
- data/vendor/libgit2/src/tree.c +239 -166
- data/vendor/libgit2/src/tree.h +11 -2
- data/vendor/libgit2/src/tsort.c +39 -23
- data/vendor/libgit2/src/unix/map.c +1 -1
- data/vendor/libgit2/src/unix/posix.h +12 -2
- data/vendor/libgit2/src/unix/realpath.c +30 -0
- data/vendor/libgit2/src/util.c +250 -13
- data/vendor/libgit2/src/util.h +71 -14
- data/vendor/libgit2/src/vector.c +123 -60
- data/vendor/libgit2/src/vector.h +24 -22
- data/vendor/libgit2/src/win32/dir.c +1 -1
- data/vendor/libgit2/src/win32/dir.h +1 -1
- data/vendor/libgit2/src/win32/error.c +77 -0
- data/vendor/libgit2/src/win32/error.h +13 -0
- data/vendor/libgit2/src/win32/findfile.c +143 -54
- data/vendor/libgit2/src/win32/findfile.h +10 -6
- data/vendor/libgit2/src/win32/map.c +1 -1
- data/vendor/libgit2/src/win32/mingw-compat.h +1 -1
- data/vendor/libgit2/src/win32/msvc-compat.h +10 -1
- data/vendor/libgit2/src/win32/posix.h +10 -1
- data/vendor/libgit2/src/win32/posix_w32.c +132 -63
- data/vendor/libgit2/src/win32/precompiled.c +1 -1
- data/vendor/libgit2/src/win32/pthread.c +1 -1
- data/vendor/libgit2/src/win32/pthread.h +1 -1
- data/vendor/libgit2/src/win32/utf-conv.c +5 -5
- data/vendor/libgit2/src/win32/utf-conv.h +3 -3
- data/vendor/libgit2/src/win32/version.h +20 -0
- metadata +308 -252
- data/test/fixtures/testrepo.git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 +0 -0
- data/test/fixtures/testrepo.git/objects/7f/043268ea43ce18e3540acaabf9e090c91965b0 +0 -0
- data/test/fixtures/testrepo.git/objects/a3/e05719b428a2d0ed7a55c4ce53dcc5768c6d5e +0 -0
- data/test/index_test.rb~ +0 -218
- data/vendor/libgit2/src/pkt.h +0 -91
- data/vendor/libgit2/src/ppc/sha1.c +0 -70
- data/vendor/libgit2/src/ppc/sha1.h +0 -26
- data/vendor/libgit2/src/protocol.c +0 -110
- data/vendor/libgit2/src/protocol.h +0 -21
- data/vendor/libgit2/src/sha1.h +0 -33
- data/vendor/libgit2/src/transport.h +0 -148
@@ -24,16 +24,25 @@
|
|
24
24
|
extern "C" {
|
25
25
|
#endif
|
26
26
|
|
27
|
-
#define HTTP_PARSER_VERSION_MAJOR
|
27
|
+
#define HTTP_PARSER_VERSION_MAJOR 2
|
28
28
|
#define HTTP_PARSER_VERSION_MINOR 0
|
29
29
|
|
30
|
-
#ifdef _MSC_VER
|
31
|
-
/* disable silly warnings */
|
32
|
-
# pragma warning(disable: 4127 4214)
|
33
|
-
#endif
|
34
|
-
|
35
30
|
#include <sys/types.h>
|
36
|
-
#
|
31
|
+
#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)
|
32
|
+
#include <BaseTsd.h>
|
33
|
+
typedef __int8 int8_t;
|
34
|
+
typedef unsigned __int8 uint8_t;
|
35
|
+
typedef __int16 int16_t;
|
36
|
+
typedef unsigned __int16 uint16_t;
|
37
|
+
typedef __int32 int32_t;
|
38
|
+
typedef unsigned __int32 uint32_t;
|
39
|
+
typedef __int64 int64_t;
|
40
|
+
typedef unsigned __int64 uint64_t;
|
41
|
+
typedef SIZE_T size_t;
|
42
|
+
typedef SSIZE_T ssize_t;
|
43
|
+
#else
|
44
|
+
#include <stdint.h>
|
45
|
+
#endif
|
37
46
|
|
38
47
|
/* Compile with -DHTTP_PARSER_STRICT=0 to make less checks, but run
|
39
48
|
* faster
|
@@ -42,21 +51,12 @@ extern "C" {
|
|
42
51
|
# define HTTP_PARSER_STRICT 1
|
43
52
|
#endif
|
44
53
|
|
45
|
-
/* Compile with -DHTTP_PARSER_DEBUG=1 to add extra debugging information to
|
46
|
-
* the error reporting facility.
|
47
|
-
*/
|
48
|
-
#ifndef HTTP_PARSER_DEBUG
|
49
|
-
# define HTTP_PARSER_DEBUG 0
|
50
|
-
#endif
|
51
|
-
|
52
|
-
|
53
54
|
/* Maximium header size allowed */
|
54
55
|
#define HTTP_MAX_HEADER_SIZE (80*1024)
|
55
56
|
|
56
57
|
|
57
58
|
typedef struct http_parser http_parser;
|
58
59
|
typedef struct http_parser_settings http_parser_settings;
|
59
|
-
typedef struct http_parser_result http_parser_result;
|
60
60
|
|
61
61
|
|
62
62
|
/* Callbacks should return non-zero to indicate an error. The parser will
|
@@ -69,7 +69,7 @@ typedef struct http_parser_result http_parser_result;
|
|
69
69
|
* chunked' headers that indicate the presence of a body.
|
70
70
|
*
|
71
71
|
* http_data_cb does not return data chunks. It will be call arbitrarally
|
72
|
-
* many times for each string. E.G. you might get 10 callbacks for "
|
72
|
+
* many times for each string. E.G. you might get 10 callbacks for "on_url"
|
73
73
|
* each providing just a few characters more data.
|
74
74
|
*/
|
75
75
|
typedef int (*http_data_cb) (http_parser*, const char *at, size_t length);
|
@@ -77,36 +77,44 @@ typedef int (*http_cb) (http_parser*);
|
|
77
77
|
|
78
78
|
|
79
79
|
/* Request Methods */
|
80
|
+
#define HTTP_METHOD_MAP(XX) \
|
81
|
+
XX(0, DELETE, DELETE) \
|
82
|
+
XX(1, GET, GET) \
|
83
|
+
XX(2, HEAD, HEAD) \
|
84
|
+
XX(3, POST, POST) \
|
85
|
+
XX(4, PUT, PUT) \
|
86
|
+
/* pathological */ \
|
87
|
+
XX(5, CONNECT, CONNECT) \
|
88
|
+
XX(6, OPTIONS, OPTIONS) \
|
89
|
+
XX(7, TRACE, TRACE) \
|
90
|
+
/* webdav */ \
|
91
|
+
XX(8, COPY, COPY) \
|
92
|
+
XX(9, LOCK, LOCK) \
|
93
|
+
XX(10, MKCOL, MKCOL) \
|
94
|
+
XX(11, MOVE, MOVE) \
|
95
|
+
XX(12, PROPFIND, PROPFIND) \
|
96
|
+
XX(13, PROPPATCH, PROPPATCH) \
|
97
|
+
XX(14, SEARCH, SEARCH) \
|
98
|
+
XX(15, UNLOCK, UNLOCK) \
|
99
|
+
/* subversion */ \
|
100
|
+
XX(16, REPORT, REPORT) \
|
101
|
+
XX(17, MKACTIVITY, MKACTIVITY) \
|
102
|
+
XX(18, CHECKOUT, CHECKOUT) \
|
103
|
+
XX(19, MERGE, MERGE) \
|
104
|
+
/* upnp */ \
|
105
|
+
XX(20, MSEARCH, M-SEARCH) \
|
106
|
+
XX(21, NOTIFY, NOTIFY) \
|
107
|
+
XX(22, SUBSCRIBE, SUBSCRIBE) \
|
108
|
+
XX(23, UNSUBSCRIBE, UNSUBSCRIBE) \
|
109
|
+
/* RFC-5789 */ \
|
110
|
+
XX(24, PATCH, PATCH) \
|
111
|
+
XX(25, PURGE, PURGE) \
|
112
|
+
|
80
113
|
enum http_method
|
81
|
-
{
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
, HTTP_PUT
|
86
|
-
/* pathological */
|
87
|
-
, HTTP_CONNECT
|
88
|
-
, HTTP_OPTIONS
|
89
|
-
, HTTP_TRACE
|
90
|
-
/* webdav */
|
91
|
-
, HTTP_COPY
|
92
|
-
, HTTP_LOCK
|
93
|
-
, HTTP_MKCOL
|
94
|
-
, HTTP_MOVE
|
95
|
-
, HTTP_PROPFIND
|
96
|
-
, HTTP_PROPPATCH
|
97
|
-
, HTTP_UNLOCK
|
98
|
-
/* subversion */
|
99
|
-
, HTTP_REPORT
|
100
|
-
, HTTP_MKACTIVITY
|
101
|
-
, HTTP_CHECKOUT
|
102
|
-
, HTTP_MERGE
|
103
|
-
/* upnp */
|
104
|
-
, HTTP_MSEARCH
|
105
|
-
, HTTP_NOTIFY
|
106
|
-
, HTTP_SUBSCRIBE
|
107
|
-
, HTTP_UNSUBSCRIBE
|
108
|
-
/* RFC-5789 */
|
109
|
-
, HTTP_PATCH
|
114
|
+
{
|
115
|
+
#define XX(num, name, string) HTTP_##name = num,
|
116
|
+
HTTP_METHOD_MAP(XX)
|
117
|
+
#undef XX
|
110
118
|
};
|
111
119
|
|
112
120
|
|
@@ -134,10 +142,7 @@ enum flags
|
|
134
142
|
\
|
135
143
|
/* Callback-related errors */ \
|
136
144
|
XX(CB_message_begin, "the on_message_begin callback failed") \
|
137
|
-
XX(CB_path, "the on_path callback failed") \
|
138
|
-
XX(CB_query_string, "the on_query_string callback failed") \
|
139
145
|
XX(CB_url, "the on_url callback failed") \
|
140
|
-
XX(CB_fragment, "the on_fragment callback failed") \
|
141
146
|
XX(CB_header_field, "the on_header_field callback failed") \
|
142
147
|
XX(CB_header_value, "the on_header_value callback failed") \
|
143
148
|
XX(CB_headers_complete, "the on_headers_complete callback failed") \
|
@@ -168,6 +173,7 @@ enum flags
|
|
168
173
|
XX(INVALID_CONSTANT, "invalid constant string") \
|
169
174
|
XX(INVALID_INTERNAL_STATE, "encountered unexpected internal state")\
|
170
175
|
XX(STRICT, "strict mode assertion failed") \
|
176
|
+
XX(PAUSED, "parser is paused") \
|
171
177
|
XX(UNKNOWN, "an unknown error occurred")
|
172
178
|
|
173
179
|
|
@@ -182,30 +188,23 @@ enum http_errno {
|
|
182
188
|
/* Get an http_errno value from an http_parser */
|
183
189
|
#define HTTP_PARSER_ERRNO(p) ((enum http_errno) (p)->http_errno)
|
184
190
|
|
185
|
-
/* Get the line number that generated the current error */
|
186
|
-
#if HTTP_PARSER_DEBUG
|
187
|
-
#define HTTP_PARSER_ERRNO_LINE(p) ((p)->error_lineno)
|
188
|
-
#else
|
189
|
-
#define HTTP_PARSER_ERRNO_LINE(p) 0
|
190
|
-
#endif
|
191
|
-
|
192
191
|
|
193
192
|
struct http_parser {
|
194
193
|
/** PRIVATE **/
|
195
|
-
unsigned char type : 2;
|
196
|
-
unsigned char flags : 6;
|
197
|
-
unsigned char state;
|
198
|
-
unsigned char header_state;
|
199
|
-
unsigned char index;
|
194
|
+
unsigned char type : 2; /* enum http_parser_type */
|
195
|
+
unsigned char flags : 6; /* F_* values from 'flags' enum; semi-public */
|
196
|
+
unsigned char state; /* enum state from http_parser.c */
|
197
|
+
unsigned char header_state; /* enum header_state from http_parser.c */
|
198
|
+
unsigned char index; /* index into current matcher */
|
200
199
|
|
201
|
-
|
202
|
-
|
200
|
+
uint32_t nread; /* # bytes read in various scenarios */
|
201
|
+
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */
|
203
202
|
|
204
203
|
/** READ-ONLY **/
|
205
204
|
unsigned short http_major;
|
206
205
|
unsigned short http_minor;
|
207
206
|
unsigned short status_code; /* responses only */
|
208
|
-
unsigned char method;
|
207
|
+
unsigned char method; /* requests only */
|
209
208
|
unsigned char http_errno : 7;
|
210
209
|
|
211
210
|
/* 1 = Upgrade header was present and the parser has exited because of that.
|
@@ -215,10 +214,6 @@ struct http_parser {
|
|
215
214
|
*/
|
216
215
|
unsigned char upgrade : 1;
|
217
216
|
|
218
|
-
#if HTTP_PARSER_DEBUG
|
219
|
-
uint32_t error_lineno;
|
220
|
-
#endif
|
221
|
-
|
222
217
|
/** PUBLIC **/
|
223
218
|
void *data; /* A pointer to get hook to the "connection" or "socket" object */
|
224
219
|
};
|
@@ -235,6 +230,36 @@ struct http_parser_settings {
|
|
235
230
|
};
|
236
231
|
|
237
232
|
|
233
|
+
enum http_parser_url_fields
|
234
|
+
{ UF_SCHEMA = 0
|
235
|
+
, UF_HOST = 1
|
236
|
+
, UF_PORT = 2
|
237
|
+
, UF_PATH = 3
|
238
|
+
, UF_QUERY = 4
|
239
|
+
, UF_FRAGMENT = 5
|
240
|
+
, UF_USERINFO = 6
|
241
|
+
, UF_MAX = 7
|
242
|
+
};
|
243
|
+
|
244
|
+
|
245
|
+
/* Result structure for http_parser_parse_url().
|
246
|
+
*
|
247
|
+
* Callers should index into field_data[] with UF_* values iff field_set
|
248
|
+
* has the relevant (1 << UF_*) bit set. As a courtesy to clients (and
|
249
|
+
* because we probably have padding left over), we convert any port to
|
250
|
+
* a uint16_t.
|
251
|
+
*/
|
252
|
+
struct http_parser_url {
|
253
|
+
uint16_t field_set; /* Bitmask of (1 << UF_*) values */
|
254
|
+
uint16_t port; /* Converted UF_PORT string */
|
255
|
+
|
256
|
+
struct {
|
257
|
+
uint16_t off; /* Offset into buffer in which field starts */
|
258
|
+
uint16_t len; /* Length of run in buffer */
|
259
|
+
} field_data[UF_MAX];
|
260
|
+
};
|
261
|
+
|
262
|
+
|
238
263
|
void http_parser_init(http_parser *parser, enum http_parser_type type);
|
239
264
|
|
240
265
|
|
@@ -245,12 +270,12 @@ size_t http_parser_execute(http_parser *parser,
|
|
245
270
|
|
246
271
|
|
247
272
|
/* If http_should_keep_alive() in the on_headers_complete or
|
248
|
-
* on_message_complete callback returns
|
273
|
+
* on_message_complete callback returns 0, then this should be
|
249
274
|
* the last message on the connection.
|
250
275
|
* If you are the server, respond with the "Connection: close" header.
|
251
276
|
* If you are the client, close the connection.
|
252
277
|
*/
|
253
|
-
int http_should_keep_alive(http_parser *parser);
|
278
|
+
int http_should_keep_alive(const http_parser *parser);
|
254
279
|
|
255
280
|
/* Returns a string version of the HTTP method. */
|
256
281
|
const char *http_method_str(enum http_method m);
|
@@ -261,6 +286,17 @@ const char *http_errno_name(enum http_errno err);
|
|
261
286
|
/* Return a string description of the given error */
|
262
287
|
const char *http_errno_description(enum http_errno err);
|
263
288
|
|
289
|
+
/* Parse a URL; return nonzero on failure */
|
290
|
+
int http_parser_parse_url(const char *buf, size_t buflen,
|
291
|
+
int is_connect,
|
292
|
+
struct http_parser_url *u);
|
293
|
+
|
294
|
+
/* Pause or un-pause the parser; a nonzero value pauses */
|
295
|
+
void http_parser_pause(http_parser *parser, int paused);
|
296
|
+
|
297
|
+
/* Checks if this is the final chunk of the body. */
|
298
|
+
int http_body_is_final(const http_parser *parser);
|
299
|
+
|
264
300
|
#ifdef __cplusplus
|
265
301
|
}
|
266
302
|
#endif
|
@@ -542,7 +542,7 @@ weak_alias (__regcomp, regcomp)
|
|
542
542
|
from either regcomp or regexec. We don't use PREG here. */
|
543
543
|
|
544
544
|
size_t
|
545
|
-
regerror(int errcode, const regex_t *__restrict preg,
|
545
|
+
regerror(int errcode, UNUSED const regex_t *__restrict preg,
|
546
546
|
char *__restrict errbuf, size_t errbuf_size)
|
547
547
|
{
|
548
548
|
const char *msg;
|
@@ -1140,7 +1140,7 @@ analyze (regex_t *preg)
|
|
1140
1140
|
dfa->subexp_map[i] = i;
|
1141
1141
|
preorder (dfa->str_tree, optimize_subexps, dfa);
|
1142
1142
|
for (i = 0; i < preg->re_nsub; i++)
|
1143
|
-
if (dfa->subexp_map[i] != i)
|
1143
|
+
if (dfa->subexp_map[i] != (int)i)
|
1144
1144
|
break;
|
1145
1145
|
if (i == preg->re_nsub)
|
1146
1146
|
{
|
@@ -1358,7 +1358,7 @@ calc_first (void *extra, bin_tree_t *node)
|
|
1358
1358
|
|
1359
1359
|
/* Pass 2: compute NEXT on the tree. Preorder visit. */
|
1360
1360
|
static reg_errcode_t
|
1361
|
-
calc_next (void *extra, bin_tree_t *node)
|
1361
|
+
calc_next (UNUSED void *extra, bin_tree_t *node)
|
1362
1362
|
{
|
1363
1363
|
switch (node->token.type)
|
1364
1364
|
{
|
@@ -1609,7 +1609,8 @@ calc_inveclosure (re_dfa_t *dfa)
|
|
1609
1609
|
static reg_errcode_t
|
1610
1610
|
calc_eclosure (re_dfa_t *dfa)
|
1611
1611
|
{
|
1612
|
-
|
1612
|
+
size_t node_idx;
|
1613
|
+
int incomplete;
|
1613
1614
|
#ifdef DEBUG
|
1614
1615
|
assert (dfa->nodes_len > 0);
|
1615
1616
|
#endif
|
@@ -3308,7 +3309,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
|
|
3308
3309
|
|
3309
3310
|
static reg_errcode_t
|
3310
3311
|
parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp,
|
3311
|
-
re_token_t *token, int token_len, re_dfa_t *dfa,
|
3312
|
+
re_token_t *token, int token_len, UNUSED re_dfa_t *dfa,
|
3312
3313
|
reg_syntax_t syntax, int accept_hyphen)
|
3313
3314
|
{
|
3314
3315
|
#ifdef RE_ENABLE_I18N
|
@@ -3803,7 +3804,7 @@ free_token (re_token_t *node)
|
|
3803
3804
|
and its children. */
|
3804
3805
|
|
3805
3806
|
static reg_errcode_t
|
3806
|
-
free_tree (void *extra, bin_tree_t *node)
|
3807
|
+
free_tree (UNUSED void *extra, bin_tree_t *node)
|
3807
3808
|
{
|
3808
3809
|
free_token (&node->token);
|
3809
3810
|
return REG_NOERROR;
|
@@ -27,6 +27,14 @@
|
|
27
27
|
#include <stdlib.h>
|
28
28
|
#include <string.h>
|
29
29
|
|
30
|
+
#ifndef UNUSED
|
31
|
+
# ifdef __GNUC__
|
32
|
+
# define UNUSED __attribute__((unused))
|
33
|
+
# else
|
34
|
+
# define UNUSED
|
35
|
+
# endif
|
36
|
+
#endif
|
37
|
+
|
30
38
|
#if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC
|
31
39
|
# include <langinfo.h>
|
32
40
|
#endif
|
@@ -63,7 +71,7 @@
|
|
63
71
|
#endif
|
64
72
|
#else /* GAWK */
|
65
73
|
/*
|
66
|
-
* This is a
|
74
|
+
* This is a mess. On glibc systems you have to define
|
67
75
|
* a magic constant to get isblank() out of <ctype.h>, since it's
|
68
76
|
* a C99 function. To heck with all that and borrow a page from
|
69
77
|
* dfa.c's book.
|
@@ -171,8 +179,9 @@ extern const size_t __re_error_msgid_idx[] attribute_hidden;
|
|
171
179
|
typedef unsigned long int bitset_word_t;
|
172
180
|
/* All bits set in a bitset_word_t. */
|
173
181
|
#define BITSET_WORD_MAX ULONG_MAX
|
174
|
-
/* Number of bits in a bitset_word_t.
|
175
|
-
|
182
|
+
/* Number of bits in a bitset_word_t. Cast to int as most code use it
|
183
|
+
* like that for counting */
|
184
|
+
#define BITSET_WORD_BITS ((int)(sizeof (bitset_word_t) * CHAR_BIT))
|
176
185
|
/* Number of bitset_word_t in a bit_set. */
|
177
186
|
#define BITSET_WORDS (SBC_MAX / BITSET_WORD_BITS)
|
178
187
|
typedef bitset_word_t bitset_t[BITSET_WORDS];
|
@@ -689,7 +689,7 @@ re_search_internal (const regex_t *preg,
|
|
689
689
|
if (nmatch > 1 || dfa->has_mb_node)
|
690
690
|
{
|
691
691
|
/* Avoid overflow. */
|
692
|
-
if (BE (SIZE_MAX / sizeof (re_dfastate_t *) <= mctx.input.bufs_len, 0))
|
692
|
+
if (BE (SIZE_MAX / sizeof (re_dfastate_t *) <= (size_t)mctx.input.bufs_len, 0))
|
693
693
|
{
|
694
694
|
err = REG_ESPACE;
|
695
695
|
goto free_return;
|
@@ -920,7 +920,7 @@ re_search_internal (const regex_t *preg,
|
|
920
920
|
|
921
921
|
if (dfa->subexp_map)
|
922
922
|
for (reg_idx = 0; reg_idx + 1 < nmatch; reg_idx++)
|
923
|
-
if (dfa->subexp_map[reg_idx] != reg_idx)
|
923
|
+
if (dfa->subexp_map[reg_idx] != (int)reg_idx)
|
924
924
|
{
|
925
925
|
pmatch[reg_idx + 1].rm_so
|
926
926
|
= pmatch[dfa->subexp_map[reg_idx] + 1].rm_so;
|
@@ -953,7 +953,7 @@ prune_impossible_nodes (re_match_context_t *mctx)
|
|
953
953
|
halt_node = mctx->last_node;
|
954
954
|
|
955
955
|
/* Avoid overflow. */
|
956
|
-
if (BE (SIZE_MAX / sizeof (re_dfastate_t *) <= match_last, 0))
|
956
|
+
if (BE (SIZE_MAX / sizeof (re_dfastate_t *) <= (size_t)match_last, 0))
|
957
957
|
return REG_ESPACE;
|
958
958
|
|
959
959
|
sifted_states = re_malloc (re_dfastate_t *, match_last + 1);
|
@@ -3375,7 +3375,7 @@ build_trtable (const re_dfa_t *dfa, re_dfastate_t *state)
|
|
3375
3375
|
/* Avoid arithmetic overflow in size calculation. */
|
3376
3376
|
if (BE ((((SIZE_MAX - (sizeof (re_node_set) + sizeof (bitset_t)) * SBC_MAX)
|
3377
3377
|
/ (3 * sizeof (re_dfastate_t *)))
|
3378
|
-
< ndests),
|
3378
|
+
< (size_t)ndests),
|
3379
3379
|
0))
|
3380
3380
|
goto out_free;
|
3381
3381
|
|
@@ -4099,7 +4099,7 @@ extend_buffers (re_match_context_t *mctx)
|
|
4099
4099
|
re_string_t *pstr = &mctx->input;
|
4100
4100
|
|
4101
4101
|
/* Avoid overflow. */
|
4102
|
-
if (BE (INT_MAX / 2 / sizeof (re_dfastate_t *) <= pstr->bufs_len, 0))
|
4102
|
+
if (BE (INT_MAX / 2 / sizeof (re_dfastate_t *) <= (size_t)pstr->bufs_len, 0))
|
4103
4103
|
return REG_ESPACE;
|
4104
4104
|
|
4105
4105
|
/* Double the lengthes of the buffers. */
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (C)
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
3
|
*
|
4
4
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
@@ -23,6 +23,7 @@
|
|
23
23
|
#include "git2/repository.h"
|
24
24
|
#include "git2/revwalk.h"
|
25
25
|
#include "git2/merge.h"
|
26
|
+
#include "git2/graph.h"
|
26
27
|
#include "git2/refs.h"
|
27
28
|
#include "git2/reflog.h"
|
28
29
|
#include "git2/revparse.h"
|
@@ -36,9 +37,11 @@
|
|
36
37
|
|
37
38
|
#include "git2/index.h"
|
38
39
|
#include "git2/config.h"
|
40
|
+
#include "git2/transport.h"
|
39
41
|
#include "git2/remote.h"
|
40
42
|
#include "git2/clone.h"
|
41
43
|
#include "git2/checkout.h"
|
44
|
+
#include "git2/push.h"
|
42
45
|
|
43
46
|
#include "git2/attr.h"
|
44
47
|
#include "git2/ignore.h"
|
@@ -52,5 +55,6 @@
|
|
52
55
|
#include "git2/reset.h"
|
53
56
|
#include "git2/message.h"
|
54
57
|
#include "git2/pack.h"
|
58
|
+
#include "git2/stash.h"
|
55
59
|
|
56
60
|
#endif
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (C)
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
3
|
*
|
4
4
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
@@ -183,6 +183,8 @@ GIT_EXTERN(int) git_attr_get_many(
|
|
183
183
|
size_t num_attr,
|
184
184
|
const char **names);
|
185
185
|
|
186
|
+
typedef int (*git_attr_foreach_cb)(const char *name, const char *value, void *payload);
|
187
|
+
|
186
188
|
/**
|
187
189
|
* Loop over all the git attributes for a path.
|
188
190
|
*
|
@@ -204,7 +206,7 @@ GIT_EXTERN(int) git_attr_foreach(
|
|
204
206
|
git_repository *repo,
|
205
207
|
uint32_t flags,
|
206
208
|
const char *path,
|
207
|
-
|
209
|
+
git_attr_foreach_cb callback,
|
208
210
|
void *payload);
|
209
211
|
|
210
212
|
/**
|