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
@@ -7,22 +7,17 @@
|
|
7
7
|
#ifndef INCLUDE_patch_parse_h__
|
8
8
|
#define INCLUDE_patch_parse_h__
|
9
9
|
|
10
|
+
#include "common.h"
|
11
|
+
|
12
|
+
#include "parse.h"
|
13
|
+
#include "patch.h"
|
14
|
+
|
10
15
|
typedef struct {
|
11
16
|
git_refcount rc;
|
12
17
|
|
13
|
-
/* Original content buffer */
|
14
|
-
const char *content;
|
15
|
-
size_t content_len;
|
16
|
-
|
17
18
|
git_patch_options opts;
|
18
19
|
|
19
|
-
|
20
|
-
const char *remain;
|
21
|
-
size_t remain_len;
|
22
|
-
|
23
|
-
const char *line;
|
24
|
-
size_t line_len;
|
25
|
-
size_t line_num;
|
20
|
+
git_parse_ctx parse_ctx;
|
26
21
|
} git_patch_parse_ctx;
|
27
22
|
|
28
23
|
extern git_patch_parse_ctx *git_patch_parse_ctx_init(
|
data/vendor/libgit2/src/path.c
CHANGED
@@ -4,8 +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
|
-
|
7
|
+
|
8
8
|
#include "path.h"
|
9
|
+
|
9
10
|
#include "posix.h"
|
10
11
|
#include "repository.h"
|
11
12
|
#ifdef GIT_WIN32
|
@@ -1560,31 +1561,18 @@ static int32_t next_hfs_char(const char **in, size_t *len)
|
|
1560
1561
|
return 0; /* NULL byte -- end of string */
|
1561
1562
|
}
|
1562
1563
|
|
1563
|
-
static bool
|
1564
|
+
static bool verify_dotgit_hfs(const char *path, size_t len)
|
1564
1565
|
{
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
for (i = 0; i < needle_len; i++) {
|
1572
|
-
c = next_hfs_char(&path, &len);
|
1573
|
-
if (c != needle[i])
|
1574
|
-
return true;
|
1575
|
-
}
|
1576
|
-
|
1577
|
-
if (next_hfs_char(&path, &len) != '\0')
|
1566
|
+
if (next_hfs_char(&path, &len) != '.' ||
|
1567
|
+
next_hfs_char(&path, &len) != 'g' ||
|
1568
|
+
next_hfs_char(&path, &len) != 'i' ||
|
1569
|
+
next_hfs_char(&path, &len) != 't' ||
|
1570
|
+
next_hfs_char(&path, &len) != 0)
|
1578
1571
|
return true;
|
1579
1572
|
|
1580
1573
|
return false;
|
1581
1574
|
}
|
1582
1575
|
|
1583
|
-
static bool verify_dotgit_hfs(const char *path, size_t len)
|
1584
|
-
{
|
1585
|
-
return verify_dotgit_hfs_generic(path, len, "git", CONST_STRLEN("git"));
|
1586
|
-
}
|
1587
|
-
|
1588
1576
|
GIT_INLINE(bool) verify_dotgit_ntfs(git_repository *repo, const char *path, size_t len)
|
1589
1577
|
{
|
1590
1578
|
git_buf *reserved = git_repository__reserved_names_win32;
|
@@ -1620,57 +1608,6 @@ GIT_INLINE(bool) verify_dotgit_ntfs(git_repository *repo, const char *path, size
|
|
1620
1608
|
return false;
|
1621
1609
|
}
|
1622
1610
|
|
1623
|
-
GIT_INLINE(bool) only_spaces_and_dots(const char *path)
|
1624
|
-
{
|
1625
|
-
const char *c = path;
|
1626
|
-
|
1627
|
-
for (;; c++) {
|
1628
|
-
if (*c == '\0')
|
1629
|
-
return true;
|
1630
|
-
if (*c != ' ' && *c != '.')
|
1631
|
-
return false;
|
1632
|
-
}
|
1633
|
-
|
1634
|
-
return true;
|
1635
|
-
}
|
1636
|
-
|
1637
|
-
GIT_INLINE(bool) verify_dotgit_ntfs_generic(const char *name, size_t len, const char *dotgit_name, size_t dotgit_len, const char *shortname_pfix)
|
1638
|
-
{
|
1639
|
-
int i, saw_tilde;
|
1640
|
-
|
1641
|
-
if (name[0] == '.' && len >= dotgit_len &&
|
1642
|
-
!strncasecmp(name + 1, dotgit_name, dotgit_len)) {
|
1643
|
-
return !only_spaces_and_dots(name + dotgit_len + 1);
|
1644
|
-
}
|
1645
|
-
|
1646
|
-
/* Detect the basic NTFS shortname with the first six chars */
|
1647
|
-
if (!strncasecmp(name, dotgit_name, 6) && name[6] == '~' &&
|
1648
|
-
name[7] >= '1' && name[7] <= '4')
|
1649
|
-
return !only_spaces_and_dots(name + 8);
|
1650
|
-
|
1651
|
-
/* Catch fallback names */
|
1652
|
-
for (i = 0, saw_tilde = 0; i < 8; i++) {
|
1653
|
-
if (name[i] == '\0') {
|
1654
|
-
return true;
|
1655
|
-
} else if (saw_tilde) {
|
1656
|
-
if (name[i] < '0' || name[i] > '9')
|
1657
|
-
return true;
|
1658
|
-
} else if (name[i] == '~') {
|
1659
|
-
if (name[i+1] < '1' || name[i+1] > '9')
|
1660
|
-
return true;
|
1661
|
-
saw_tilde = 1;
|
1662
|
-
} else if (i >= 6) {
|
1663
|
-
return true;
|
1664
|
-
} else if (name[i] < 0) {
|
1665
|
-
return true;
|
1666
|
-
} else if (git__tolower(name[i]) != shortname_pfix[i]) {
|
1667
|
-
return true;
|
1668
|
-
}
|
1669
|
-
}
|
1670
|
-
|
1671
|
-
return !only_spaces_and_dots(name + i);
|
1672
|
-
}
|
1673
|
-
|
1674
1611
|
GIT_INLINE(bool) verify_char(unsigned char c, unsigned int flags)
|
1675
1612
|
{
|
1676
1613
|
if ((flags & GIT_PATH_REJECT_BACKSLASH) && c == '\\')
|
@@ -1698,24 +1635,6 @@ GIT_INLINE(bool) verify_char(unsigned char c, unsigned int flags)
|
|
1698
1635
|
return true;
|
1699
1636
|
}
|
1700
1637
|
|
1701
|
-
/*
|
1702
|
-
* Return the length of the common prefix between str and prefix, comparing them
|
1703
|
-
* case-insensitively (must be ASCII to match).
|
1704
|
-
*/
|
1705
|
-
GIT_INLINE(size_t) common_prefix_icase(const char *str, size_t len, const char *prefix)
|
1706
|
-
{
|
1707
|
-
size_t count = 0;
|
1708
|
-
|
1709
|
-
while (len >0 && tolower(*str) == tolower(*prefix)) {
|
1710
|
-
count++;
|
1711
|
-
str++;
|
1712
|
-
prefix++;
|
1713
|
-
len--;
|
1714
|
-
}
|
1715
|
-
|
1716
|
-
return count;
|
1717
|
-
}
|
1718
|
-
|
1719
1638
|
/*
|
1720
1639
|
* We fundamentally don't like some paths when dealing with user-inputted
|
1721
1640
|
* strings (in checkout or ref names): we don't want dot or dot-dot
|
@@ -1729,7 +1648,6 @@ static bool verify_component(
|
|
1729
1648
|
git_repository *repo,
|
1730
1649
|
const char *component,
|
1731
1650
|
size_t len,
|
1732
|
-
uint16_t mode,
|
1733
1651
|
unsigned int flags)
|
1734
1652
|
{
|
1735
1653
|
if (len == 0)
|
@@ -1762,38 +1680,26 @@ static bool verify_component(
|
|
1762
1680
|
return false;
|
1763
1681
|
}
|
1764
1682
|
|
1765
|
-
if (flags & GIT_PATH_REJECT_DOT_GIT_HFS
|
1766
|
-
|
1767
|
-
|
1768
|
-
if (S_ISLNK(mode) && git_path_is_hfs_dotgit_modules(component, len))
|
1769
|
-
return false;
|
1770
|
-
}
|
1683
|
+
if (flags & GIT_PATH_REJECT_DOT_GIT_HFS &&
|
1684
|
+
!verify_dotgit_hfs(component, len))
|
1685
|
+
return false;
|
1771
1686
|
|
1772
|
-
if (flags & GIT_PATH_REJECT_DOT_GIT_NTFS
|
1773
|
-
|
1774
|
-
|
1775
|
-
if (S_ISLNK(mode) && git_path_is_ntfs_dotgit_modules(component, len))
|
1776
|
-
return false;
|
1777
|
-
}
|
1687
|
+
if (flags & GIT_PATH_REJECT_DOT_GIT_NTFS &&
|
1688
|
+
!verify_dotgit_ntfs(repo, component, len))
|
1689
|
+
return false;
|
1778
1690
|
|
1779
1691
|
/* don't bother rerunning the `.git` test if we ran the HFS or NTFS
|
1780
1692
|
* specific tests, they would have already rejected `.git`.
|
1781
1693
|
*/
|
1782
1694
|
if ((flags & GIT_PATH_REJECT_DOT_GIT_HFS) == 0 &&
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
-
return false;
|
1792
|
-
|
1793
|
-
if (S_ISLNK(mode) && common_prefix_icase(component, len, ".gitmodules") == len)
|
1794
|
-
return false;
|
1795
|
-
}
|
1796
|
-
}
|
1695
|
+
(flags & GIT_PATH_REJECT_DOT_GIT_NTFS) == 0 &&
|
1696
|
+
(flags & GIT_PATH_REJECT_DOT_GIT_LITERAL) &&
|
1697
|
+
len == 4 &&
|
1698
|
+
component[0] == '.' &&
|
1699
|
+
(component[1] == 'g' || component[1] == 'G') &&
|
1700
|
+
(component[2] == 'i' || component[2] == 'I') &&
|
1701
|
+
(component[3] == 't' || component[3] == 'T'))
|
1702
|
+
return false;
|
1797
1703
|
|
1798
1704
|
return true;
|
1799
1705
|
}
|
@@ -1831,7 +1737,6 @@ GIT_INLINE(unsigned int) dotgit_flags(
|
|
1831
1737
|
bool git_path_isvalid(
|
1832
1738
|
git_repository *repo,
|
1833
1739
|
const char *path,
|
1834
|
-
uint16_t mode,
|
1835
1740
|
unsigned int flags)
|
1836
1741
|
{
|
1837
1742
|
const char *start, *c;
|
@@ -1845,14 +1750,14 @@ bool git_path_isvalid(
|
|
1845
1750
|
return false;
|
1846
1751
|
|
1847
1752
|
if (*c == '/') {
|
1848
|
-
if (!verify_component(repo, start, (c - start),
|
1753
|
+
if (!verify_component(repo, start, (c - start), flags))
|
1849
1754
|
return false;
|
1850
1755
|
|
1851
1756
|
start = c+1;
|
1852
1757
|
}
|
1853
1758
|
}
|
1854
1759
|
|
1855
|
-
return verify_component(repo, start, (c - start),
|
1760
|
+
return verify_component(repo, start, (c - start), flags);
|
1856
1761
|
}
|
1857
1762
|
|
1858
1763
|
int git_path_normalize_slashes(git_buf *out, const char *path)
|
@@ -1870,65 +1775,3 @@ int git_path_normalize_slashes(git_buf *out, const char *path)
|
|
1870
1775
|
|
1871
1776
|
return 0;
|
1872
1777
|
}
|
1873
|
-
|
1874
|
-
static int verify_dotgit_generic(const char *name, size_t len, const char *dotgit_name, size_t dotgit_len, const char *shortname_pfix)
|
1875
|
-
{
|
1876
|
-
if (!verify_dotgit_ntfs_generic(name, len, dotgit_name, dotgit_len, shortname_pfix))
|
1877
|
-
return false;
|
1878
|
-
|
1879
|
-
return verify_dotgit_hfs_generic(name, len, dotgit_name, dotgit_len);
|
1880
|
-
}
|
1881
|
-
|
1882
|
-
int git_path_is_ntfs_dotgit_modules(const char *name, size_t len)
|
1883
|
-
{
|
1884
|
-
return !verify_dotgit_ntfs_generic(name, len, "gitmodules", CONST_STRLEN("gitmodules"), "gi7eba");
|
1885
|
-
}
|
1886
|
-
|
1887
|
-
int git_path_is_hfs_dotgit_modules(const char *name, size_t len)
|
1888
|
-
{
|
1889
|
-
return !verify_dotgit_hfs_generic(name, len, "gitmodules", CONST_STRLEN("gitmodules"));
|
1890
|
-
}
|
1891
|
-
|
1892
|
-
int git_path_is_dotgit_modules(const char *name, size_t len)
|
1893
|
-
{
|
1894
|
-
if (git_path_is_hfs_dotgit_modules(name, len))
|
1895
|
-
return 1;
|
1896
|
-
|
1897
|
-
return git_path_is_ntfs_dotgit_modules(name, len);
|
1898
|
-
}
|
1899
|
-
|
1900
|
-
int git_path_is_ntfs_dotgit_ignore(const char *name, size_t len)
|
1901
|
-
{
|
1902
|
-
return !verify_dotgit_ntfs_generic(name, len, "gitignore", CONST_STRLEN("gitignore"), "gi250a");
|
1903
|
-
}
|
1904
|
-
|
1905
|
-
int git_path_is_hfs_dotgit_ignore(const char *name, size_t len)
|
1906
|
-
{
|
1907
|
-
return !verify_dotgit_hfs_generic(name, len, "gitignore", CONST_STRLEN("gitignore"));
|
1908
|
-
}
|
1909
|
-
|
1910
|
-
int git_path_is_dotgit_ignore(const char *name, size_t len)
|
1911
|
-
{
|
1912
|
-
if (git_path_is_hfs_dotgit_ignore(name, len))
|
1913
|
-
return 1;
|
1914
|
-
|
1915
|
-
return git_path_is_ntfs_dotgit_ignore(name, len);
|
1916
|
-
}
|
1917
|
-
|
1918
|
-
int git_path_is_hfs_dotgit_attributes(const char *name, size_t len)
|
1919
|
-
{
|
1920
|
-
return !verify_dotgit_hfs_generic(name, len, "gitattributes", CONST_STRLEN("gitattributes"));
|
1921
|
-
}
|
1922
|
-
|
1923
|
-
int git_path_is_ntfs_dotgit_attributes(const char *name, size_t len)
|
1924
|
-
{
|
1925
|
-
return !verify_dotgit_ntfs_generic(name, len, "gitattributes", CONST_STRLEN("gitattributes"), "gi7d29");
|
1926
|
-
}
|
1927
|
-
|
1928
|
-
int git_path_is_dotgit_attributes(const char *name, size_t len)
|
1929
|
-
{
|
1930
|
-
if (git_path_is_hfs_dotgit_attributes(name, len))
|
1931
|
-
return 1;
|
1932
|
-
|
1933
|
-
return git_path_is_ntfs_dotgit_attributes(name, len);
|
1934
|
-
}
|
data/vendor/libgit2/src/path.h
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
#define INCLUDE_path_h__
|
9
9
|
|
10
10
|
#include "common.h"
|
11
|
+
|
11
12
|
#include "posix.h"
|
12
13
|
#include "buffer.h"
|
13
14
|
#include "vector.h"
|
@@ -104,6 +105,12 @@ GIT_INLINE(int) git_path_is_dot_or_dotdotW(const wchar_t *name)
|
|
104
105
|
(name[1] == L'.' && name[2] == L'\0')));
|
105
106
|
}
|
106
107
|
|
108
|
+
#define git_path_is_absolute(p) \
|
109
|
+
(git__isalpha((p)[0]) && (p)[1] == ':' && ((p)[2] == '\\' || (p)[2] == '/'))
|
110
|
+
|
111
|
+
#define git_path_is_dirsep(p) \
|
112
|
+
((p) == '/' || (p) == '\\')
|
113
|
+
|
107
114
|
/**
|
108
115
|
* Convert backslashes in path to forward slashes.
|
109
116
|
*/
|
@@ -118,6 +125,13 @@ GIT_INLINE(void) git_path_mkposix(char *path)
|
|
118
125
|
}
|
119
126
|
#else
|
120
127
|
# define git_path_mkposix(p) /* blank */
|
128
|
+
|
129
|
+
#define git_path_is_absolute(p) \
|
130
|
+
((p)[0] == '/')
|
131
|
+
|
132
|
+
#define git_path_is_dirsep(p) \
|
133
|
+
((p) == '/')
|
134
|
+
|
121
135
|
#endif
|
122
136
|
|
123
137
|
/**
|
@@ -623,7 +637,6 @@ extern int git_path_from_url_or_path(git_buf *local_path_out, const char *url_or
|
|
623
637
|
extern bool git_path_isvalid(
|
624
638
|
git_repository *repo,
|
625
639
|
const char *path,
|
626
|
-
uint16_t mode,
|
627
640
|
unsigned int flags);
|
628
641
|
|
629
642
|
/**
|
@@ -631,76 +644,4 @@ extern bool git_path_isvalid(
|
|
631
644
|
*/
|
632
645
|
int git_path_normalize_slashes(git_buf *out, const char *path);
|
633
646
|
|
634
|
-
/**
|
635
|
-
* Check whether a path component corresponds to a .gitmodules file
|
636
|
-
*
|
637
|
-
* @param name the path component to check
|
638
|
-
* @param len the length of `name`
|
639
|
-
*/
|
640
|
-
extern int git_path_is_dotgit_modules(const char *name, size_t len);
|
641
|
-
|
642
|
-
/**
|
643
|
-
* Check whether a path component corresponds to a .gitmodules file in NTFS
|
644
|
-
*
|
645
|
-
* @param name the path component to check
|
646
|
-
* @param len the length of `name`
|
647
|
-
*/
|
648
|
-
extern int git_path_is_ntfs_dotgit_modules(const char *name, size_t len);
|
649
|
-
|
650
|
-
/**
|
651
|
-
* Check whether a path component corresponds to a .gitmodules file in HFS+
|
652
|
-
*
|
653
|
-
* @param name the path component to check
|
654
|
-
* @param len the length of `name`
|
655
|
-
*/
|
656
|
-
extern int git_path_is_hfs_dotgit_modules(const char *name, size_t len);
|
657
|
-
|
658
|
-
/**
|
659
|
-
* Check whether a path component corresponds to a .gitignore file
|
660
|
-
*
|
661
|
-
* @param name the path component to check
|
662
|
-
* @param len the length of `name`
|
663
|
-
*/
|
664
|
-
extern int git_path_is_dotgit_ignore(const char *name, size_t len);
|
665
|
-
|
666
|
-
/**
|
667
|
-
* Check whether a path component corresponds to a .gitignore file in NTFS
|
668
|
-
*
|
669
|
-
* @param name the path component to check
|
670
|
-
* @param len the length of `name`
|
671
|
-
*/
|
672
|
-
extern int git_path_is_ntfs_dotgit_ignore(const char *name, size_t len);
|
673
|
-
|
674
|
-
/**
|
675
|
-
* Check whether a path component corresponds to a .gitignore file in HFS+
|
676
|
-
*
|
677
|
-
* @param name the path component to check
|
678
|
-
* @param len the length of `name`
|
679
|
-
*/
|
680
|
-
extern int git_path_is_hfs_dotgit_ignore(const char *name, size_t len);
|
681
|
-
|
682
|
-
/**
|
683
|
-
* Check whether a path component corresponds to a .gitignore file
|
684
|
-
*
|
685
|
-
* @param name the path component to check
|
686
|
-
* @param len the length of `name`
|
687
|
-
*/
|
688
|
-
extern int git_path_is_dotgit_attributes(const char *name, size_t len);
|
689
|
-
|
690
|
-
/**
|
691
|
-
* Check whether a path component corresponds to a .gitattributes file in NTFS
|
692
|
-
*
|
693
|
-
* @param name the path component to check
|
694
|
-
* @param len the length of `name`
|
695
|
-
*/
|
696
|
-
extern int git_path_is_ntfs_dotgit_attributes(const char *name, size_t len);
|
697
|
-
|
698
|
-
/**
|
699
|
-
* Check whether a path component corresponds to a .gitattributes file in HFS+
|
700
|
-
*
|
701
|
-
* @param name the path component to check
|
702
|
-
* @param len the length of `name`
|
703
|
-
*/
|
704
|
-
extern int git_path_is_hfs_dotgit_attributes(const char *name, size_t len);
|
705
|
-
|
706
647
|
#endif
|
@@ -5,9 +5,10 @@
|
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
6
6
|
*/
|
7
7
|
|
8
|
+
#include "pathspec.h"
|
9
|
+
|
8
10
|
#include "git2/pathspec.h"
|
9
11
|
#include "git2/diff.h"
|
10
|
-
#include "pathspec.h"
|
11
12
|
#include "buf_text.h"
|
12
13
|
#include "attr_file.h"
|
13
14
|
#include "iterator.h"
|