rugged 0.17.0b2 → 0.17.0.b6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +10 -11
- data/ext/rugged/extconf.rb +5 -13
- data/ext/rugged/rugged_commit.c +2 -5
- data/ext/rugged/rugged_reference.c +29 -28
- data/ext/rugged/rugged_remote.c +1 -1
- data/ext/rugged/rugged_repo.c +4 -1
- data/ext/rugged/rugged_tree.c +20 -19
- data/lib/rugged/commit.rb +5 -1
- data/lib/rugged/repository.rb +6 -4
- data/lib/rugged/version.rb +1 -1
- data/test/config_test.rb +1 -1
- data/test/index_test.rb +4 -2
- data/test/object_test.rb +3 -3
- data/test/reference_test.rb +66 -1
- data/test/repo_test.rb +4 -4
- data/test/tree_test.rb +1 -1
- data/test/walker_test.rb +1 -1
- data/vendor/libgit2/Makefile.embed +42 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/http-parser/http_parser.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/http-parser/http_parser.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/config.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/regcomp.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/regex.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/regex.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/regex_internal.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/regex_internal.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/regexec.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/adler32.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/crc32.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/crc32.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/deflate.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/deflate.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inffast.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inffast.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inffixed.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inflate.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inflate.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inftrees.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inftrees.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/trees.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/trees.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/zconf.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/zlib.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/zutil.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/zutil.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2.h +6 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/attr.h +35 -20
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/blob.h +1 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/branch.h +62 -24
- data/vendor/libgit2/include/git2/checkout.h +66 -0
- data/vendor/libgit2/include/git2/clone.h +59 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/commit.h +22 -3
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/common.h +27 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/config.h +22 -4
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/diff.h +20 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/errors.h +2 -37
- data/vendor/libgit2/include/git2/ignore.h +74 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/index.h +37 -5
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/indexer.h +2 -2
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/inttypes.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/merge.h +10 -0
- data/vendor/libgit2/include/git2/message.h +43 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/net.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/notes.h +24 -20
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/object.h +18 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/odb.h +16 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/odb_backend.h +8 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/oid.h +26 -2
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/reflog.h +39 -9
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/refs.h +55 -3
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/refspec.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/remote.h +68 -2
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/repository.h +39 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/reset.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/revparse.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/revwalk.h +2 -2
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/signature.h +3 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/status.h +5 -2
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/stdint.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/submodule.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/tag.h +3 -3
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/threads.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/tree.h +77 -20
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/types.h +14 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/version.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/windows.h +0 -0
- data/vendor/libgit2/src/amiga/map.c +51 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/attr.c +39 -6
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/attr.h +1 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/attr_file.c +2 -16
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/attr_file.h +4 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/blob.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/blob.h +0 -0
- data/vendor/libgit2/src/branch.c +294 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/bswap.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/buffer.c +40 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/buffer.h +22 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/cache.c +1 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/cache.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/cc-compat.h +0 -0
- data/vendor/libgit2/src/checkout.c +230 -0
- data/vendor/libgit2/src/clone.c +254 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/commit.c +42 -16
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/commit.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/common.h +3 -9
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/compat/fnmatch.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/compat/fnmatch.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/config.c +15 -5
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/config.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/config_cache.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/config_file.c +86 -19
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/config_file.h +16 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/crlf.c +92 -4
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/date.c +20 -20
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/delta-apply.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/delta-apply.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/diff.c +45 -18
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/diff.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/diff_output.c +63 -46
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/errors.c +0 -0
- data/vendor/libgit2/src/fetch.c +380 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/fetch.h +1 -2
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/filebuf.c +7 -2
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/filebuf.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/fileops.c +16 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/fileops.h +10 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/filter.c +38 -2
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/filter.h +15 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/global.c +5 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/global.h +2 -6
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/hash.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/hash.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/ignore.c +50 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/ignore.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/index.c +95 -28
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/index.h +5 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/indexer.c +27 -25
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/iterator.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/iterator.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/khash.h +6 -4
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/map.h +4 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/message.c +27 -2
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/message.h +2 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/mwindow.c +54 -10
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/mwindow.h +1 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/netops.c +48 -38
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/netops.h +7 -4
- data/vendor/libgit2/src/notes.c +610 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/notes.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/object.c +73 -2
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/odb.c +20 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/odb.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/odb_loose.c +89 -3
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/odb_pack.c +61 -3
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/oid.c +1 -6
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/oidmap.h +1 -6
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pack.c +49 -4
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pack.h +5 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/path.c +144 -21
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/path.h +46 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pkt.c +30 -8
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pkt.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pool.c +7 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pool.h +7 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/posix.c +92 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/posix.h +36 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/ppc/sha1.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/ppc/sha1.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pqueue.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pqueue.h +0 -0
- data/vendor/libgit2/src/protocol.c +88 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/protocol.h +3 -9
- data/vendor/libgit2/src/reflog.c +489 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/reflog.h +3 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/refs.c +95 -52
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/refs.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/refspec.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/refspec.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/remote.c +130 -8
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/remote.h +6 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/repository.c +167 -42
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/repository.h +7 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/reset.c +1 -1
- data/vendor/libgit2/src/revparse.c +830 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/revwalk.c +83 -15
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/sha1.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/sha1.h +5 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/sha1_lookup.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/sha1_lookup.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/signature.c +19 -5
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/signature.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/status.c +24 -18
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/strmap.h +1 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/submodule.c +3 -3
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tag.c +2 -9
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tag.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/thread-utils.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/thread-utils.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/transport.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/transport.h +13 -9
- data/vendor/libgit2/src/transports/git.c +245 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/transports/http.c +93 -336
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/transports/local.c +35 -32
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tree-cache.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tree-cache.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tree.c +214 -124
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tree.h +7 -3
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tsort.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/unix/map.c +2 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/unix/posix.h +2 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/util.c +30 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/util.h +13 -6
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/vector.c +1 -1
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/vector.h +5 -5
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/dir.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/dir.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/map.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/mingw-compat.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/msvc-compat.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/posix.h +1 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/posix_w32.c +17 -1
- data/vendor/libgit2/src/win32/precompiled.c +1 -0
- data/vendor/libgit2/src/win32/precompiled.h +19 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/pthread.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/pthread.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/utf-conv.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/utf-conv.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xdiff.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xdiffi.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xdiffi.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xemit.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xemit.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xhistogram.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xinclude.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xmacros.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xmerge.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xpatience.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xprepare.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xprepare.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xtypes.h +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xutils.c +0 -0
- data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xutils.h +0 -0
- metadata +265 -348
- data/ext/rugged/vendor/libgit2-dist.tar.gz +0 -0
- data/ext/rugged/vendor/libgit2-dist/examples/diff.c +0 -238
- data/ext/rugged/vendor/libgit2-dist/examples/general.c +0 -451
- data/ext/rugged/vendor/libgit2-dist/examples/network/common.h +0 -14
- data/ext/rugged/vendor/libgit2-dist/examples/network/fetch.c +0 -113
- data/ext/rugged/vendor/libgit2-dist/examples/network/git2.c +0 -62
- data/ext/rugged/vendor/libgit2-dist/examples/network/index-pack.c +0 -102
- data/ext/rugged/vendor/libgit2-dist/examples/network/ls-remote.c +0 -76
- data/ext/rugged/vendor/libgit2-dist/examples/showindex.c +0 -43
- data/ext/rugged/vendor/libgit2-dist/src/branch.c +0 -208
- data/ext/rugged/vendor/libgit2-dist/src/branch.h +0 -17
- data/ext/rugged/vendor/libgit2-dist/src/fetch.c +0 -200
- data/ext/rugged/vendor/libgit2-dist/src/notes.c +0 -548
- data/ext/rugged/vendor/libgit2-dist/src/protocol.c +0 -58
- data/ext/rugged/vendor/libgit2-dist/src/reflog.c +0 -340
- data/ext/rugged/vendor/libgit2-dist/src/revparse.c +0 -748
- data/ext/rugged/vendor/libgit2-dist/src/transports/git.c +0 -477
- data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/attr_expect.h +0 -43
- data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/file.c +0 -226
- data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/flags.c +0 -108
- data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/lookup.c +0 -262
- data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/repo.c +0 -273
- data/ext/rugged/vendor/libgit2-dist/tests-clar/buf/basic.c +0 -29
- data/ext/rugged/vendor/libgit2-dist/tests-clar/clar_helpers.c +0 -181
- data/ext/rugged/vendor/libgit2-dist/tests-clar/clar_libgit2.h +0 -55
- data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/commit.c +0 -44
- data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/parse.c +0 -350
- data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/signature.c +0 -65
- data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/write.c +0 -140
- data/ext/rugged/vendor/libgit2-dist/tests-clar/config/add.c +0 -37
- data/ext/rugged/vendor/libgit2-dist/tests-clar/config/multivar.c +0 -151
- data/ext/rugged/vendor/libgit2-dist/tests-clar/config/new.c +0 -36
- data/ext/rugged/vendor/libgit2-dist/tests-clar/config/read.c +0 -221
- data/ext/rugged/vendor/libgit2-dist/tests-clar/config/stress.c +0 -61
- data/ext/rugged/vendor/libgit2-dist/tests-clar/config/write.c +0 -92
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/buffer.c +0 -613
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/dirent.c +0 -235
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/env.c +0 -115
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/errors.c +0 -60
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/filebuf.c +0 -92
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/hex.c +0 -22
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/oid.c +0 -18
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/path.c +0 -420
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/pool.c +0 -85
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/rmdir.c +0 -68
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/string.c +0 -28
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/strmap.c +0 -102
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/strtol.c +0 -37
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/vector.c +0 -191
- data/ext/rugged/vendor/libgit2-dist/tests-clar/date/date.c +0 -15
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/blob.c +0 -254
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/diff_helpers.c +0 -104
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/diff_helpers.h +0 -47
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/index.c +0 -92
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/iterator.c +0 -572
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/patch.c +0 -99
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/tree.c +0 -210
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/workdir.c +0 -543
- data/ext/rugged/vendor/libgit2-dist/tests-clar/index/read_tree.c +0 -46
- data/ext/rugged/vendor/libgit2-dist/tests-clar/index/rename.c +0 -50
- data/ext/rugged/vendor/libgit2-dist/tests-clar/index/tests.c +0 -246
- data/ext/rugged/vendor/libgit2-dist/tests-clar/network/createremotethenload.c +0 -33
- data/ext/rugged/vendor/libgit2-dist/tests-clar/network/remotelocal.c +0 -137
- data/ext/rugged/vendor/libgit2-dist/tests-clar/network/remotes.c +0 -183
- data/ext/rugged/vendor/libgit2-dist/tests-clar/notes/notes.c +0 -133
- data/ext/rugged/vendor/libgit2-dist/tests-clar/notes/notesref.c +0 -57
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/blob/filter.c +0 -125
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/blob/fromchunks.c +0 -87
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/blob/write.c +0 -69
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/commit/commitstagedfile.c +0 -126
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/lookup.c +0 -63
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/message.c +0 -171
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/chars.c +0 -41
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/compare.c +0 -124
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/convert.c +0 -75
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/data.h +0 -323
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/fromstr.c +0 -30
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/hash.c +0 -166
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/short.c +0 -94
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/size.c +0 -13
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/type2string.c +0 -54
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/write.c +0 -455
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tag/peel.c +0 -56
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tag/read.c +0 -130
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tag/write.c +0 -192
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tree/frompath.c +0 -81
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tree/read.c +0 -75
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tree/write.c +0 -84
- data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/loose.c +0 -84
- data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/loose_data.h +0 -522
- data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/mixed.c +0 -24
- data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/pack_data.h +0 -151
- data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/packed.c +0 -78
- data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/sorting.c +0 -71
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/create.c +0 -113
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/delete.c +0 -91
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/listall.c +0 -78
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/move.c +0 -72
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/crashes.c +0 -17
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/create.c +0 -149
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/delete.c +0 -85
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/list.c +0 -53
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/listall.c +0 -36
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/lookup.c +0 -42
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/normalize.c +0 -200
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/overwrite.c +0 -136
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/pack.c +0 -67
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/read.c +0 -194
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/reflog.c +0 -123
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/rename.c +0 -339
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/revparse.c +0 -174
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/unicode.c +0 -42
- data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/discover.c +0 -142
- data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/getters.c +0 -86
- data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/init.c +0 -249
- data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/open.c +0 -282
- data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/setters.c +0 -80
- data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/mixed.c +0 -47
- data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/reset_helpers.c +0 -10
- data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/reset_helpers.h +0 -6
- data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/soft.c +0 -102
- data/ext/rugged/vendor/libgit2-dist/tests-clar/revwalk/basic.c +0 -181
- data/ext/rugged/vendor/libgit2-dist/tests-clar/revwalk/mergebase.c +0 -148
- data/ext/rugged/vendor/libgit2-dist/tests-clar/status/ignore.c +0 -147
- data/ext/rugged/vendor/libgit2-dist/tests-clar/status/single.c +0 -29
- data/ext/rugged/vendor/libgit2-dist/tests-clar/status/status_data.h +0 -202
- data/ext/rugged/vendor/libgit2-dist/tests-clar/status/status_helpers.c +0 -49
- data/ext/rugged/vendor/libgit2-dist/tests-clar/status/status_helpers.h +0 -33
- data/ext/rugged/vendor/libgit2-dist/tests-clar/status/submodules.c +0 -112
- data/ext/rugged/vendor/libgit2-dist/tests-clar/status/worktree.c +0 -649
- data/ext/rugged/vendor/libgit2-dist/tests-clar/threads/basic.c +0 -20
@@ -121,9 +121,9 @@ static const struct {
|
|
121
121
|
{ "IDLE", +12, 0, }, /* International Date Line East */
|
122
122
|
};
|
123
123
|
|
124
|
-
static
|
124
|
+
static size_t match_string(const char *date, const char *str)
|
125
125
|
{
|
126
|
-
|
126
|
+
size_t i = 0;
|
127
127
|
|
128
128
|
for (i = 0; *date; date++, str++, i++) {
|
129
129
|
if (*date == *str)
|
@@ -149,12 +149,12 @@ static int skip_alpha(const char *date)
|
|
149
149
|
/*
|
150
150
|
* Parse month, weekday, or timezone name
|
151
151
|
*/
|
152
|
-
static
|
152
|
+
static size_t match_alpha(const char *date, struct tm *tm, int *offset)
|
153
153
|
{
|
154
154
|
unsigned int i;
|
155
155
|
|
156
156
|
for (i = 0; i < 12; i++) {
|
157
|
-
|
157
|
+
size_t match = match_string(date, month_names[i]);
|
158
158
|
if (match >= 3) {
|
159
159
|
tm->tm_mon = i;
|
160
160
|
return match;
|
@@ -162,7 +162,7 @@ static int match_alpha(const char *date, struct tm *tm, int *offset)
|
|
162
162
|
}
|
163
163
|
|
164
164
|
for (i = 0; i < 7; i++) {
|
165
|
-
|
165
|
+
size_t match = match_string(date, weekday_names[i]);
|
166
166
|
if (match >= 3) {
|
167
167
|
tm->tm_wday = i;
|
168
168
|
return match;
|
@@ -170,8 +170,8 @@ static int match_alpha(const char *date, struct tm *tm, int *offset)
|
|
170
170
|
}
|
171
171
|
|
172
172
|
for (i = 0; i < ARRAY_SIZE(timezone_names); i++) {
|
173
|
-
|
174
|
-
if (match >= 3 || match ==
|
173
|
+
size_t match = match_string(date, timezone_names[i].name);
|
174
|
+
if (match >= 3 || match == strlen(timezone_names[i].name)) {
|
175
175
|
int off = timezone_names[i].offset;
|
176
176
|
|
177
177
|
/* This is bogus, but we like summer */
|
@@ -241,7 +241,7 @@ static int is_date(int year, int month, int day, struct tm *now_tm, time_t now,
|
|
241
241
|
return 0;
|
242
242
|
}
|
243
243
|
|
244
|
-
static
|
244
|
+
static size_t match_multi_number(unsigned long num, char c, const char *date, char *end, struct tm *tm)
|
245
245
|
{
|
246
246
|
time_t now;
|
247
247
|
struct tm now_tm;
|
@@ -319,9 +319,9 @@ static int nodate(struct tm *tm)
|
|
319
319
|
/*
|
320
320
|
* We've seen a digit. Time? Year? Date?
|
321
321
|
*/
|
322
|
-
static
|
322
|
+
static size_t match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt)
|
323
323
|
{
|
324
|
-
|
324
|
+
size_t n;
|
325
325
|
char *end;
|
326
326
|
unsigned long num;
|
327
327
|
|
@@ -349,7 +349,7 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt
|
|
349
349
|
case '/':
|
350
350
|
case '-':
|
351
351
|
if (isdigit(end[1])) {
|
352
|
-
|
352
|
+
size_t match = match_multi_number(num, *end, date, end, tm);
|
353
353
|
if (match)
|
354
354
|
return match;
|
355
355
|
}
|
@@ -413,11 +413,11 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt
|
|
413
413
|
return n;
|
414
414
|
}
|
415
415
|
|
416
|
-
static
|
416
|
+
static size_t match_tz(const char *date, int *offp)
|
417
417
|
{
|
418
418
|
char *end;
|
419
419
|
int hour = strtoul(date + 1, &end, 10);
|
420
|
-
|
420
|
+
size_t n = end - (date + 1);
|
421
421
|
int min = 0;
|
422
422
|
|
423
423
|
if (n == 4) {
|
@@ -506,7 +506,7 @@ static int parse_date_basic(const char *date, git_time_t *timestamp, int *offset
|
|
506
506
|
!match_object_header_date(date + 1, timestamp, offset))
|
507
507
|
return 0; /* success */
|
508
508
|
for (;;) {
|
509
|
-
|
509
|
+
size_t match = 0;
|
510
510
|
unsigned char c = *date;
|
511
511
|
|
512
512
|
/* Stop at end of string or newline */
|
@@ -685,7 +685,7 @@ static const char *approxidate_alpha(const char *date, struct tm *tm, struct tm
|
|
685
685
|
;
|
686
686
|
|
687
687
|
for (i = 0; i < 12; i++) {
|
688
|
-
|
688
|
+
size_t match = match_string(date, month_names[i]);
|
689
689
|
if (match >= 3) {
|
690
690
|
tm->tm_mon = i;
|
691
691
|
*touched = 1;
|
@@ -694,7 +694,7 @@ static const char *approxidate_alpha(const char *date, struct tm *tm, struct tm
|
|
694
694
|
}
|
695
695
|
|
696
696
|
for (s = special; s->name; s++) {
|
697
|
-
|
697
|
+
size_t len = strlen(s->name);
|
698
698
|
if (match_string(date, s->name) == len) {
|
699
699
|
s->fn(tm, now, num);
|
700
700
|
*touched = 1;
|
@@ -704,7 +704,7 @@ static const char *approxidate_alpha(const char *date, struct tm *tm, struct tm
|
|
704
704
|
|
705
705
|
if (!*num) {
|
706
706
|
for (i = 1; i < 11; i++) {
|
707
|
-
|
707
|
+
size_t len = strlen(number_name[i]);
|
708
708
|
if (match_string(date, number_name[i]) == len) {
|
709
709
|
*num = i;
|
710
710
|
*touched = 1;
|
@@ -720,7 +720,7 @@ static const char *approxidate_alpha(const char *date, struct tm *tm, struct tm
|
|
720
720
|
|
721
721
|
tl = typelen;
|
722
722
|
while (tl->type) {
|
723
|
-
|
723
|
+
size_t len = strlen(tl->type);
|
724
724
|
if (match_string(date, tl->type) >= len-1) {
|
725
725
|
update_tm(tm, now, tl->length * *num);
|
726
726
|
*num = 0;
|
@@ -731,7 +731,7 @@ static const char *approxidate_alpha(const char *date, struct tm *tm, struct tm
|
|
731
731
|
}
|
732
732
|
|
733
733
|
for (i = 0; i < 7; i++) {
|
734
|
-
|
734
|
+
size_t match = match_string(date, weekday_names[i]);
|
735
735
|
if (match >= 3) {
|
736
736
|
int diff, n = *num -1;
|
737
737
|
*num = 0;
|
@@ -783,7 +783,7 @@ static const char *approxidate_digit(const char *date, struct tm *tm, int *num)
|
|
783
783
|
case '/':
|
784
784
|
case '-':
|
785
785
|
if (isdigit(end[1])) {
|
786
|
-
|
786
|
+
size_t match = match_multi_number(number, *end, date, end, tm);
|
787
787
|
if (match)
|
788
788
|
return date + match;
|
789
789
|
}
|
File without changes
|
File without changes
|
@@ -6,6 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
#include "common.h"
|
8
8
|
#include "git2/diff.h"
|
9
|
+
#include "git2/oid.h"
|
9
10
|
#include "diff.h"
|
10
11
|
#include "fileops.h"
|
11
12
|
#include "config.h"
|
@@ -20,14 +21,21 @@ static char *diff_prefix_from_pathspec(const git_strarray *pathspec)
|
|
20
21
|
return NULL;
|
21
22
|
|
22
23
|
/* diff prefix will only be leading non-wildcards */
|
23
|
-
for (scan = prefix.ptr; *scan
|
24
|
+
for (scan = prefix.ptr; *scan; ++scan) {
|
25
|
+
if (git__iswildcard(*scan) &&
|
26
|
+
(scan == prefix.ptr || (*(scan - 1) != '\\')))
|
27
|
+
break;
|
28
|
+
}
|
24
29
|
git_buf_truncate(&prefix, scan - prefix.ptr);
|
25
30
|
|
26
|
-
if (prefix.size
|
27
|
-
|
31
|
+
if (prefix.size <= 0) {
|
32
|
+
git_buf_free(&prefix);
|
33
|
+
return NULL;
|
34
|
+
}
|
28
35
|
|
29
|
-
|
30
|
-
|
36
|
+
git_buf_unescape(&prefix);
|
37
|
+
|
38
|
+
return git_buf_detach(&prefix);
|
31
39
|
}
|
32
40
|
|
33
41
|
static bool diff_pathspec_is_interesting(const git_strarray *pathspec)
|
@@ -54,7 +62,11 @@ static bool diff_path_matches_pathspec(git_diff_list *diff, const char *path)
|
|
54
62
|
return true;
|
55
63
|
|
56
64
|
git_vector_foreach(&diff->pathspec, i, match) {
|
57
|
-
int result =
|
65
|
+
int result = strcmp(match->pattern, path) ? FNM_NOMATCH : 0;
|
66
|
+
|
67
|
+
if (((diff->opts.flags & GIT_DIFF_DISABLE_PATHSPEC_MATCH) == 0) &&
|
68
|
+
result == FNM_NOMATCH)
|
69
|
+
result = p_fnmatch(match->pattern, path, 0);
|
58
70
|
|
59
71
|
/* if we didn't match, look for exact dirname prefix match */
|
60
72
|
if (result == FNM_NOMATCH &&
|
@@ -456,10 +468,11 @@ static int maybe_modified(
|
|
456
468
|
if (!diff_path_matches_pathspec(diff, oitem->path))
|
457
469
|
return 0;
|
458
470
|
|
459
|
-
/* on platforms with no symlinks,
|
471
|
+
/* on platforms with no symlinks, preserve mode of existing symlinks */
|
460
472
|
if (S_ISLNK(omode) && S_ISREG(nmode) &&
|
461
|
-
!(diff->diffcaps & GIT_DIFFCAPS_HAS_SYMLINKS)
|
462
|
-
|
473
|
+
!(diff->diffcaps & GIT_DIFFCAPS_HAS_SYMLINKS) &&
|
474
|
+
new_iter->type == GIT_ITERATOR_WORKDIR)
|
475
|
+
nmode = omode;
|
463
476
|
|
464
477
|
/* on platforms with no execmode, just preserve old mode */
|
465
478
|
if (!(diff->diffcaps & GIT_DIFFCAPS_TRUST_MODE_BITS) &&
|
@@ -704,12 +717,17 @@ int git_diff_index_to_tree(
|
|
704
717
|
assert(repo && diff);
|
705
718
|
|
706
719
|
if (git_iterator_for_tree_range(&a, repo, old_tree, prefix, prefix) < 0 ||
|
707
|
-
|
708
|
-
|
720
|
+
git_iterator_for_index_range(&b, repo, prefix, prefix) < 0)
|
721
|
+
goto on_error;
|
709
722
|
|
710
723
|
git__free(prefix);
|
711
724
|
|
712
725
|
return diff_from_iterators(repo, opts, a, b, diff);
|
726
|
+
|
727
|
+
on_error:
|
728
|
+
git__free(prefix);
|
729
|
+
git_iterator_free(a);
|
730
|
+
return -1;
|
713
731
|
}
|
714
732
|
|
715
733
|
int git_diff_workdir_to_index(
|
@@ -723,12 +741,17 @@ int git_diff_workdir_to_index(
|
|
723
741
|
assert(repo && diff);
|
724
742
|
|
725
743
|
if (git_iterator_for_index_range(&a, repo, prefix, prefix) < 0 ||
|
726
|
-
|
727
|
-
|
744
|
+
git_iterator_for_workdir_range(&b, repo, prefix, prefix) < 0)
|
745
|
+
goto on_error;
|
728
746
|
|
729
747
|
git__free(prefix);
|
730
748
|
|
731
749
|
return diff_from_iterators(repo, opts, a, b, diff);
|
750
|
+
|
751
|
+
on_error:
|
752
|
+
git__free(prefix);
|
753
|
+
git_iterator_free(a);
|
754
|
+
return -1;
|
732
755
|
}
|
733
756
|
|
734
757
|
|
@@ -744,12 +767,17 @@ int git_diff_workdir_to_tree(
|
|
744
767
|
assert(repo && old_tree && diff);
|
745
768
|
|
746
769
|
if (git_iterator_for_tree_range(&a, repo, old_tree, prefix, prefix) < 0 ||
|
747
|
-
|
748
|
-
|
770
|
+
git_iterator_for_workdir_range(&b, repo, prefix, prefix) < 0)
|
771
|
+
goto on_error;
|
749
772
|
|
750
773
|
git__free(prefix);
|
751
774
|
|
752
775
|
return diff_from_iterators(repo, opts, a, b, diff);
|
776
|
+
|
777
|
+
on_error:
|
778
|
+
git__free(prefix);
|
779
|
+
git_iterator_free(a);
|
780
|
+
return -1;
|
753
781
|
}
|
754
782
|
|
755
783
|
int git_diff_merge(
|
@@ -799,9 +827,9 @@ int git_diff_merge(
|
|
799
827
|
|
800
828
|
/* prefix strings also come from old pool, so recreate those.*/
|
801
829
|
onto->opts.old_prefix =
|
802
|
-
|
830
|
+
git_pool_strdup_safe(&onto->pool, onto->opts.old_prefix);
|
803
831
|
onto->opts.new_prefix =
|
804
|
-
|
832
|
+
git_pool_strdup_safe(&onto->pool, onto->opts.new_prefix);
|
805
833
|
}
|
806
834
|
|
807
835
|
git_vector_foreach(&onto_new, i, delta)
|
@@ -811,4 +839,3 @@ int git_diff_merge(
|
|
811
839
|
|
812
840
|
return error;
|
813
841
|
}
|
814
|
-
|
File without changes
|
@@ -8,6 +8,7 @@
|
|
8
8
|
#include "git2/diff.h"
|
9
9
|
#include "git2/attr.h"
|
10
10
|
#include "git2/blob.h"
|
11
|
+
#include "git2/oid.h"
|
11
12
|
#include "xdiff/xdiff.h"
|
12
13
|
#include <ctype.h>
|
13
14
|
#include "diff.h"
|
@@ -23,6 +24,7 @@ typedef struct {
|
|
23
24
|
unsigned int index;
|
24
25
|
git_diff_delta *delta;
|
25
26
|
git_diff_range range;
|
27
|
+
int error;
|
26
28
|
} diff_output_info;
|
27
29
|
|
28
30
|
static int read_next_int(const char **str, int *value)
|
@@ -49,25 +51,24 @@ static int diff_output_cb(void *priv, mmbuffer_t *bufs, int len)
|
|
49
51
|
|
50
52
|
/* expect something of the form "@@ -%d[,%d] +%d[,%d] @@" */
|
51
53
|
if (*scan != '@')
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
if (read_next_int(&scan, &range.
|
60
|
-
|
61
|
-
if (
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
info->cb_data, info->delta, &range, bufs[0].ptr, bufs[0].size);
|
54
|
+
info->error = -1;
|
55
|
+
else if (read_next_int(&scan, &range.old_start) < 0)
|
56
|
+
info->error = -1;
|
57
|
+
else if (*scan == ',' && read_next_int(&scan, &range.old_lines) < 0)
|
58
|
+
info->error = -1;
|
59
|
+
else if (read_next_int(&scan, &range.new_start) < 0)
|
60
|
+
info->error = -1;
|
61
|
+
else if (*scan == ',' && read_next_int(&scan, &range.new_lines) < 0)
|
62
|
+
info->error = -1;
|
63
|
+
else if (range.old_start < 0 || range.new_start < 0)
|
64
|
+
info->error = -1;
|
65
|
+
else {
|
66
|
+
memcpy(&info->range, &range, sizeof(git_diff_range));
|
67
|
+
|
68
|
+
if (info->hunk_cb(
|
69
|
+
info->cb_data, info->delta, &range, bufs[0].ptr, bufs[0].size))
|
70
|
+
info->error = GIT_EUSER;
|
71
|
+
}
|
71
72
|
}
|
72
73
|
|
73
74
|
if ((len == 2 || len == 3) && info->line_cb) {
|
@@ -80,23 +81,24 @@ static int diff_output_cb(void *priv, mmbuffer_t *bufs, int len)
|
|
80
81
|
GIT_DIFF_LINE_CONTEXT;
|
81
82
|
|
82
83
|
if (info->line_cb(
|
83
|
-
|
84
|
-
|
84
|
+
info->cb_data, info->delta, &info->range, origin, bufs[1].ptr, bufs[1].size))
|
85
|
+
info->error = GIT_EUSER;
|
85
86
|
|
86
87
|
/* This should only happen if we are adding a line that does not
|
87
88
|
* have a newline at the end and the old code did. In that case,
|
88
89
|
* we have a ADD with a DEL_EOFNL as a pair.
|
89
90
|
*/
|
90
|
-
if (len == 3) {
|
91
|
+
else if (len == 3) {
|
91
92
|
origin = (origin == GIT_DIFF_LINE_ADDITION) ?
|
92
93
|
GIT_DIFF_LINE_DEL_EOFNL : GIT_DIFF_LINE_ADD_EOFNL;
|
93
94
|
|
94
|
-
|
95
|
-
|
95
|
+
if (info->line_cb(
|
96
|
+
info->cb_data, info->delta, &info->range, origin, bufs[2].ptr, bufs[2].size))
|
97
|
+
info->error = GIT_EUSER;
|
96
98
|
}
|
97
99
|
}
|
98
100
|
|
99
|
-
return
|
101
|
+
return info->error;
|
100
102
|
}
|
101
103
|
|
102
104
|
#define BINARY_DIFF_FLAGS (GIT_DIFF_FILE_BINARY|GIT_DIFF_FILE_NOT_BINARY)
|
@@ -160,7 +162,7 @@ static int file_is_binary_by_attr(
|
|
160
162
|
mirror_new = (delta->new_file.path == delta->old_file.path ||
|
161
163
|
strcmp(delta->new_file.path, delta->old_file.path) == 0);
|
162
164
|
if (mirror_new)
|
163
|
-
delta->new_file.flags
|
165
|
+
delta->new_file.flags |= (delta->old_file.flags & BINARY_DIFF_FLAGS);
|
164
166
|
else
|
165
167
|
error = update_file_is_binary_by_attr(diff->repo, &delta->new_file);
|
166
168
|
|
@@ -212,7 +214,7 @@ static void setup_xdiff_options(
|
|
212
214
|
cfg->ctxlen =
|
213
215
|
(!opts || !opts->context_lines) ? 3 : opts->context_lines;
|
214
216
|
cfg->interhunkctxlen =
|
215
|
-
(!opts
|
217
|
+
(!opts) ? 0 : opts->interhunk_lines;
|
216
218
|
|
217
219
|
if (!opts)
|
218
220
|
return;
|
@@ -318,6 +320,7 @@ int git_diff_foreach(
|
|
318
320
|
xdemitconf_t xdiff_config;
|
319
321
|
xdemitcb_t xdiff_callback;
|
320
322
|
|
323
|
+
memset(&info, 0, sizeof(info));
|
321
324
|
info.diff = diff;
|
322
325
|
info.cb_data = data;
|
323
326
|
info.hunk_cb = hunk_cb;
|
@@ -394,6 +397,7 @@ int git_diff_foreach(
|
|
394
397
|
|
395
398
|
if (error < 0)
|
396
399
|
goto cleanup;
|
400
|
+
delta->new_file.flags |= GIT_DIFF_FILE_VALID_OID;
|
397
401
|
|
398
402
|
/* since we did not have the definitive oid, we may have
|
399
403
|
* incorrect status and need to skip this item.
|
@@ -422,11 +426,11 @@ int git_diff_foreach(
|
|
422
426
|
* diffs to tell if a file has really been changed.
|
423
427
|
*/
|
424
428
|
|
425
|
-
if (file_cb != NULL
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
429
|
+
if (file_cb != NULL &&
|
430
|
+
file_cb(data, delta, (float)info.index / diff->deltas.length))
|
431
|
+
{
|
432
|
+
error = GIT_EUSER;
|
433
|
+
goto cleanup;
|
430
434
|
}
|
431
435
|
|
432
436
|
/* don't do hunk and line diffs if file is binary */
|
@@ -451,6 +455,7 @@ int git_diff_foreach(
|
|
451
455
|
|
452
456
|
xdl_diff(&old_xdiff_data, &new_xdiff_data,
|
453
457
|
&xdiff_params, &xdiff_config, &xdiff_callback);
|
458
|
+
error = info.error;
|
454
459
|
|
455
460
|
cleanup:
|
456
461
|
release_content(&delta->old_file, &old_data, old_blob);
|
@@ -524,7 +529,11 @@ static int print_compact(void *data, git_diff_delta *delta, float progress)
|
|
524
529
|
if (git_buf_oom(pi->buf))
|
525
530
|
return -1;
|
526
531
|
|
527
|
-
|
532
|
+
if (pi->print_cb(pi->cb_data, delta, NULL, GIT_DIFF_LINE_FILE_HDR,
|
533
|
+
git_buf_cstr(pi->buf), git_buf_len(pi->buf)))
|
534
|
+
return GIT_EUSER;
|
535
|
+
|
536
|
+
return 0;
|
528
537
|
}
|
529
538
|
|
530
539
|
int git_diff_print_compact(
|
@@ -586,7 +595,6 @@ static int print_patch_file(void *data, git_diff_delta *delta, float progress)
|
|
586
595
|
const char *oldpath = delta->old_file.path;
|
587
596
|
const char *newpfx = pi->diff->opts.new_prefix;
|
588
597
|
const char *newpath = delta->new_file.path;
|
589
|
-
int result;
|
590
598
|
|
591
599
|
GIT_UNUSED(progress);
|
592
600
|
|
@@ -619,9 +627,8 @@ static int print_patch_file(void *data, git_diff_delta *delta, float progress)
|
|
619
627
|
if (git_buf_oom(pi->buf))
|
620
628
|
return -1;
|
621
629
|
|
622
|
-
|
623
|
-
|
624
|
-
return result;
|
630
|
+
if (pi->print_cb(pi->cb_data, delta, NULL, GIT_DIFF_LINE_FILE_HDR, git_buf_cstr(pi->buf), git_buf_len(pi->buf)))
|
631
|
+
return GIT_EUSER;
|
625
632
|
|
626
633
|
if (delta->binary != 1)
|
627
634
|
return 0;
|
@@ -633,7 +640,11 @@ static int print_patch_file(void *data, git_diff_delta *delta, float progress)
|
|
633
640
|
if (git_buf_oom(pi->buf))
|
634
641
|
return -1;
|
635
642
|
|
636
|
-
|
643
|
+
if (pi->print_cb(pi->cb_data, delta, NULL, GIT_DIFF_LINE_BINARY,
|
644
|
+
git_buf_cstr(pi->buf), git_buf_len(pi->buf)))
|
645
|
+
return GIT_EUSER;
|
646
|
+
|
647
|
+
return 0;
|
637
648
|
}
|
638
649
|
|
639
650
|
static int print_patch_hunk(
|
@@ -649,7 +660,11 @@ static int print_patch_hunk(
|
|
649
660
|
if (git_buf_printf(pi->buf, "%.*s", (int)header_len, header) < 0)
|
650
661
|
return -1;
|
651
662
|
|
652
|
-
|
663
|
+
if (pi->print_cb(pi->cb_data, d, r, GIT_DIFF_LINE_HUNK_HDR,
|
664
|
+
git_buf_cstr(pi->buf), git_buf_len(pi->buf)))
|
665
|
+
return GIT_EUSER;
|
666
|
+
|
667
|
+
return 0;
|
653
668
|
}
|
654
669
|
|
655
670
|
static int print_patch_line(
|
@@ -674,7 +689,11 @@ static int print_patch_line(
|
|
674
689
|
if (git_buf_oom(pi->buf))
|
675
690
|
return -1;
|
676
691
|
|
677
|
-
|
692
|
+
if (pi->print_cb(pi->cb_data, delta, range, line_origin,
|
693
|
+
git_buf_cstr(pi->buf), git_buf_len(pi->buf)))
|
694
|
+
return GIT_EUSER;
|
695
|
+
|
696
|
+
return 0;
|
678
697
|
}
|
679
698
|
|
680
699
|
int git_diff_print_patch(
|
@@ -763,11 +782,8 @@ int git_diff_blobs(
|
|
763
782
|
if (file_is_binary_by_content(&delta, &old_map, &new_map) < 0)
|
764
783
|
return -1;
|
765
784
|
|
766
|
-
if (file_cb != NULL)
|
767
|
-
|
768
|
-
if (error < 0)
|
769
|
-
return error;
|
770
|
-
}
|
785
|
+
if (file_cb != NULL && file_cb(cb_data, &delta, 1))
|
786
|
+
return GIT_EUSER;
|
771
787
|
|
772
788
|
/* don't do hunk and line diffs if the two blobs are identical */
|
773
789
|
if (delta.status == GIT_DELTA_UNMODIFIED)
|
@@ -777,6 +793,7 @@ int git_diff_blobs(
|
|
777
793
|
if (delta.binary == 1)
|
778
794
|
return 0;
|
779
795
|
|
796
|
+
memset(&info, 0, sizeof(info));
|
780
797
|
info.diff = NULL;
|
781
798
|
info.delta = δ
|
782
799
|
info.cb_data = cb_data;
|
@@ -790,5 +807,5 @@ int git_diff_blobs(
|
|
790
807
|
|
791
808
|
xdl_diff(&old_data, &new_data, &xdiff_params, &xdiff_config, &xdiff_callback);
|
792
809
|
|
793
|
-
return
|
810
|
+
return info.error;
|
794
811
|
}
|