rugged 0.26.7 → 0.27.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -0,0 +1,64 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
#ifndef INCLUDE_config_parse_h__
|
8
|
+
#define INCLUDE_config_parse_h__
|
9
|
+
|
10
|
+
#include "common.h"
|
11
|
+
#include "array.h"
|
12
|
+
#include "oid.h"
|
13
|
+
#include "parse.h"
|
14
|
+
|
15
|
+
static const char *git_config_escapes = "ntb\"\\";
|
16
|
+
static const char *git_config_escaped = "\n\t\b\"\\";
|
17
|
+
|
18
|
+
typedef struct config_file {
|
19
|
+
git_oid checksum;
|
20
|
+
char *path;
|
21
|
+
git_array_t(struct config_file) includes;
|
22
|
+
} git_config_file;
|
23
|
+
|
24
|
+
typedef struct {
|
25
|
+
struct config_file *file;
|
26
|
+
git_parse_ctx ctx;
|
27
|
+
} git_config_parser;
|
28
|
+
|
29
|
+
typedef int (*git_config_parser_section_cb)(
|
30
|
+
git_config_parser *parser,
|
31
|
+
const char *current_section,
|
32
|
+
const char *line,
|
33
|
+
size_t line_len,
|
34
|
+
void *data);
|
35
|
+
|
36
|
+
typedef int (*git_config_parser_variable_cb)(
|
37
|
+
git_config_parser *parser,
|
38
|
+
const char *current_section,
|
39
|
+
char *var_name,
|
40
|
+
char *var_value,
|
41
|
+
const char *line,
|
42
|
+
size_t line_len,
|
43
|
+
void *data);
|
44
|
+
|
45
|
+
typedef int (*git_config_parser_comment_cb)(
|
46
|
+
git_config_parser *parser,
|
47
|
+
const char *line,
|
48
|
+
size_t line_len,
|
49
|
+
void *data);
|
50
|
+
|
51
|
+
typedef int (*git_config_parser_eof_cb)(
|
52
|
+
git_config_parser *parser,
|
53
|
+
const char *current_section,
|
54
|
+
void *data);
|
55
|
+
|
56
|
+
int git_config_parse(
|
57
|
+
git_config_parser *parser,
|
58
|
+
git_config_parser_section_cb on_section,
|
59
|
+
git_config_parser_variable_cb on_variable,
|
60
|
+
git_config_parser_comment_cb on_comment,
|
61
|
+
git_config_parser_eof_cb on_eof,
|
62
|
+
void *data);
|
63
|
+
|
64
|
+
#endif
|
data/vendor/libgit2/src/crlf.c
CHANGED
@@ -5,12 +5,13 @@
|
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
6
6
|
*/
|
7
7
|
|
8
|
+
#include "common.h"
|
9
|
+
|
8
10
|
#include "git2/attr.h"
|
9
11
|
#include "git2/blob.h"
|
10
12
|
#include "git2/index.h"
|
11
13
|
#include "git2/sys/filter.h"
|
12
14
|
|
13
|
-
#include "common.h"
|
14
15
|
#include "fileops.h"
|
15
16
|
#include "hash.h"
|
16
17
|
#include "filter.h"
|
data/vendor/libgit2/src/delta.c
CHANGED
@@ -539,11 +539,10 @@ int git_delta_apply(
|
|
539
539
|
*out = NULL;
|
540
540
|
*out_len = 0;
|
541
541
|
|
542
|
-
/*
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
*/
|
542
|
+
/* Check that the base size matches the data we were given;
|
543
|
+
* if not we would underflow while accessing data from the
|
544
|
+
* base object, resulting in data corruption or segfault.
|
545
|
+
*/
|
547
546
|
if ((hdr_sz(&base_sz, &delta, delta_end) < 0) || (base_sz != base_len)) {
|
548
547
|
giterr_set(GITERR_INVALID, "failed to apply delta: base size does not match given data");
|
549
548
|
return -1;
|
@@ -565,34 +564,31 @@ int git_delta_apply(
|
|
565
564
|
while (delta < delta_end) {
|
566
565
|
unsigned char cmd = *delta++;
|
567
566
|
if (cmd & 0x80) {
|
568
|
-
/* cmd is a copy instruction; copy from the base.
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
if (cmd & 0x01)
|
573
|
-
if (cmd & 0x02)
|
574
|
-
if (cmd & 0x04)
|
575
|
-
if (cmd & 0x08)
|
576
|
-
|
577
|
-
if (cmd & 0x10)
|
578
|
-
if (cmd & 0x20)
|
579
|
-
if (cmd & 0x40)
|
580
|
-
if (!len)
|
581
|
-
#undef ADD_DELTA
|
582
|
-
|
583
|
-
if (GIT_ADD_SIZET_OVERFLOW(&end, off, len) ||
|
584
|
-
base_len < end || res_sz < len)
|
585
|
-
goto fail;
|
567
|
+
/* cmd is a copy instruction; copy from the base.
|
568
|
+
*/
|
569
|
+
size_t off = 0, len = 0;
|
570
|
+
|
571
|
+
if (cmd & 0x01) off = *delta++;
|
572
|
+
if (cmd & 0x02) off |= *delta++ << 8UL;
|
573
|
+
if (cmd & 0x04) off |= *delta++ << 16UL;
|
574
|
+
if (cmd & 0x08) off |= *delta++ << 24UL;
|
575
|
+
|
576
|
+
if (cmd & 0x10) len = *delta++;
|
577
|
+
if (cmd & 0x20) len |= *delta++ << 8UL;
|
578
|
+
if (cmd & 0x40) len |= *delta++ << 16UL;
|
579
|
+
if (!len) len = 0x10000;
|
586
580
|
|
581
|
+
if (base_len < off + len || res_sz < len)
|
582
|
+
goto fail;
|
587
583
|
memcpy(res_dp, base + off, len);
|
588
584
|
res_dp += len;
|
589
585
|
res_sz -= len;
|
590
586
|
|
591
|
-
}
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
587
|
+
}
|
588
|
+
else if (cmd) {
|
589
|
+
/* cmd is a literal insert instruction; copy from
|
590
|
+
* the delta stream itself.
|
591
|
+
*/
|
596
592
|
if (delta_end - delta < cmd || res_sz < cmd)
|
597
593
|
goto fail;
|
598
594
|
memcpy(res_dp, delta, cmd);
|
@@ -600,8 +596,10 @@ int git_delta_apply(
|
|
600
596
|
res_dp += cmd;
|
601
597
|
res_sz -= cmd;
|
602
598
|
|
603
|
-
}
|
604
|
-
|
599
|
+
}
|
600
|
+
else {
|
601
|
+
/* cmd == 0 is reserved for future encodings.
|
602
|
+
*/
|
605
603
|
goto fail;
|
606
604
|
}
|
607
605
|
}
|
data/vendor/libgit2/src/delta.h
CHANGED
@@ -4,12 +4,14 @@
|
|
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/describe.h"
|
8
11
|
#include "git2/strarray.h"
|
9
12
|
#include "git2/diff.h"
|
10
13
|
#include "git2/status.h"
|
11
14
|
|
12
|
-
#include "common.h"
|
13
15
|
#include "commit.h"
|
14
16
|
#include "commit_list.h"
|
15
17
|
#include "oidmap.h"
|
data/vendor/libgit2/src/diff.c
CHANGED
@@ -4,14 +4,21 @@
|
|
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"
|
7
|
+
|
9
8
|
#include "diff.h"
|
9
|
+
|
10
|
+
#include "git2/version.h"
|
10
11
|
#include "diff_generate.h"
|
11
12
|
#include "patch.h"
|
12
13
|
#include "commit.h"
|
13
14
|
#include "index.h"
|
14
15
|
|
16
|
+
struct patch_id_args {
|
17
|
+
git_hash_ctx ctx;
|
18
|
+
git_oid result;
|
19
|
+
int first_file;
|
20
|
+
};
|
21
|
+
|
15
22
|
GIT_INLINE(const char *) diff_delta__path(const git_diff_delta *delta)
|
16
23
|
{
|
17
24
|
const char *str = delta->old_file.path;
|
@@ -367,3 +374,142 @@ int git_diff_format_email_init_options(
|
|
367
374
|
return 0;
|
368
375
|
}
|
369
376
|
|
377
|
+
static int flush_hunk(git_oid *result, git_hash_ctx *ctx)
|
378
|
+
{
|
379
|
+
git_oid hash;
|
380
|
+
unsigned short carry = 0;
|
381
|
+
int error, i;
|
382
|
+
|
383
|
+
if ((error = git_hash_final(&hash, ctx)) < 0 ||
|
384
|
+
(error = git_hash_init(ctx)) < 0)
|
385
|
+
return error;
|
386
|
+
|
387
|
+
for (i = 0; i < GIT_OID_RAWSZ; i++) {
|
388
|
+
carry += result->id[i] + hash.id[i];
|
389
|
+
result->id[i] = carry;
|
390
|
+
carry >>= 8;
|
391
|
+
}
|
392
|
+
|
393
|
+
return 0;
|
394
|
+
}
|
395
|
+
|
396
|
+
static void strip_spaces(git_buf *buf)
|
397
|
+
{
|
398
|
+
char *src = buf->ptr, *dst = buf->ptr;
|
399
|
+
char c;
|
400
|
+
size_t len = 0;
|
401
|
+
|
402
|
+
while ((c = *src++) != '\0') {
|
403
|
+
if (!git__isspace(c)) {
|
404
|
+
*dst++ = c;
|
405
|
+
len++;
|
406
|
+
}
|
407
|
+
}
|
408
|
+
|
409
|
+
git_buf_truncate(buf, len);
|
410
|
+
}
|
411
|
+
|
412
|
+
static int file_cb(
|
413
|
+
const git_diff_delta *delta,
|
414
|
+
float progress,
|
415
|
+
void *payload)
|
416
|
+
{
|
417
|
+
struct patch_id_args *args = (struct patch_id_args *) payload;
|
418
|
+
git_buf buf = GIT_BUF_INIT;
|
419
|
+
int error;
|
420
|
+
|
421
|
+
GIT_UNUSED(progress);
|
422
|
+
|
423
|
+
if (!args->first_file &&
|
424
|
+
(error = flush_hunk(&args->result, &args->ctx)) < 0)
|
425
|
+
goto out;
|
426
|
+
args->first_file = 0;
|
427
|
+
|
428
|
+
if ((error = git_buf_printf(&buf,
|
429
|
+
"diff--gita/%sb/%s---a/%s+++b/%s",
|
430
|
+
delta->old_file.path,
|
431
|
+
delta->new_file.path,
|
432
|
+
delta->old_file.path,
|
433
|
+
delta->new_file.path)) < 0)
|
434
|
+
goto out;
|
435
|
+
|
436
|
+
strip_spaces(&buf);
|
437
|
+
|
438
|
+
if ((error = git_hash_update(&args->ctx, buf.ptr, buf.size)) < 0)
|
439
|
+
goto out;
|
440
|
+
|
441
|
+
out:
|
442
|
+
git_buf_free(&buf);
|
443
|
+
return error;
|
444
|
+
}
|
445
|
+
|
446
|
+
static int line_cb(
|
447
|
+
const git_diff_delta *delta,
|
448
|
+
const git_diff_hunk *hunk,
|
449
|
+
const git_diff_line *line,
|
450
|
+
void *payload)
|
451
|
+
{
|
452
|
+
struct patch_id_args *args = (struct patch_id_args *) payload;
|
453
|
+
git_buf buf = GIT_BUF_INIT;
|
454
|
+
int error;
|
455
|
+
|
456
|
+
GIT_UNUSED(delta);
|
457
|
+
GIT_UNUSED(hunk);
|
458
|
+
|
459
|
+
switch (line->origin) {
|
460
|
+
case GIT_DIFF_LINE_ADDITION:
|
461
|
+
git_buf_putc(&buf, '+');
|
462
|
+
break;
|
463
|
+
case GIT_DIFF_LINE_DELETION:
|
464
|
+
git_buf_putc(&buf, '-');
|
465
|
+
break;
|
466
|
+
case GIT_DIFF_LINE_CONTEXT:
|
467
|
+
break;
|
468
|
+
default:
|
469
|
+
giterr_set(GITERR_PATCH, "invalid line origin for patch");
|
470
|
+
return -1;
|
471
|
+
}
|
472
|
+
|
473
|
+
git_buf_put(&buf, line->content, line->content_len);
|
474
|
+
strip_spaces(&buf);
|
475
|
+
|
476
|
+
if ((error = git_hash_update(&args->ctx, buf.ptr, buf.size)) < 0)
|
477
|
+
goto out;
|
478
|
+
|
479
|
+
out:
|
480
|
+
git_buf_free(&buf);
|
481
|
+
return error;
|
482
|
+
}
|
483
|
+
|
484
|
+
int git_diff_patchid_init_options(git_diff_patchid_options *opts, unsigned int version)
|
485
|
+
{
|
486
|
+
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
|
487
|
+
opts, version, git_diff_patchid_options, GIT_DIFF_PATCHID_OPTIONS_INIT);
|
488
|
+
return 0;
|
489
|
+
}
|
490
|
+
|
491
|
+
int git_diff_patchid(git_oid *out, git_diff *diff, git_diff_patchid_options *opts)
|
492
|
+
{
|
493
|
+
struct patch_id_args args;
|
494
|
+
int error;
|
495
|
+
|
496
|
+
GITERR_CHECK_VERSION(
|
497
|
+
opts, GIT_DIFF_PATCHID_OPTIONS_VERSION, "git_diff_patchid_options");
|
498
|
+
|
499
|
+
memset(&args, 0, sizeof(args));
|
500
|
+
args.first_file = 1;
|
501
|
+
if ((error = git_hash_ctx_init(&args.ctx)) < 0)
|
502
|
+
goto out;
|
503
|
+
|
504
|
+
if ((error = git_diff_foreach(diff, file_cb, NULL, NULL, line_cb, &args)) < 0)
|
505
|
+
goto out;
|
506
|
+
|
507
|
+
if ((error = (flush_hunk(&args.result, &args.ctx))) < 0)
|
508
|
+
goto out;
|
509
|
+
|
510
|
+
git_oid_cpy(out, &args.result);
|
511
|
+
|
512
|
+
out:
|
513
|
+
git_hash_ctx_cleanup(&args.ctx);
|
514
|
+
return error;
|
515
|
+
}
|
data/vendor/libgit2/src/diff.h
CHANGED
@@ -7,6 +7,8 @@
|
|
7
7
|
#ifndef INCLUDE_diff_h__
|
8
8
|
#define INCLUDE_diff_h__
|
9
9
|
|
10
|
+
#include "common.h"
|
11
|
+
|
10
12
|
#include "git2/diff.h"
|
11
13
|
#include "git2/patch.h"
|
12
14
|
#include "git2/sys/diff.h"
|
@@ -32,6 +34,7 @@ typedef enum {
|
|
32
34
|
struct git_diff {
|
33
35
|
git_refcount rc;
|
34
36
|
git_repository *repo;
|
37
|
+
git_attr_session attrsession;
|
35
38
|
git_diff_origin_t type;
|
36
39
|
git_diff_options opts;
|
37
40
|
git_vector deltas; /* vector of git_diff_delta */
|
@@ -63,4 +66,3 @@ extern int git_diff__entry_cmp(const void *a, const void *b);
|
|
63
66
|
extern int git_diff__entry_icmp(const void *a, const void *b);
|
64
67
|
|
65
68
|
#endif
|
66
|
-
|
@@ -4,12 +4,12 @@
|
|
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 "diff_driver.h"
|
8
9
|
|
9
10
|
#include "git2/attr.h"
|
10
11
|
|
11
12
|
#include "diff.h"
|
12
|
-
#include "diff_driver.h"
|
13
13
|
#include "strmap.h"
|
14
14
|
#include "map.h"
|
15
15
|
#include "buf_text.h"
|
@@ -354,27 +354,30 @@ done:
|
|
354
354
|
}
|
355
355
|
|
356
356
|
int git_diff_driver_lookup(
|
357
|
-
git_diff_driver **out, git_repository *repo,
|
357
|
+
git_diff_driver **out, git_repository *repo,
|
358
|
+
git_attr_session *attrsession, const char *path)
|
358
359
|
{
|
359
360
|
int error = 0;
|
360
|
-
const char *
|
361
|
+
const char *values[1], *attrs[] = { "diff" };
|
361
362
|
|
362
363
|
assert(out);
|
363
364
|
*out = NULL;
|
364
365
|
|
365
366
|
if (!repo || !path || !strlen(path))
|
366
367
|
/* just use the auto value */;
|
367
|
-
else if ((error =
|
368
|
+
else if ((error = git_attr_get_many_with_session(values, repo,
|
369
|
+
attrsession, 0, path, 1, attrs)) < 0)
|
368
370
|
/* return error below */;
|
369
|
-
|
371
|
+
|
372
|
+
else if (GIT_ATTR_UNSPECIFIED(values[0]))
|
370
373
|
/* just use the auto value */;
|
371
|
-
else if (GIT_ATTR_FALSE(
|
374
|
+
else if (GIT_ATTR_FALSE(values[0]))
|
372
375
|
*out = &global_drivers[DIFF_DRIVER_BINARY];
|
373
|
-
else if (GIT_ATTR_TRUE(
|
376
|
+
else if (GIT_ATTR_TRUE(values[0]))
|
374
377
|
*out = &global_drivers[DIFF_DRIVER_TEXT];
|
375
378
|
|
376
379
|
/* otherwise look for driver information in config and build driver */
|
377
|
-
else if ((error = git_diff_driver_load(out, repo,
|
380
|
+
else if ((error = git_diff_driver_load(out, repo, values[0])) < 0) {
|
378
381
|
if (error == GIT_ENOTFOUND) {
|
379
382
|
error = 0;
|
380
383
|
giterr_clear();
|
@@ -8,6 +8,8 @@
|
|
8
8
|
#define INCLUDE_diff_driver_h__
|
9
9
|
|
10
10
|
#include "common.h"
|
11
|
+
|
12
|
+
#include "attr_file.h"
|
11
13
|
#include "buffer.h"
|
12
14
|
|
13
15
|
typedef struct git_diff_driver_registry git_diff_driver_registry;
|
@@ -17,7 +19,8 @@ void git_diff_driver_registry_free(git_diff_driver_registry *);
|
|
17
19
|
|
18
20
|
typedef struct git_diff_driver git_diff_driver;
|
19
21
|
|
20
|
-
int git_diff_driver_lookup(git_diff_driver **, git_repository *,
|
22
|
+
int git_diff_driver_lookup(git_diff_driver **, git_repository *,
|
23
|
+
git_attr_session *attrsession, const char *);
|
21
24
|
void git_diff_driver_free(git_diff_driver *);
|
22
25
|
|
23
26
|
/* diff option flags to force off and on for this driver */
|