rugged 0.26.7 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/ext/rugged/rugged_blame.c +6 -3
- data/ext/rugged/rugged_branch_collection.c +3 -6
- data/ext/rugged/rugged_commit.c +56 -0
- data/ext/rugged/rugged_config.c +44 -9
- data/ext/rugged/rugged_diff.c +3 -14
- data/ext/rugged/rugged_diff_hunk.c +1 -3
- data/ext/rugged/rugged_index.c +1 -5
- data/ext/rugged/rugged_note.c +1 -4
- data/ext/rugged/rugged_patch.c +1 -4
- data/ext/rugged/rugged_reference_collection.c +1 -7
- data/ext/rugged/rugged_remote.c +5 -8
- data/ext/rugged/rugged_remote_collection.c +1 -6
- data/ext/rugged/rugged_repo.c +16 -48
- data/ext/rugged/rugged_revwalk.c +7 -16
- data/ext/rugged/rugged_settings.c +28 -0
- data/ext/rugged/rugged_submodule_collection.c +3 -4
- data/ext/rugged/rugged_tag_collection.c +1 -5
- data/ext/rugged/rugged_tree.c +2 -3
- data/lib/rugged/repository.rb +43 -0
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/AUTHORS +1 -0
- data/vendor/libgit2/CMakeLists.txt +61 -510
- data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +14 -0
- data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +25 -8
- data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +27 -8
- data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +20 -0
- data/vendor/libgit2/cmake/Modules/IdeSplitSources.cmake +22 -0
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +3 -0
- data/vendor/libgit2/deps/regex/CMakeLists.txt +2 -0
- data/vendor/libgit2/deps/winhttp/CMakeLists.txt +26 -0
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +4 -0
- data/vendor/libgit2/include/git2/config.h +29 -2
- data/vendor/libgit2/include/git2/describe.h +1 -1
- data/vendor/libgit2/include/git2/diff.h +59 -8
- data/vendor/libgit2/include/git2/graph.h +3 -0
- data/vendor/libgit2/include/git2/merge.h +6 -0
- data/vendor/libgit2/include/git2/message.h +43 -3
- data/vendor/libgit2/include/git2/notes.h +89 -0
- data/vendor/libgit2/include/git2/odb.h +8 -1
- data/vendor/libgit2/include/git2/patch.h +2 -2
- data/vendor/libgit2/include/git2/pathspec.h +35 -18
- data/vendor/libgit2/include/git2/refs.h +3 -0
- data/vendor/libgit2/include/git2/remote.h +34 -4
- data/vendor/libgit2/include/git2/repository.h +6 -6
- data/vendor/libgit2/include/git2/reset.h +4 -4
- data/vendor/libgit2/include/git2/status.h +4 -0
- data/vendor/libgit2/include/git2/sys/config.h +4 -1
- data/vendor/libgit2/include/git2/sys/odb_backend.h +2 -1
- data/vendor/libgit2/include/git2/tree.h +4 -3
- data/vendor/libgit2/include/git2/types.h +1 -0
- data/vendor/libgit2/include/git2/version.h +4 -4
- data/vendor/libgit2/include/git2/worktree.h +1 -1
- data/vendor/libgit2/src/CMakeLists.txt +463 -0
- data/vendor/libgit2/src/annotated_commit.c +1 -1
- data/vendor/libgit2/src/annotated_commit.h +2 -0
- data/vendor/libgit2/src/apply.c +2 -1
- data/vendor/libgit2/src/apply.h +2 -0
- data/vendor/libgit2/src/attr.c +24 -4
- data/vendor/libgit2/src/attr.h +2 -0
- data/vendor/libgit2/src/attr_file.c +9 -2
- data/vendor/libgit2/src/attr_file.h +2 -0
- data/vendor/libgit2/src/attrcache.c +9 -1
- data/vendor/libgit2/src/attrcache.h +2 -0
- data/vendor/libgit2/src/blame.c +1 -0
- data/vendor/libgit2/src/blame.h +2 -1
- data/vendor/libgit2/src/blame_git.c +1 -0
- data/vendor/libgit2/src/blame_git.h +2 -0
- data/vendor/libgit2/src/blob.c +2 -2
- data/vendor/libgit2/src/blob.h +2 -0
- data/vendor/libgit2/src/branch.c +8 -1
- data/vendor/libgit2/src/branch.h +2 -0
- data/vendor/libgit2/src/buf_text.c +7 -7
- data/vendor/libgit2/src/buf_text.h +3 -3
- data/vendor/libgit2/src/buffer.c +31 -1
- data/vendor/libgit2/src/buffer.h +3 -0
- data/vendor/libgit2/src/cache.c +2 -2
- data/vendor/libgit2/src/cache.h +2 -0
- data/vendor/libgit2/src/cc-compat.h +3 -3
- data/vendor/libgit2/src/checkout.c +30 -19
- data/vendor/libgit2/src/checkout.h +2 -0
- data/vendor/libgit2/src/cherrypick.c +1 -0
- data/vendor/libgit2/src/clone.c +2 -1
- data/vendor/libgit2/src/clone.h +4 -0
- data/vendor/libgit2/src/commit.c +2 -1
- data/vendor/libgit2/src/commit.h +2 -0
- data/vendor/libgit2/src/commit_list.c +1 -1
- data/vendor/libgit2/src/commit_list.h +2 -0
- data/vendor/libgit2/src/common.h +11 -5
- data/vendor/libgit2/src/config.c +12 -10
- data/vendor/libgit2/src/config.h +2 -0
- data/vendor/libgit2/src/config_cache.c +1 -0
- data/vendor/libgit2/src/config_file.c +287 -786
- data/vendor/libgit2/src/config_file.h +4 -3
- data/vendor/libgit2/src/config_parse.c +525 -0
- data/vendor/libgit2/src/config_parse.h +64 -0
- data/vendor/libgit2/src/crlf.c +2 -1
- data/vendor/libgit2/src/delta.c +28 -30
- data/vendor/libgit2/src/delta.h +1 -0
- data/vendor/libgit2/src/describe.c +3 -1
- data/vendor/libgit2/src/diff.c +148 -2
- data/vendor/libgit2/src/diff.h +3 -1
- data/vendor/libgit2/src/diff_driver.c +12 -9
- data/vendor/libgit2/src/diff_driver.h +4 -1
- data/vendor/libgit2/src/diff_file.c +7 -4
- data/vendor/libgit2/src/diff_file.h +1 -0
- data/vendor/libgit2/src/diff_generate.c +6 -3
- data/vendor/libgit2/src/diff_generate.h +6 -1
- data/vendor/libgit2/src/diff_parse.c +5 -4
- data/vendor/libgit2/src/diff_parse.h +2 -0
- data/vendor/libgit2/src/diff_print.c +2 -0
- data/vendor/libgit2/src/diff_stats.c +2 -0
- data/vendor/libgit2/src/diff_tform.c +2 -1
- data/vendor/libgit2/src/diff_tform.h +4 -1
- data/vendor/libgit2/src/diff_xdiff.c +5 -2
- data/vendor/libgit2/src/diff_xdiff.h +2 -0
- data/vendor/libgit2/src/errors.c +2 -0
- data/vendor/libgit2/src/features.h.in +36 -0
- data/vendor/libgit2/src/fetch.c +2 -2
- data/vendor/libgit2/src/fetch.h +4 -0
- data/vendor/libgit2/src/fetchhead.c +3 -3
- data/vendor/libgit2/src/fetchhead.h +3 -0
- data/vendor/libgit2/src/filebuf.c +2 -1
- data/vendor/libgit2/src/filebuf.h +2 -0
- data/vendor/libgit2/src/fileops.c +12 -1
- data/vendor/libgit2/src/fileops.h +7 -1
- data/vendor/libgit2/src/filter.c +2 -1
- data/vendor/libgit2/src/filter.h +1 -0
- data/vendor/libgit2/src/fnmatch.c +2 -2
- data/vendor/libgit2/src/fnmatch.h +3 -4
- data/vendor/libgit2/src/global.c +4 -3
- data/vendor/libgit2/src/global.h +1 -5
- data/vendor/libgit2/src/graph.c +2 -0
- data/vendor/libgit2/src/hash.c +0 -1
- data/vendor/libgit2/src/hash.h +3 -1
- data/vendor/libgit2/src/hash/hash_collisiondetect.h +3 -3
- data/vendor/libgit2/src/hash/hash_common_crypto.h +18 -5
- data/vendor/libgit2/src/hash/hash_generic.c +2 -2
- data/vendor/libgit2/src/hash/hash_generic.h +5 -3
- data/vendor/libgit2/src/hash/hash_openssl.h +3 -3
- data/vendor/libgit2/src/hash/hash_win32.c +57 -14
- data/vendor/libgit2/src/hash/hash_win32.h +4 -3
- data/vendor/libgit2/src/hashsig.c +3 -0
- data/vendor/libgit2/src/ident.c +2 -0
- data/vendor/libgit2/src/idxmap.h +2 -1
- data/vendor/libgit2/src/ignore.c +14 -2
- data/vendor/libgit2/src/ignore.h +2 -0
- data/vendor/libgit2/src/index.c +20 -40
- data/vendor/libgit2/src/index.h +2 -0
- data/vendor/libgit2/src/indexer.c +13 -5
- data/vendor/libgit2/src/indexer.h +5 -1
- data/vendor/libgit2/src/integer.h +1 -1
- data/vendor/libgit2/src/iterator.c +44 -3
- data/vendor/libgit2/src/iterator.h +3 -0
- data/vendor/libgit2/src/map.h +1 -1
- data/vendor/libgit2/src/merge.c +155 -33
- data/vendor/libgit2/src/merge.h +2 -0
- data/vendor/libgit2/src/merge_driver.c +2 -2
- data/vendor/libgit2/src/merge_driver.h +2 -0
- data/vendor/libgit2/src/merge_file.c +3 -0
- data/vendor/libgit2/src/message.h +3 -1
- data/vendor/libgit2/src/mwindow.c +1 -1
- data/vendor/libgit2/src/mwindow.h +2 -0
- data/vendor/libgit2/src/netops.c +75 -62
- data/vendor/libgit2/src/netops.h +2 -1
- data/vendor/libgit2/src/notes.c +164 -48
- data/vendor/libgit2/src/notes.h +1 -1
- data/vendor/libgit2/src/object.c +14 -3
- data/vendor/libgit2/src/object.h +4 -0
- data/vendor/libgit2/src/object_api.c +3 -2
- data/vendor/libgit2/src/odb.c +104 -38
- data/vendor/libgit2/src/odb.h +3 -1
- data/vendor/libgit2/src/odb_loose.c +414 -267
- data/vendor/libgit2/src/odb_mempack.c +1 -0
- data/vendor/libgit2/src/odb_pack.c +2 -1
- data/vendor/libgit2/src/offmap.h +1 -0
- data/vendor/libgit2/src/oid.c +2 -1
- data/vendor/libgit2/src/oid.h +3 -8
- data/vendor/libgit2/src/oidarray.c +2 -1
- data/vendor/libgit2/src/oidarray.h +1 -0
- data/vendor/libgit2/src/oidmap.h +1 -0
- data/vendor/libgit2/src/pack-objects.c +5 -1
- data/vendor/libgit2/src/pack-objects.h +1 -1
- data/vendor/libgit2/src/pack.c +2 -6
- data/vendor/libgit2/src/pack.h +2 -1
- data/vendor/libgit2/src/parse.c +121 -0
- data/vendor/libgit2/src/parse.h +61 -0
- data/vendor/libgit2/src/patch.c +9 -2
- data/vendor/libgit2/src/patch.h +2 -0
- data/vendor/libgit2/src/patch_generate.c +6 -5
- data/vendor/libgit2/src/patch_generate.h +1 -0
- data/vendor/libgit2/src/patch_parse.c +265 -276
- data/vendor/libgit2/src/patch_parse.h +6 -11
- data/vendor/libgit2/src/path.c +24 -181
- data/vendor/libgit2/src/path.h +14 -73
- data/vendor/libgit2/src/pathspec.c +2 -1
- data/vendor/libgit2/src/pathspec.h +2 -1
- data/vendor/libgit2/src/pool.c +8 -0
- data/vendor/libgit2/src/pool.h +1 -0
- data/vendor/libgit2/src/posix.c +2 -1
- data/vendor/libgit2/src/posix.h +1 -0
- data/vendor/libgit2/src/pqueue.c +1 -0
- data/vendor/libgit2/src/pqueue.h +2 -0
- data/vendor/libgit2/src/proxy.c +2 -1
- data/vendor/libgit2/src/proxy.h +3 -1
- data/vendor/libgit2/src/push.c +4 -171
- data/vendor/libgit2/src/push.h +2 -0
- data/vendor/libgit2/src/rebase.c +1 -0
- data/vendor/libgit2/src/refdb.c +2 -3
- data/vendor/libgit2/src/refdb.h +2 -0
- data/vendor/libgit2/src/refdb_fs.c +5 -3
- data/vendor/libgit2/src/refdb_fs.h +4 -0
- data/vendor/libgit2/src/reflog.c +1 -0
- data/vendor/libgit2/src/reflog.h +2 -1
- data/vendor/libgit2/src/refs.c +1 -0
- data/vendor/libgit2/src/refs.h +2 -1
- data/vendor/libgit2/src/refspec.c +2 -2
- data/vendor/libgit2/src/refspec.h +2 -0
- data/vendor/libgit2/src/remote.c +56 -10
- data/vendor/libgit2/src/remote.h +2 -0
- data/vendor/libgit2/src/repository.c +16 -14
- data/vendor/libgit2/src/repository.h +2 -0
- data/vendor/libgit2/src/reset.c +6 -5
- data/vendor/libgit2/src/revert.c +1 -0
- data/vendor/libgit2/src/revparse.c +3 -5
- data/vendor/libgit2/src/revwalk.c +2 -2
- data/vendor/libgit2/src/revwalk.h +2 -0
- data/vendor/libgit2/src/settings.c +6 -8
- data/vendor/libgit2/src/sha1_lookup.c +2 -216
- data/vendor/libgit2/src/sha1_lookup.h +2 -6
- data/vendor/libgit2/src/signature.c +8 -3
- data/vendor/libgit2/src/signature.h +2 -0
- data/vendor/libgit2/src/sortedcache.c +7 -0
- data/vendor/libgit2/src/sortedcache.h +2 -0
- data/vendor/libgit2/src/stash.c +1 -0
- data/vendor/libgit2/src/status.c +14 -9
- data/vendor/libgit2/src/status.h +2 -0
- data/vendor/libgit2/src/{curl_stream.c → streams/curl.c} +2 -0
- data/vendor/libgit2/src/{curl_stream.h → streams/curl.h} +4 -2
- data/vendor/libgit2/src/{openssl_stream.c → streams/openssl.c} +47 -18
- data/vendor/libgit2/src/{openssl_stream.h → streams/openssl.h} +6 -2
- data/vendor/libgit2/src/{socket_stream.c → streams/socket.c} +2 -2
- data/vendor/libgit2/src/{socket_stream.h → streams/socket.h} +4 -2
- data/vendor/libgit2/src/{stransport_stream.c → streams/stransport.c} +4 -2
- data/vendor/libgit2/src/{stransport_stream.h → streams/stransport.h} +4 -2
- data/vendor/libgit2/src/{tls_stream.c → streams/tls.c} +4 -3
- data/vendor/libgit2/src/{tls_stream.h → streams/tls.h} +4 -2
- data/vendor/libgit2/src/submodule.c +28 -80
- data/vendor/libgit2/src/submodule.h +2 -13
- data/vendor/libgit2/src/sysdir.c +75 -8
- data/vendor/libgit2/src/sysdir.h +2 -1
- data/vendor/libgit2/src/tag.c +2 -2
- data/vendor/libgit2/src/tag.h +2 -0
- data/vendor/libgit2/src/thread-utils.c +1 -0
- data/vendor/libgit2/src/thread-utils.h +1 -1
- data/vendor/libgit2/src/trace.c +2 -2
- data/vendor/libgit2/src/trace.h +2 -0
- data/vendor/libgit2/src/trailer.c +416 -0
- data/vendor/libgit2/src/transaction.c +2 -1
- data/vendor/libgit2/src/transport.c +2 -0
- data/vendor/libgit2/src/transports/auth.c +2 -1
- data/vendor/libgit2/src/transports/auth.h +4 -3
- data/vendor/libgit2/src/transports/auth_negotiate.c +2 -1
- data/vendor/libgit2/src/transports/auth_negotiate.h +3 -3
- data/vendor/libgit2/src/transports/cred.c +2 -0
- data/vendor/libgit2/src/transports/cred.h +4 -2
- data/vendor/libgit2/src/transports/cred_helpers.c +1 -0
- data/vendor/libgit2/src/transports/git.c +3 -1
- data/vendor/libgit2/src/transports/http.c +10 -14
- data/vendor/libgit2/src/transports/http.h +23 -0
- data/vendor/libgit2/src/transports/local.c +23 -5
- data/vendor/libgit2/src/transports/smart.c +3 -1
- data/vendor/libgit2/src/transports/smart.h +23 -16
- data/vendor/libgit2/src/transports/smart_pkt.c +114 -130
- data/vendor/libgit2/src/transports/smart_protocol.c +26 -22
- data/vendor/libgit2/src/transports/ssh.c +12 -7
- data/vendor/libgit2/src/transports/ssh.h +4 -2
- data/vendor/libgit2/src/transports/winhttp.c +19 -21
- data/vendor/libgit2/src/tree-cache.c +1 -0
- data/vendor/libgit2/src/tree-cache.h +1 -0
- data/vendor/libgit2/src/tree.c +20 -14
- data/vendor/libgit2/src/tree.h +2 -0
- data/vendor/libgit2/src/tsort.c +0 -1
- data/vendor/libgit2/src/unix/map.c +4 -1
- data/vendor/libgit2/src/unix/posix.h +8 -4
- data/vendor/libgit2/src/unix/pthread.h +1 -1
- data/vendor/libgit2/src/unix/realpath.c +4 -1
- data/vendor/libgit2/src/util.c +6 -5
- data/vendor/libgit2/src/util.h +39 -111
- data/vendor/libgit2/src/varint.c +0 -1
- data/vendor/libgit2/src/varint.h +2 -0
- data/vendor/libgit2/src/vector.c +1 -1
- data/vendor/libgit2/src/win32/dir.c +3 -0
- data/vendor/libgit2/src/win32/dir.h +4 -3
- data/vendor/libgit2/src/win32/error.c +1 -1
- data/vendor/libgit2/src/win32/error.h +4 -2
- data/vendor/libgit2/src/win32/findfile.c +2 -1
- data/vendor/libgit2/src/win32/findfile.h +4 -2
- data/vendor/libgit2/src/win32/map.c +2 -0
- data/vendor/libgit2/src/win32/mingw-compat.h +3 -3
- data/vendor/libgit2/src/win32/msvc-compat.h +3 -3
- data/vendor/libgit2/src/win32/path_w32.c +7 -12
- data/vendor/libgit2/src/win32/path_w32.h +3 -2
- data/vendor/libgit2/src/win32/posix.h +2 -2
- data/vendor/libgit2/src/win32/posix_w32.c +11 -5
- data/vendor/libgit2/src/win32/precompiled.h +2 -1
- data/vendor/libgit2/src/win32/reparse.h +2 -2
- data/vendor/libgit2/src/win32/thread.c +1 -0
- data/vendor/libgit2/src/win32/thread.h +2 -2
- data/vendor/libgit2/src/win32/utf-conv.c +0 -1
- data/vendor/libgit2/src/win32/utf-conv.h +4 -3
- data/vendor/libgit2/src/win32/w32_buffer.c +1 -1
- data/vendor/libgit2/src/win32/w32_buffer.h +4 -2
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -1
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +85 -2
- data/vendor/libgit2/src/win32/w32_stack.c +2 -1
- data/vendor/libgit2/src/win32/w32_stack.h +5 -3
- data/vendor/libgit2/src/win32/w32_util.h +4 -2
- data/vendor/libgit2/src/win32/win32-compat.h +3 -3
- data/vendor/libgit2/src/worktree.c +4 -5
- data/vendor/libgit2/src/worktree.h +2 -0
- data/vendor/libgit2/src/xdiff/xdiff.h +22 -13
- data/vendor/libgit2/src/xdiff/xdiffi.c +523 -81
- data/vendor/libgit2/src/xdiff/xdiffi.h +2 -2
- data/vendor/libgit2/src/xdiff/xemit.c +63 -39
- data/vendor/libgit2/src/xdiff/xemit.h +2 -2
- data/vendor/libgit2/src/xdiff/xhistogram.c +0 -1
- data/vendor/libgit2/src/xdiff/xinclude.h +3 -2
- data/vendor/libgit2/src/xdiff/xmacros.h +2 -2
- data/vendor/libgit2/src/xdiff/xmerge.c +80 -20
- data/vendor/libgit2/src/xdiff/xpatience.c +41 -9
- data/vendor/libgit2/src/xdiff/xprepare.c +2 -2
- data/vendor/libgit2/src/xdiff/xprepare.h +2 -2
- data/vendor/libgit2/src/xdiff/xtypes.h +2 -2
- data/vendor/libgit2/src/xdiff/xutils.c +47 -27
- data/vendor/libgit2/src/xdiff/xutils.h +2 -5
- data/vendor/libgit2/src/zstream.c +65 -45
- data/vendor/libgit2/src/zstream.h +9 -2
- metadata +27 -13
- data/vendor/libgit2/include/git2/sys/remote.h +0 -16
|
@@ -4,6 +4,9 @@
|
|
|
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.
|
|
6
6
|
*/
|
|
7
|
+
|
|
8
|
+
#include "common.h"
|
|
9
|
+
|
|
7
10
|
#include "git2.h"
|
|
8
11
|
#include "git2/odb_backend.h"
|
|
9
12
|
|
|
@@ -41,7 +44,7 @@ int git_smart__store_refs(transport_smart *t, int flushes)
|
|
|
41
44
|
|
|
42
45
|
do {
|
|
43
46
|
if (buf->offset > 0)
|
|
44
|
-
error = git_pkt_parse_line(&pkt,
|
|
47
|
+
error = git_pkt_parse_line(&pkt, buf->data, &line_end, buf->offset);
|
|
45
48
|
else
|
|
46
49
|
error = GIT_EBUFS;
|
|
47
50
|
|
|
@@ -206,15 +209,15 @@ int git_smart__detect_caps(git_pkt_ref *pkt, transport_smart_caps *caps, git_vec
|
|
|
206
209
|
return 0;
|
|
207
210
|
}
|
|
208
211
|
|
|
209
|
-
static int recv_pkt(git_pkt **out,
|
|
212
|
+
static int recv_pkt(git_pkt **out, gitno_buffer *buf)
|
|
210
213
|
{
|
|
211
214
|
const char *ptr = buf->data, *line_end = ptr;
|
|
212
215
|
git_pkt *pkt = NULL;
|
|
213
|
-
int error = 0, ret;
|
|
216
|
+
int pkt_type, error = 0, ret;
|
|
214
217
|
|
|
215
218
|
do {
|
|
216
219
|
if (buf->offset > 0)
|
|
217
|
-
error = git_pkt_parse_line(&pkt, &line_end,
|
|
220
|
+
error = git_pkt_parse_line(&pkt, ptr, &line_end, buf->offset);
|
|
218
221
|
else
|
|
219
222
|
error = GIT_EBUFS;
|
|
220
223
|
|
|
@@ -233,14 +236,13 @@ static int recv_pkt(git_pkt **out, git_pkt_type *pkt_type, gitno_buffer *buf)
|
|
|
233
236
|
} while (error);
|
|
234
237
|
|
|
235
238
|
gitno_consume(buf, line_end);
|
|
236
|
-
|
|
237
|
-
*pkt_type = pkt->type;
|
|
239
|
+
pkt_type = pkt->type;
|
|
238
240
|
if (out != NULL)
|
|
239
241
|
*out = pkt;
|
|
240
242
|
else
|
|
241
243
|
git__free(pkt);
|
|
242
244
|
|
|
243
|
-
return
|
|
245
|
+
return pkt_type;
|
|
244
246
|
}
|
|
245
247
|
|
|
246
248
|
static int store_common(transport_smart *t)
|
|
@@ -250,7 +252,7 @@ static int store_common(transport_smart *t)
|
|
|
250
252
|
int error;
|
|
251
253
|
|
|
252
254
|
do {
|
|
253
|
-
if ((error = recv_pkt(&pkt,
|
|
255
|
+
if ((error = recv_pkt(&pkt, buf)) < 0)
|
|
254
256
|
return error;
|
|
255
257
|
|
|
256
258
|
if (pkt->type == GIT_PKT_ACK) {
|
|
@@ -318,7 +320,7 @@ static int wait_while_ack(gitno_buffer *buf)
|
|
|
318
320
|
while (1) {
|
|
319
321
|
git__free(pkt);
|
|
320
322
|
|
|
321
|
-
if ((error = recv_pkt((git_pkt **)&pkt,
|
|
323
|
+
if ((error = recv_pkt((git_pkt **)&pkt, buf)) < 0)
|
|
322
324
|
return error;
|
|
323
325
|
|
|
324
326
|
if (pkt->type == GIT_PKT_NAK)
|
|
@@ -343,8 +345,7 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c
|
|
|
343
345
|
gitno_buffer *buf = &t->buffer;
|
|
344
346
|
git_buf data = GIT_BUF_INIT;
|
|
345
347
|
git_revwalk *walk = NULL;
|
|
346
|
-
int error = -1;
|
|
347
|
-
git_pkt_type pkt_type;
|
|
348
|
+
int error = -1, pkt_type;
|
|
348
349
|
unsigned int i;
|
|
349
350
|
git_oid oid;
|
|
350
351
|
|
|
@@ -394,13 +395,16 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c
|
|
|
394
395
|
if ((error = store_common(t)) < 0)
|
|
395
396
|
goto on_error;
|
|
396
397
|
} else {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
} else if (pkt_type == GIT_PKT_ACK) {
|
|
398
|
+
pkt_type = recv_pkt(NULL, buf);
|
|
399
|
+
|
|
400
|
+
if (pkt_type == GIT_PKT_ACK) {
|
|
401
401
|
break;
|
|
402
402
|
} else if (pkt_type == GIT_PKT_NAK) {
|
|
403
403
|
continue;
|
|
404
|
+
} else if (pkt_type < 0) {
|
|
405
|
+
/* recv_pkt returned an error */
|
|
406
|
+
error = pkt_type;
|
|
407
|
+
goto on_error;
|
|
404
408
|
} else {
|
|
405
409
|
giterr_set(GITERR_NET, "Unexpected pkt type");
|
|
406
410
|
error = -1;
|
|
@@ -466,10 +470,10 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c
|
|
|
466
470
|
|
|
467
471
|
/* Now let's eat up whatever the server gives us */
|
|
468
472
|
if (!t->caps.multi_ack && !t->caps.multi_ack_detailed) {
|
|
469
|
-
|
|
473
|
+
pkt_type = recv_pkt(NULL, buf);
|
|
470
474
|
|
|
471
|
-
if (
|
|
472
|
-
return
|
|
475
|
+
if (pkt_type < 0) {
|
|
476
|
+
return pkt_type;
|
|
473
477
|
} else if (pkt_type != GIT_PKT_ACK && pkt_type != GIT_PKT_NAK) {
|
|
474
478
|
giterr_set(GITERR_NET, "Unexpected pkt type");
|
|
475
479
|
return -1;
|
|
@@ -590,7 +594,7 @@ int git_smart__download_pack(
|
|
|
590
594
|
goto done;
|
|
591
595
|
}
|
|
592
596
|
|
|
593
|
-
if ((error = recv_pkt(&pkt,
|
|
597
|
+
if ((error = recv_pkt(&pkt, buf)) >= 0) {
|
|
594
598
|
/* Check cancellation after network call */
|
|
595
599
|
if (t->cancelled.val) {
|
|
596
600
|
giterr_clear();
|
|
@@ -748,7 +752,7 @@ static int add_push_report_sideband_pkt(git_push *push, git_pkt_data *data_pkt,
|
|
|
748
752
|
}
|
|
749
753
|
|
|
750
754
|
while (line_len > 0) {
|
|
751
|
-
error = git_pkt_parse_line(&pkt, &line_end,
|
|
755
|
+
error = git_pkt_parse_line(&pkt, line, &line_end, line_len);
|
|
752
756
|
|
|
753
757
|
if (error == GIT_EBUFS) {
|
|
754
758
|
/* Buffer the data when the inner packet is split
|
|
@@ -791,8 +795,8 @@ static int parse_report(transport_smart *transport, git_push *push)
|
|
|
791
795
|
|
|
792
796
|
for (;;) {
|
|
793
797
|
if (buf->offset > 0)
|
|
794
|
-
error = git_pkt_parse_line(&pkt,
|
|
795
|
-
|
|
798
|
+
error = git_pkt_parse_line(&pkt, buf->data,
|
|
799
|
+
&line_end, buf->offset);
|
|
796
800
|
else
|
|
797
801
|
error = GIT_EBUFS;
|
|
798
802
|
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
#include "ssh.h"
|
|
9
|
+
|
|
8
10
|
#ifdef GIT_SSH
|
|
9
11
|
#include <libssh2.h>
|
|
10
12
|
#endif
|
|
@@ -15,8 +17,7 @@
|
|
|
15
17
|
#include "netops.h"
|
|
16
18
|
#include "smart.h"
|
|
17
19
|
#include "cred.h"
|
|
18
|
-
#include "
|
|
19
|
-
#include "ssh.h"
|
|
20
|
+
#include "streams/socket.h"
|
|
20
21
|
|
|
21
22
|
#ifdef GIT_SSH
|
|
22
23
|
|
|
@@ -63,7 +64,7 @@ static void ssh_error(LIBSSH2_SESSION *session, const char *errmsg)
|
|
|
63
64
|
*/
|
|
64
65
|
static int gen_proto(git_buf *request, const char *cmd, const char *url)
|
|
65
66
|
{
|
|
66
|
-
char *repo;
|
|
67
|
+
const char *repo;
|
|
67
68
|
int len;
|
|
68
69
|
size_t i;
|
|
69
70
|
|
|
@@ -91,8 +92,10 @@ done:
|
|
|
91
92
|
len = strlen(cmd) + 1 /* Space */ + 1 /* Quote */ + strlen(repo) + 1 /* Quote */ + 1;
|
|
92
93
|
|
|
93
94
|
git_buf_grow(request, len);
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
git_buf_puts(request, cmd);
|
|
96
|
+
git_buf_puts(request, " '");
|
|
97
|
+
git_buf_decode_percent(request, repo, strlen(repo));
|
|
98
|
+
git_buf_puts(request, "'");
|
|
96
99
|
|
|
97
100
|
if (git_buf_oom(request))
|
|
98
101
|
return -1;
|
|
@@ -418,8 +421,10 @@ static int _git_ssh_authenticate_session(
|
|
|
418
421
|
}
|
|
419
422
|
} while (LIBSSH2_ERROR_EAGAIN == rc || LIBSSH2_ERROR_TIMEOUT == rc);
|
|
420
423
|
|
|
421
|
-
|
|
422
|
-
|
|
424
|
+
if (rc == LIBSSH2_ERROR_PASSWORD_EXPIRED ||
|
|
425
|
+
rc == LIBSSH2_ERROR_AUTHENTICATION_FAILED ||
|
|
426
|
+
rc == LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED)
|
|
427
|
+
return GIT_EAUTH;
|
|
423
428
|
|
|
424
429
|
if (rc != LIBSSH2_ERROR_NONE) {
|
|
425
430
|
if (!giterr_last())
|
|
@@ -4,8 +4,10 @@
|
|
|
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.
|
|
6
6
|
*/
|
|
7
|
-
#ifndef
|
|
8
|
-
#define
|
|
7
|
+
#ifndef INCLUDE_transports_ssh_h__
|
|
8
|
+
#define INCLUDE_transports_ssh_h__
|
|
9
|
+
|
|
10
|
+
#include "common.h"
|
|
9
11
|
|
|
10
12
|
int git_transport_ssh_global_init(void);
|
|
11
13
|
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
#include "common.h"
|
|
9
|
+
|
|
8
10
|
#ifdef GIT_WINHTTP
|
|
9
11
|
|
|
10
12
|
#include "git2.h"
|
|
@@ -16,6 +18,7 @@
|
|
|
16
18
|
#include "remote.h"
|
|
17
19
|
#include "repository.h"
|
|
18
20
|
#include "global.h"
|
|
21
|
+
#include "http.h"
|
|
19
22
|
|
|
20
23
|
#include <wincrypt.h>
|
|
21
24
|
#include <winhttp.h>
|
|
@@ -178,9 +181,15 @@ static int apply_default_credentials(HINTERNET request, int mechanisms)
|
|
|
178
181
|
* is "medium" which applies to the intranet and sounds like it would correspond
|
|
179
182
|
* to Internet Explorer security zones, but in fact does not. */
|
|
180
183
|
DWORD data = WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW;
|
|
184
|
+
DWORD native_scheme = 0;
|
|
185
|
+
|
|
186
|
+
if ((mechanisms & GIT_WINHTTP_AUTH_NTLM) != 0)
|
|
187
|
+
native_scheme |= WINHTTP_AUTH_SCHEME_NTLM;
|
|
181
188
|
|
|
182
|
-
if ((mechanisms &
|
|
183
|
-
|
|
189
|
+
if ((mechanisms & GIT_WINHTTP_AUTH_NEGOTIATE) != 0)
|
|
190
|
+
native_scheme |= WINHTTP_AUTH_SCHEME_NEGOTIATE;
|
|
191
|
+
|
|
192
|
+
if (!native_scheme) {
|
|
184
193
|
giterr_set(GITERR_NET, "invalid authentication scheme");
|
|
185
194
|
return -1;
|
|
186
195
|
}
|
|
@@ -188,6 +197,9 @@ static int apply_default_credentials(HINTERNET request, int mechanisms)
|
|
|
188
197
|
if (!WinHttpSetOption(request, WINHTTP_OPTION_AUTOLOGON_POLICY, &data, sizeof(DWORD)))
|
|
189
198
|
return -1;
|
|
190
199
|
|
|
200
|
+
if (!WinHttpSetCredentials(request, WINHTTP_AUTH_TARGET_SERVER, native_scheme, NULL, NULL, NULL))
|
|
201
|
+
return -1;
|
|
202
|
+
|
|
191
203
|
return 0;
|
|
192
204
|
}
|
|
193
205
|
|
|
@@ -275,7 +287,7 @@ static int certificate_check(winhttp_stream *s, int valid)
|
|
|
275
287
|
cert.parent.cert_type = GIT_CERT_X509;
|
|
276
288
|
cert.data = cert_ctx->pbCertEncoded;
|
|
277
289
|
cert.len = cert_ctx->cbCertEncoded;
|
|
278
|
-
error = t->owner->certificate_check_cb((git_cert *) &cert, valid, t->connection_data.host, t->owner->
|
|
290
|
+
error = t->owner->certificate_check_cb((git_cert *) &cert, valid, t->connection_data.host, t->owner->message_cb_payload);
|
|
279
291
|
CertFreeCertificateContext(cert_ctx);
|
|
280
292
|
|
|
281
293
|
if (error < 0 && !giterr_last())
|
|
@@ -612,12 +624,12 @@ static int parse_unauthorized_response(
|
|
|
612
624
|
if (WINHTTP_AUTH_SCHEME_NTLM & supported) {
|
|
613
625
|
*allowed_types |= GIT_CREDTYPE_USERPASS_PLAINTEXT;
|
|
614
626
|
*allowed_types |= GIT_CREDTYPE_DEFAULT;
|
|
615
|
-
*allowed_mechanisms
|
|
627
|
+
*allowed_mechanisms |= GIT_WINHTTP_AUTH_NTLM;
|
|
616
628
|
}
|
|
617
629
|
|
|
618
630
|
if (WINHTTP_AUTH_SCHEME_NEGOTIATE & supported) {
|
|
619
631
|
*allowed_types |= GIT_CREDTYPE_DEFAULT;
|
|
620
|
-
*allowed_mechanisms
|
|
632
|
+
*allowed_mechanisms |= GIT_WINHTTP_AUTH_NEGOTIATE;
|
|
621
633
|
}
|
|
622
634
|
|
|
623
635
|
if (WINHTTP_AUTH_SCHEME_BASIC & supported) {
|
|
@@ -698,21 +710,6 @@ static int winhttp_close_connection(winhttp_subtransport *t)
|
|
|
698
710
|
return ret;
|
|
699
711
|
}
|
|
700
712
|
|
|
701
|
-
static int user_agent(git_buf *ua)
|
|
702
|
-
{
|
|
703
|
-
const char *custom = git_libgit2__user_agent();
|
|
704
|
-
|
|
705
|
-
git_buf_clear(ua);
|
|
706
|
-
git_buf_PUTS(ua, "git/1.0 (");
|
|
707
|
-
|
|
708
|
-
if (custom)
|
|
709
|
-
git_buf_puts(ua, custom);
|
|
710
|
-
else
|
|
711
|
-
git_buf_PUTS(ua, "libgit2 " LIBGIT2_VERSION);
|
|
712
|
-
|
|
713
|
-
return git_buf_putc(ua, ')');
|
|
714
|
-
}
|
|
715
|
-
|
|
716
713
|
static void CALLBACK winhttp_status(
|
|
717
714
|
HINTERNET connection,
|
|
718
715
|
DWORD_PTR ctx,
|
|
@@ -773,7 +770,8 @@ static int winhttp_connect(
|
|
|
773
770
|
return -1;
|
|
774
771
|
}
|
|
775
772
|
|
|
776
|
-
|
|
773
|
+
|
|
774
|
+
if ((error = git_http__user_agent(&ua)) < 0) {
|
|
777
775
|
git__free(wide_host);
|
|
778
776
|
return error;
|
|
779
777
|
}
|
data/vendor/libgit2/src/tree.c
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#include "common.h"
|
|
9
|
-
#include "commit.h"
|
|
10
8
|
#include "tree.h"
|
|
9
|
+
|
|
10
|
+
#include "commit.h"
|
|
11
11
|
#include "git2/repository.h"
|
|
12
12
|
#include "git2/object.h"
|
|
13
13
|
#include "fileops.h"
|
|
@@ -54,7 +54,7 @@ GIT_INLINE(git_filemode_t) normalize_filemode(git_filemode_t filemode)
|
|
|
54
54
|
static int valid_entry_name(git_repository *repo, const char *filename)
|
|
55
55
|
{
|
|
56
56
|
return *filename != '\0' &&
|
|
57
|
-
git_path_isvalid(repo, filename,
|
|
57
|
+
git_path_isvalid(repo, filename,
|
|
58
58
|
GIT_PATH_REJECT_TRAVERSAL | GIT_PATH_REJECT_DOT_GIT | GIT_PATH_REJECT_SLASH);
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -440,16 +440,16 @@ int git_tree__parse(void *_tree, git_odb_object *odb_obj)
|
|
|
440
440
|
unsigned int attr;
|
|
441
441
|
|
|
442
442
|
if (parse_mode(&attr, buffer, &buffer) < 0 || !buffer)
|
|
443
|
-
return tree_error("
|
|
443
|
+
return tree_error("failed to parse tree: can't parse filemode", NULL);
|
|
444
444
|
|
|
445
445
|
if ((nul = memchr(buffer, 0, buffer_end - buffer)) == NULL)
|
|
446
|
-
return tree_error("
|
|
446
|
+
return tree_error("failed to parse tree: object is corrupted", NULL);
|
|
447
447
|
|
|
448
448
|
if ((filename_len = nul - buffer) == 0)
|
|
449
|
-
return tree_error("
|
|
449
|
+
return tree_error("failed to parse tree: can't parse filename", NULL);
|
|
450
450
|
|
|
451
451
|
if ((buffer_end - (nul + 1)) < GIT_OID_RAWSZ)
|
|
452
|
-
return tree_error("
|
|
452
|
+
return tree_error("failed to parse tree: can't parse OID", NULL);
|
|
453
453
|
|
|
454
454
|
/* Allocate the entry */
|
|
455
455
|
{
|
|
@@ -496,7 +496,10 @@ static int append_entry(
|
|
|
496
496
|
int error = 0;
|
|
497
497
|
|
|
498
498
|
if (!valid_entry_name(bld->repo, filename))
|
|
499
|
-
return tree_error("
|
|
499
|
+
return tree_error("failed to insert entry: invalid name for a tree entry", filename);
|
|
500
|
+
|
|
501
|
+
if (git_oid_iszero(id))
|
|
502
|
+
return tree_error("failed to insert entry: invalid null OID for a tree entry", filename);
|
|
500
503
|
|
|
501
504
|
entry = alloc_entry(filename, strlen(filename), id);
|
|
502
505
|
GITERR_CHECK_ALLOC(entry);
|
|
@@ -735,14 +738,17 @@ int git_treebuilder_insert(
|
|
|
735
738
|
assert(bld && id && filename);
|
|
736
739
|
|
|
737
740
|
if (!valid_filemode(filemode))
|
|
738
|
-
return tree_error("
|
|
741
|
+
return tree_error("failed to insert entry: invalid filemode for file", filename);
|
|
739
742
|
|
|
740
743
|
if (!valid_entry_name(bld->repo, filename))
|
|
741
|
-
return tree_error("
|
|
744
|
+
return tree_error("failed to insert entry: invalid name for a tree entry", filename);
|
|
745
|
+
|
|
746
|
+
if (git_oid_iszero(id))
|
|
747
|
+
return tree_error("failed to insert entry: invalid null OID", filename);
|
|
742
748
|
|
|
743
749
|
if (filemode != GIT_FILEMODE_COMMIT &&
|
|
744
750
|
!git_object__is_valid(bld->repo, id, otype_from_mode(filemode)))
|
|
745
|
-
return tree_error("
|
|
751
|
+
return tree_error("failed to insert entry: invalid object specified", filename);
|
|
746
752
|
|
|
747
753
|
pos = git_strmap_lookup_index(bld->map, filename);
|
|
748
754
|
if (git_strmap_valid_index(bld->map, pos)) {
|
|
@@ -793,7 +799,7 @@ int git_treebuilder_remove(git_treebuilder *bld, const char *filename)
|
|
|
793
799
|
git_tree_entry *entry = treebuilder_get(bld, filename);
|
|
794
800
|
|
|
795
801
|
if (entry == NULL)
|
|
796
|
-
return tree_error("
|
|
802
|
+
return tree_error("failed to remove entry: file isn't in the tree", filename);
|
|
797
803
|
|
|
798
804
|
git_strmap_delete(bld->map, filename);
|
|
799
805
|
git_tree_entry_free(entry);
|
|
@@ -946,12 +952,12 @@ int git_tree_entry_bypath(
|
|
|
946
952
|
return GIT_ENOTFOUND;
|
|
947
953
|
}
|
|
948
954
|
|
|
949
|
-
/* If there's only a slash left in the path, we
|
|
955
|
+
/* If there's only a slash left in the path, we
|
|
950
956
|
* return the current entry; otherwise, we keep
|
|
951
957
|
* walking down the path */
|
|
952
958
|
if (path[filename_len + 1] != '\0')
|
|
953
959
|
break;
|
|
954
|
-
|
|
960
|
+
/* fall through */
|
|
955
961
|
case '\0':
|
|
956
962
|
/* If there are no more components in the path, return
|
|
957
963
|
* this entry */
|
data/vendor/libgit2/src/tree.h
CHANGED
data/vendor/libgit2/src/tsort.c
CHANGED
|
@@ -310,7 +310,6 @@ static ssize_t collapse(void **dst, struct tsort_run *stack, ssize_t stack_curr,
|
|
|
310
310
|
#define PUSH_NEXT() do {\
|
|
311
311
|
len = count_run(dst, curr, size, store);\
|
|
312
312
|
run = minrun;\
|
|
313
|
-
if (run < minrun) run = minrun;\
|
|
314
313
|
if (run > (ssize_t)size - curr) run = size - curr;\
|
|
315
314
|
if (run > len) {\
|
|
316
315
|
bisort(&dst[curr], len, run, cmp, payload);\
|
|
@@ -4,7 +4,10 @@
|
|
|
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.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
#include "common.h"
|
|
9
|
+
|
|
10
|
+
#include "git2/common.h"
|
|
8
11
|
|
|
9
12
|
#if !defined(GIT_WIN32) && !defined(NO_MMAP)
|
|
10
13
|
|