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
data/vendor/libgit2/src/apply.c
CHANGED
@@ -5,6 +5,8 @@
|
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
6
6
|
*/
|
7
7
|
|
8
|
+
#include "apply.h"
|
9
|
+
|
8
10
|
#include <assert.h>
|
9
11
|
|
10
12
|
#include "git2/patch.h"
|
@@ -12,7 +14,6 @@
|
|
12
14
|
#include "array.h"
|
13
15
|
#include "patch.h"
|
14
16
|
#include "fileops.h"
|
15
|
-
#include "apply.h"
|
16
17
|
#include "delta.h"
|
17
18
|
#include "zstream.h"
|
18
19
|
|
data/vendor/libgit2/src/apply.h
CHANGED
data/vendor/libgit2/src/attr.c
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
-
|
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
|
+
|
8
|
+
#include "attr.h"
|
9
|
+
|
2
10
|
#include "repository.h"
|
3
11
|
#include "sysdir.h"
|
4
12
|
#include "config.h"
|
@@ -48,12 +56,16 @@ int git_attr_get(
|
|
48
56
|
git_attr_file *file;
|
49
57
|
git_attr_name attr;
|
50
58
|
git_attr_rule *rule;
|
59
|
+
git_dir_flag dir_flag = GIT_DIR_FLAG_UNKNOWN;
|
51
60
|
|
52
61
|
assert(value && repo && name);
|
53
62
|
|
54
63
|
*value = NULL;
|
55
64
|
|
56
|
-
if (
|
65
|
+
if (git_repository_is_bare(repo))
|
66
|
+
dir_flag = GIT_DIR_FLAG_FALSE;
|
67
|
+
|
68
|
+
if (git_attr_path__init(&path, pathname, git_repository_workdir(repo), dir_flag) < 0)
|
57
69
|
return -1;
|
58
70
|
|
59
71
|
if ((error = collect_attr_files(repo, NULL, flags, pathname, &files)) < 0)
|
@@ -106,13 +118,17 @@ int git_attr_get_many_with_session(
|
|
106
118
|
git_attr_rule *rule;
|
107
119
|
attr_get_many_info *info = NULL;
|
108
120
|
size_t num_found = 0;
|
121
|
+
git_dir_flag dir_flag = GIT_DIR_FLAG_UNKNOWN;
|
109
122
|
|
110
123
|
if (!num_attr)
|
111
124
|
return 0;
|
112
125
|
|
113
126
|
assert(values && repo && names);
|
114
127
|
|
115
|
-
if (
|
128
|
+
if (git_repository_is_bare(repo))
|
129
|
+
dir_flag = GIT_DIR_FLAG_FALSE;
|
130
|
+
|
131
|
+
if (git_attr_path__init(&path, pathname, git_repository_workdir(repo), dir_flag) < 0)
|
116
132
|
return -1;
|
117
133
|
|
118
134
|
if ((error = collect_attr_files(repo, attr_session, flags, pathname, &files)) < 0)
|
@@ -188,10 +204,14 @@ int git_attr_foreach(
|
|
188
204
|
git_attr_rule *rule;
|
189
205
|
git_attr_assignment *assign;
|
190
206
|
git_strmap *seen = NULL;
|
207
|
+
git_dir_flag dir_flag = GIT_DIR_FLAG_UNKNOWN;
|
191
208
|
|
192
209
|
assert(repo && callback);
|
193
210
|
|
194
|
-
if (
|
211
|
+
if (git_repository_is_bare(repo))
|
212
|
+
dir_flag = GIT_DIR_FLAG_FALSE;
|
213
|
+
|
214
|
+
if (git_attr_path__init(&path, pathname, git_repository_workdir(repo), dir_flag) < 0)
|
195
215
|
return -1;
|
196
216
|
|
197
217
|
if ((error = collect_attr_files(repo, NULL, flags, pathname, &files)) < 0 ||
|
data/vendor/libgit2/src/attr.h
CHANGED
@@ -1,7 +1,14 @@
|
|
1
|
-
|
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
|
+
|
8
|
+
#include "attr_file.h"
|
9
|
+
|
2
10
|
#include "repository.h"
|
3
11
|
#include "filebuf.h"
|
4
|
-
#include "attr_file.h"
|
5
12
|
#include "attrcache.h"
|
6
13
|
#include "git2/blob.h"
|
7
14
|
#include "git2/tree.h"
|
@@ -1,4 +1,12 @@
|
|
1
|
-
|
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
|
+
|
8
|
+
#include "attrcache.h"
|
9
|
+
|
2
10
|
#include "repository.h"
|
3
11
|
#include "attr_file.h"
|
4
12
|
#include "config.h"
|
data/vendor/libgit2/src/blame.c
CHANGED
data/vendor/libgit2/src/blame.h
CHANGED
data/vendor/libgit2/src/blob.c
CHANGED
@@ -5,14 +5,14 @@
|
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
6
6
|
*/
|
7
7
|
|
8
|
+
#include "blob.h"
|
9
|
+
|
8
10
|
#include "git2/common.h"
|
9
11
|
#include "git2/object.h"
|
10
12
|
#include "git2/repository.h"
|
11
13
|
#include "git2/odb_backend.h"
|
12
14
|
|
13
|
-
#include "common.h"
|
14
15
|
#include "filebuf.h"
|
15
|
-
#include "blob.h"
|
16
16
|
#include "filter.h"
|
17
17
|
#include "buf_text.h"
|
18
18
|
|
data/vendor/libgit2/src/blob.h
CHANGED
data/vendor/libgit2/src/branch.c
CHANGED
@@ -5,7 +5,8 @@
|
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
6
6
|
*/
|
7
7
|
|
8
|
-
#include "
|
8
|
+
#include "branch.h"
|
9
|
+
|
9
10
|
#include "commit.h"
|
10
11
|
#include "tag.h"
|
11
12
|
#include "config.h"
|
@@ -69,6 +70,12 @@ static int create_branch(
|
|
69
70
|
assert(branch_name && commit && ref_out);
|
70
71
|
assert(git_object_owner((const git_object *)commit) == repository);
|
71
72
|
|
73
|
+
if (!git__strcmp(branch_name, "HEAD")) {
|
74
|
+
giterr_set(GITERR_REFERENCE, "'HEAD' is not a valid branch name");
|
75
|
+
error = -1;
|
76
|
+
goto cleanup;
|
77
|
+
}
|
78
|
+
|
72
79
|
if (force && !bare && git_branch_lookup(&branch, repository, branch_name, GIT_BRANCH_LOCAL) == 0) {
|
73
80
|
error = git_branch_is_head(branch);
|
74
81
|
git_reference_free(branch);
|
data/vendor/libgit2/src/branch.h
CHANGED
@@ -188,7 +188,7 @@ bool git_buf_text_is_binary(const git_buf *buf)
|
|
188
188
|
git_bom_t bom;
|
189
189
|
int printable = 0, nonprintable = 0;
|
190
190
|
|
191
|
-
scan += git_buf_text_detect_bom(&bom, buf
|
191
|
+
scan += git_buf_text_detect_bom(&bom, buf);
|
192
192
|
|
193
193
|
if (bom > GIT_BOM_UTF8)
|
194
194
|
return 1;
|
@@ -215,18 +215,18 @@ bool git_buf_text_contains_nul(const git_buf *buf)
|
|
215
215
|
return (memchr(buf->ptr, '\0', buf->size) != NULL);
|
216
216
|
}
|
217
217
|
|
218
|
-
int git_buf_text_detect_bom(git_bom_t *bom, const git_buf *buf
|
218
|
+
int git_buf_text_detect_bom(git_bom_t *bom, const git_buf *buf)
|
219
219
|
{
|
220
220
|
const char *ptr;
|
221
221
|
size_t len;
|
222
222
|
|
223
223
|
*bom = GIT_BOM_NONE;
|
224
|
-
/* need at least 2 bytes
|
225
|
-
if (buf->size <
|
224
|
+
/* need at least 2 bytes to look for any BOM */
|
225
|
+
if (buf->size < 2)
|
226
226
|
return 0;
|
227
227
|
|
228
|
-
ptr = buf->ptr
|
229
|
-
len = buf->size
|
228
|
+
ptr = buf->ptr;
|
229
|
+
len = buf->size;
|
230
230
|
|
231
231
|
switch (*ptr++) {
|
232
232
|
case 0:
|
@@ -274,7 +274,7 @@ bool git_buf_text_gather_stats(
|
|
274
274
|
memset(stats, 0, sizeof(*stats));
|
275
275
|
|
276
276
|
/* BOM detection */
|
277
|
-
skip = git_buf_text_detect_bom(&stats->bom, buf
|
277
|
+
skip = git_buf_text_detect_bom(&stats->bom, buf);
|
278
278
|
if (skip_bom)
|
279
279
|
scan += skip;
|
280
280
|
|
@@ -7,6 +7,8 @@
|
|
7
7
|
#ifndef INCLUDE_buf_text_h__
|
8
8
|
#define INCLUDE_buf_text_h__
|
9
9
|
|
10
|
+
#include "common.h"
|
11
|
+
|
10
12
|
#include "buffer.h"
|
11
13
|
|
12
14
|
typedef enum {
|
@@ -97,11 +99,9 @@ extern bool git_buf_text_contains_nul(const git_buf *buf);
|
|
97
99
|
*
|
98
100
|
* @param bom Set to the type of BOM detected or GIT_BOM_NONE
|
99
101
|
* @param buf Buffer in which to check the first bytes for a BOM
|
100
|
-
* @param offset Offset into buffer to look for BOM
|
101
102
|
* @return Number of bytes of BOM data (or 0 if no BOM found)
|
102
103
|
*/
|
103
|
-
extern int git_buf_text_detect_bom(
|
104
|
-
git_bom_t *bom, const git_buf *buf, size_t offset);
|
104
|
+
extern int git_buf_text_detect_bom(git_bom_t *bom, const git_buf *buf);
|
105
105
|
|
106
106
|
/**
|
107
107
|
* Gather stats for a piece of text
|
data/vendor/libgit2/src/buffer.c
CHANGED
@@ -212,7 +212,7 @@ int git_buf_put(git_buf *buf, const char *data, size_t len)
|
|
212
212
|
size_t new_size;
|
213
213
|
|
214
214
|
assert(data);
|
215
|
-
|
215
|
+
|
216
216
|
GITERR_CHECK_ALLOC_ADD(&new_size, buf->size, len);
|
217
217
|
GITERR_CHECK_ALLOC_ADD(&new_size, new_size, 1);
|
218
218
|
ENSURE_SIZE(buf, new_size);
|
@@ -455,6 +455,36 @@ on_error:
|
|
455
455
|
return -1;
|
456
456
|
}
|
457
457
|
|
458
|
+
#define HEX_DECODE(c) ((c | 32) % 39 - 9)
|
459
|
+
|
460
|
+
int git_buf_decode_percent(
|
461
|
+
git_buf *buf,
|
462
|
+
const char *str,
|
463
|
+
size_t str_len)
|
464
|
+
{
|
465
|
+
size_t str_pos, new_size;
|
466
|
+
|
467
|
+
GITERR_CHECK_ALLOC_ADD(&new_size, buf->size, str_len);
|
468
|
+
GITERR_CHECK_ALLOC_ADD(&new_size, new_size, 1);
|
469
|
+
ENSURE_SIZE(buf, new_size);
|
470
|
+
|
471
|
+
for (str_pos = 0; str_pos < str_len; buf->size++, str_pos++) {
|
472
|
+
if (str[str_pos] == '%' &&
|
473
|
+
str_len > str_pos + 2 &&
|
474
|
+
isxdigit(str[str_pos + 1]) &&
|
475
|
+
isxdigit(str[str_pos + 2])) {
|
476
|
+
buf->ptr[buf->size] = (HEX_DECODE(str[str_pos + 1]) << 4) +
|
477
|
+
HEX_DECODE(str[str_pos + 2]);
|
478
|
+
str_pos += 2;
|
479
|
+
} else {
|
480
|
+
buf->ptr[buf->size] = str[str_pos];
|
481
|
+
}
|
482
|
+
}
|
483
|
+
|
484
|
+
buf->ptr[buf->size] = '\0';
|
485
|
+
return 0;
|
486
|
+
}
|
487
|
+
|
458
488
|
int git_buf_vprintf(git_buf *buf, const char *format, va_list ap)
|
459
489
|
{
|
460
490
|
size_t expected_size, new_size;
|
data/vendor/libgit2/src/buffer.h
CHANGED
@@ -190,6 +190,9 @@ int git_buf_encode_base85(git_buf *buf, const char *data, size_t len);
|
|
190
190
|
/* Decode the given "base85" and write the result to the buffer */
|
191
191
|
int git_buf_decode_base85(git_buf *buf, const char *base64, size_t len, size_t output_len);
|
192
192
|
|
193
|
+
/* Decode the given percent-encoded string and write the result to the buffer */
|
194
|
+
int git_buf_decode_percent(git_buf *buf, const char *str, size_t len);
|
195
|
+
|
193
196
|
/*
|
194
197
|
* Insert, remove or replace a portion of the buffer.
|
195
198
|
*
|
data/vendor/libgit2/src/cache.c
CHANGED
@@ -5,12 +5,12 @@
|
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
6
6
|
*/
|
7
7
|
|
8
|
-
#include "
|
8
|
+
#include "cache.h"
|
9
|
+
|
9
10
|
#include "repository.h"
|
10
11
|
#include "commit.h"
|
11
12
|
#include "thread-utils.h"
|
12
13
|
#include "util.h"
|
13
|
-
#include "cache.h"
|
14
14
|
#include "odb.h"
|
15
15
|
#include "object.h"
|
16
16
|
#include "git2/oid.h"
|
data/vendor/libgit2/src/cache.h
CHANGED
@@ -4,8 +4,8 @@
|
|
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_cc_compat_h__
|
8
|
+
#define INCLUDE_cc_compat_h__
|
9
9
|
|
10
10
|
#include <stdarg.h>
|
11
11
|
|
@@ -84,4 +84,4 @@
|
|
84
84
|
# endif
|
85
85
|
#endif
|
86
86
|
|
87
|
-
#endif
|
87
|
+
#endif
|
@@ -5,10 +5,10 @@
|
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
6
6
|
*/
|
7
7
|
|
8
|
-
#include <assert.h>
|
9
|
-
|
10
8
|
#include "checkout.h"
|
11
9
|
|
10
|
+
#include <assert.h>
|
11
|
+
|
12
12
|
#include "git2/repository.h"
|
13
13
|
#include "git2/refs.h"
|
14
14
|
#include "git2/tree.h"
|
@@ -70,6 +70,7 @@ typedef struct {
|
|
70
70
|
git_buf tmp;
|
71
71
|
unsigned int strategy;
|
72
72
|
int can_symlink;
|
73
|
+
int respect_filemode;
|
73
74
|
bool reload_submodules;
|
74
75
|
size_t total_steps;
|
75
76
|
size_t completed_steps;
|
@@ -159,17 +160,20 @@ GIT_INLINE(bool) is_workdir_base_or_new(
|
|
159
160
|
git_oid__cmp(&newitem->id, workdir_id) == 0);
|
160
161
|
}
|
161
162
|
|
162
|
-
GIT_INLINE(bool)
|
163
|
+
GIT_INLINE(bool) is_filemode_changed(git_filemode_t a, git_filemode_t b, int respect_filemode)
|
163
164
|
{
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
165
|
+
/* If core.filemode = false, ignore links in the repository and executable bit changes */
|
166
|
+
if (!respect_filemode) {
|
167
|
+
if (a == S_IFLNK)
|
168
|
+
a = GIT_FILEMODE_BLOB;
|
169
|
+
if (b == S_IFLNK)
|
170
|
+
b = GIT_FILEMODE_BLOB;
|
171
|
+
|
172
|
+
a &= ~0111;
|
173
|
+
b &= ~0111;
|
174
|
+
}
|
175
|
+
|
176
|
+
return (a != b);
|
173
177
|
}
|
174
178
|
|
175
179
|
static bool checkout_is_workdir_modified(
|
@@ -217,11 +221,11 @@ static bool checkout_is_workdir_modified(
|
|
217
221
|
if (ie != NULL &&
|
218
222
|
git_index_time_eq(&wditem->mtime, &ie->mtime) &&
|
219
223
|
wditem->file_size == ie->file_size &&
|
220
|
-
!
|
224
|
+
!is_filemode_changed(wditem->mode, ie->mode, data->respect_filemode)) {
|
221
225
|
|
222
226
|
/* The workdir is modified iff the index entry is modified */
|
223
227
|
return !is_workdir_base_or_new(&ie->id, baseitem, newitem) ||
|
224
|
-
|
228
|
+
is_filemode_changed(baseitem->mode, ie->mode, data->respect_filemode);
|
225
229
|
}
|
226
230
|
|
227
231
|
/* depending on where base is coming from, we may or may not know
|
@@ -234,7 +238,7 @@ static bool checkout_is_workdir_modified(
|
|
234
238
|
if (S_ISDIR(wditem->mode))
|
235
239
|
return false;
|
236
240
|
|
237
|
-
if (
|
241
|
+
if (is_filemode_changed(baseitem->mode, wditem->mode, data->respect_filemode))
|
238
242
|
return true;
|
239
243
|
|
240
244
|
if (git_diff__oid_for_entry(&oid, data->diff, wditem, wditem->mode, NULL) < 0)
|
@@ -1272,14 +1276,14 @@ static int checkout_verify_paths(
|
|
1272
1276
|
unsigned int flags = GIT_PATH_REJECT_WORKDIR_DEFAULTS;
|
1273
1277
|
|
1274
1278
|
if (action & CHECKOUT_ACTION__REMOVE) {
|
1275
|
-
if (!git_path_isvalid(repo, delta->old_file.path,
|
1279
|
+
if (!git_path_isvalid(repo, delta->old_file.path, flags)) {
|
1276
1280
|
giterr_set(GITERR_CHECKOUT, "cannot remove invalid path '%s'", delta->old_file.path);
|
1277
1281
|
return -1;
|
1278
1282
|
}
|
1279
1283
|
}
|
1280
1284
|
|
1281
1285
|
if (action & ~CHECKOUT_ACTION__REMOVE) {
|
1282
|
-
if (!git_path_isvalid(repo, delta->new_file.path,
|
1286
|
+
if (!git_path_isvalid(repo, delta->new_file.path, flags)) {
|
1283
1287
|
giterr_set(GITERR_CHECKOUT, "cannot checkout to invalid path '%s'", delta->new_file.path);
|
1284
1288
|
return -1;
|
1285
1289
|
}
|
@@ -2028,8 +2032,11 @@ static int checkout_write_entry(
|
|
2028
2032
|
(error = checkout_safe_for_update_only(data, fullpath->ptr, side->mode)) <= 0)
|
2029
2033
|
return error;
|
2030
2034
|
|
2031
|
-
|
2032
|
-
|
2035
|
+
if (!S_ISGITLINK(side->mode))
|
2036
|
+
return checkout_write_content(data,
|
2037
|
+
&side->id, fullpath->ptr, hint_path, side->mode, &st);
|
2038
|
+
|
2039
|
+
return 0;
|
2033
2040
|
}
|
2034
2041
|
|
2035
2042
|
static int checkout_write_entries(
|
@@ -2451,6 +2458,10 @@ static int checkout_data_init(
|
|
2451
2458
|
&data->can_symlink, repo, GIT_CVAR_SYMLINKS)) < 0)
|
2452
2459
|
goto cleanup;
|
2453
2460
|
|
2461
|
+
if ((error = git_repository__cvar(
|
2462
|
+
&data->respect_filemode, repo, GIT_CVAR_FILEMODE)) < 0)
|
2463
|
+
goto cleanup;
|
2464
|
+
|
2454
2465
|
if (!data->opts.baseline && !data->opts.baseline_index) {
|
2455
2466
|
data->opts_free_baseline = true;
|
2456
2467
|
error = 0;
|