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
@@ -1,87 +0,0 @@
|
|
1
|
-
#include "clar_libgit2.h"
|
2
|
-
#include "buffer.h"
|
3
|
-
#include "posix.h"
|
4
|
-
#include "path.h"
|
5
|
-
#include "fileops.h"
|
6
|
-
|
7
|
-
static git_repository *repo;
|
8
|
-
static char textual_content[] = "libgit2\n\r\n\0";
|
9
|
-
|
10
|
-
void test_object_blob_fromchunks__initialize(void)
|
11
|
-
{
|
12
|
-
repo = cl_git_sandbox_init("testrepo.git");
|
13
|
-
}
|
14
|
-
|
15
|
-
void test_object_blob_fromchunks__cleanup(void)
|
16
|
-
{
|
17
|
-
cl_git_sandbox_cleanup();
|
18
|
-
}
|
19
|
-
|
20
|
-
static int text_chunked_source_cb(char *content, size_t max_length, void *payload)
|
21
|
-
{
|
22
|
-
int *count;
|
23
|
-
|
24
|
-
GIT_UNUSED(max_length);
|
25
|
-
|
26
|
-
count = (int *)payload;
|
27
|
-
(*count)--;
|
28
|
-
|
29
|
-
if (*count == 0)
|
30
|
-
return 0;
|
31
|
-
|
32
|
-
strcpy(content, textual_content);
|
33
|
-
return strlen(textual_content);
|
34
|
-
}
|
35
|
-
|
36
|
-
void test_object_blob_fromchunks__can_create_a_blob_from_a_in_memory_chunk_provider(void)
|
37
|
-
{
|
38
|
-
git_oid expected_oid, oid;
|
39
|
-
git_object *blob;
|
40
|
-
int howmany = 7;
|
41
|
-
|
42
|
-
cl_git_pass(git_oid_fromstr(&expected_oid, "321cbdf08803c744082332332838df6bd160f8f9"));
|
43
|
-
|
44
|
-
cl_git_fail(git_object_lookup(&blob, repo, &expected_oid, GIT_OBJ_ANY));
|
45
|
-
|
46
|
-
cl_git_pass(git_blob_create_fromchunks(&oid, repo, NULL, text_chunked_source_cb, &howmany));
|
47
|
-
|
48
|
-
cl_git_pass(git_object_lookup(&blob, repo, &expected_oid, GIT_OBJ_ANY));
|
49
|
-
git_object_free(blob);
|
50
|
-
}
|
51
|
-
|
52
|
-
#define GITATTR "* text=auto\n" \
|
53
|
-
"*.txt text\n" \
|
54
|
-
"*.data binary\n"
|
55
|
-
|
56
|
-
static void write_attributes(git_repository *repo)
|
57
|
-
{
|
58
|
-
git_buf buf = GIT_BUF_INIT;
|
59
|
-
|
60
|
-
cl_git_pass(git_buf_joinpath(&buf, git_repository_path(repo), "info"));
|
61
|
-
cl_git_pass(git_buf_joinpath(&buf, git_buf_cstr(&buf), "attributes"));
|
62
|
-
|
63
|
-
cl_git_pass(git_futils_mkpath2file(git_buf_cstr(&buf), 0777));
|
64
|
-
cl_git_rewritefile(git_buf_cstr(&buf), GITATTR);
|
65
|
-
|
66
|
-
git_buf_free(&buf);
|
67
|
-
}
|
68
|
-
|
69
|
-
static void assert_named_chunked_blob(const char *expected_sha, const char *fake_name)
|
70
|
-
{
|
71
|
-
git_oid expected_oid, oid;
|
72
|
-
int howmany = 7;
|
73
|
-
|
74
|
-
cl_git_pass(git_oid_fromstr(&expected_oid, expected_sha));
|
75
|
-
|
76
|
-
cl_git_pass(git_blob_create_fromchunks(&oid, repo, fake_name, text_chunked_source_cb, &howmany));
|
77
|
-
cl_assert(git_oid_cmp(&expected_oid, &oid) == 0);
|
78
|
-
}
|
79
|
-
|
80
|
-
void test_object_blob_fromchunks__creating_a_blob_from_chunks_honors_the_attributes_directives(void)
|
81
|
-
{
|
82
|
-
write_attributes(repo);
|
83
|
-
|
84
|
-
assert_named_chunked_blob("321cbdf08803c744082332332838df6bd160f8f9", "dummy.data");
|
85
|
-
assert_named_chunked_blob("e9671e138a780833cb689753570fd10a55be84fb", "dummy.txt");
|
86
|
-
assert_named_chunked_blob("e9671e138a780833cb689753570fd10a55be84fb", "dummy.dunno");
|
87
|
-
}
|
@@ -1,69 +0,0 @@
|
|
1
|
-
#include "clar_libgit2.h"
|
2
|
-
#include "buffer.h"
|
3
|
-
#include "posix.h"
|
4
|
-
#include "path.h"
|
5
|
-
#include "fileops.h"
|
6
|
-
|
7
|
-
static git_repository *repo;
|
8
|
-
|
9
|
-
#define WORKDIR "empty_standard_repo"
|
10
|
-
#define BARE_REPO "testrepo.git"
|
11
|
-
#define ELSEWHERE "elsewhere"
|
12
|
-
|
13
|
-
typedef int (*blob_creator_fn)(
|
14
|
-
git_oid *,
|
15
|
-
git_repository *,
|
16
|
-
const char *);
|
17
|
-
|
18
|
-
void test_object_blob_write__cleanup(void)
|
19
|
-
{
|
20
|
-
cl_git_sandbox_cleanup();
|
21
|
-
}
|
22
|
-
|
23
|
-
static void assert_blob_creation(const char *path_to_file, const char *blob_from_path, blob_creator_fn creator)
|
24
|
-
{
|
25
|
-
git_oid oid;
|
26
|
-
cl_git_mkfile(path_to_file, "1..2...3... Can you hear me?\n");
|
27
|
-
|
28
|
-
cl_must_pass(creator(&oid, repo, blob_from_path));
|
29
|
-
cl_assert(git_oid_streq(&oid, "da5e4f20c91c81b44a7e298f3d3fb3fe2f178e32") == 0);
|
30
|
-
}
|
31
|
-
|
32
|
-
void test_object_blob_write__can_create_a_blob_in_a_standard_repo_from_a_file_located_in_the_working_directory(void)
|
33
|
-
{
|
34
|
-
repo = cl_git_sandbox_init(WORKDIR);
|
35
|
-
|
36
|
-
assert_blob_creation(WORKDIR "/test.txt", "test.txt", &git_blob_create_fromfile);
|
37
|
-
}
|
38
|
-
|
39
|
-
void test_object_blob_write__can_create_a_blob_in_a_standard_repo_from_a_absolute_filepath_pointing_outside_of_the_working_directory(void)
|
40
|
-
{
|
41
|
-
git_buf full_path = GIT_BUF_INIT;
|
42
|
-
|
43
|
-
repo = cl_git_sandbox_init(WORKDIR);
|
44
|
-
|
45
|
-
cl_must_pass(p_mkdir(ELSEWHERE, 0777));
|
46
|
-
cl_must_pass(git_path_prettify_dir(&full_path, ELSEWHERE, NULL));
|
47
|
-
cl_must_pass(git_buf_puts(&full_path, "test.txt"));
|
48
|
-
|
49
|
-
assert_blob_creation(ELSEWHERE "/test.txt", git_buf_cstr(&full_path), &git_blob_create_fromdisk);
|
50
|
-
|
51
|
-
git_buf_free(&full_path);
|
52
|
-
cl_must_pass(git_futils_rmdir_r(ELSEWHERE, GIT_DIRREMOVAL_FILES_AND_DIRS));
|
53
|
-
}
|
54
|
-
|
55
|
-
void test_object_blob_write__can_create_a_blob_in_a_bare_repo_from_a_absolute_filepath(void)
|
56
|
-
{
|
57
|
-
git_buf full_path = GIT_BUF_INIT;
|
58
|
-
|
59
|
-
repo = cl_git_sandbox_init(BARE_REPO);
|
60
|
-
|
61
|
-
cl_must_pass(p_mkdir(ELSEWHERE, 0777));
|
62
|
-
cl_must_pass(git_path_prettify_dir(&full_path, ELSEWHERE, NULL));
|
63
|
-
cl_must_pass(git_buf_puts(&full_path, "test.txt"));
|
64
|
-
|
65
|
-
assert_blob_creation(ELSEWHERE "/test.txt", git_buf_cstr(&full_path), &git_blob_create_fromdisk);
|
66
|
-
|
67
|
-
git_buf_free(&full_path);
|
68
|
-
cl_must_pass(git_futils_rmdir_r(ELSEWHERE, GIT_DIRREMOVAL_FILES_AND_DIRS));
|
69
|
-
}
|
@@ -1,126 +0,0 @@
|
|
1
|
-
#include "clar_libgit2.h"
|
2
|
-
#include "posix.h"
|
3
|
-
|
4
|
-
static git_repository *repo;
|
5
|
-
|
6
|
-
void test_object_commit_commitstagedfile__initialize(void)
|
7
|
-
{
|
8
|
-
cl_fixture("treebuilder");
|
9
|
-
cl_git_pass(git_repository_init(&repo, "treebuilder/", 0));
|
10
|
-
cl_assert(repo != NULL);
|
11
|
-
}
|
12
|
-
|
13
|
-
void test_object_commit_commitstagedfile__cleanup(void)
|
14
|
-
{
|
15
|
-
git_repository_free(repo);
|
16
|
-
cl_fixture_cleanup("treebuilder");
|
17
|
-
}
|
18
|
-
|
19
|
-
void test_object_commit_commitstagedfile__generate_predictable_object_ids(void)
|
20
|
-
{
|
21
|
-
git_index *index;
|
22
|
-
git_index_entry *entry;
|
23
|
-
git_oid expected_blob_oid, tree_oid, expected_tree_oid, commit_oid, expected_commit_oid;
|
24
|
-
git_signature *signature;
|
25
|
-
git_tree *tree;
|
26
|
-
|
27
|
-
/*
|
28
|
-
* The test below replicates the following git scenario
|
29
|
-
*
|
30
|
-
* $ echo "test" > test.txt
|
31
|
-
* $ git hash-object test.txt
|
32
|
-
* 9daeafb9864cf43055ae93beb0afd6c7d144bfa4
|
33
|
-
*
|
34
|
-
* $ git add .
|
35
|
-
* $ git commit -m "Initial commit"
|
36
|
-
*
|
37
|
-
* $ git log
|
38
|
-
* commit 1fe3126578fc4eca68c193e4a3a0a14a0704624d
|
39
|
-
* Author: nulltoken <emeric.fermas@gmail.com>
|
40
|
-
* Date: Wed Dec 14 08:29:03 2011 +0100
|
41
|
-
*
|
42
|
-
* Initial commit
|
43
|
-
*
|
44
|
-
* $ git show 1fe3 --format=raw
|
45
|
-
* commit 1fe3126578fc4eca68c193e4a3a0a14a0704624d
|
46
|
-
* tree 2b297e643c551e76cfa1f93810c50811382f9117
|
47
|
-
* author nulltoken <emeric.fermas@gmail.com> 1323847743 +0100
|
48
|
-
* committer nulltoken <emeric.fermas@gmail.com> 1323847743 +0100
|
49
|
-
*
|
50
|
-
* Initial commit
|
51
|
-
*
|
52
|
-
* diff --git a/test.txt b/test.txt
|
53
|
-
* new file mode 100644
|
54
|
-
* index 0000000..9daeafb
|
55
|
-
* --- /dev/null
|
56
|
-
* +++ b/test.txt
|
57
|
-
* @@ -0,0 +1 @@
|
58
|
-
* +test
|
59
|
-
*
|
60
|
-
* $ git ls-tree 2b297
|
61
|
-
* 100644 blob 9daeafb9864cf43055ae93beb0afd6c7d144bfa4 test.txt
|
62
|
-
*/
|
63
|
-
|
64
|
-
cl_git_pass(git_oid_fromstr(&expected_commit_oid, "1fe3126578fc4eca68c193e4a3a0a14a0704624d"));
|
65
|
-
cl_git_pass(git_oid_fromstr(&expected_tree_oid, "2b297e643c551e76cfa1f93810c50811382f9117"));
|
66
|
-
cl_git_pass(git_oid_fromstr(&expected_blob_oid, "9daeafb9864cf43055ae93beb0afd6c7d144bfa4"));
|
67
|
-
|
68
|
-
/*
|
69
|
-
* Add a new file to the index
|
70
|
-
*/
|
71
|
-
cl_git_mkfile("treebuilder/test.txt", "test\n");
|
72
|
-
cl_git_pass(git_repository_index(&index, repo));
|
73
|
-
cl_git_pass(git_index_add(index, "test.txt", 0));
|
74
|
-
|
75
|
-
entry = git_index_get(index, 0);
|
76
|
-
|
77
|
-
cl_assert(git_oid_cmp(&expected_blob_oid, &entry->oid) == 0);
|
78
|
-
|
79
|
-
/*
|
80
|
-
* Information about index entry should match test file
|
81
|
-
*/
|
82
|
-
{
|
83
|
-
struct stat st;
|
84
|
-
cl_must_pass(p_lstat("treebuilder/test.txt", &st));
|
85
|
-
cl_assert(entry->file_size == st.st_size);
|
86
|
-
#ifndef _WIN32
|
87
|
-
/*
|
88
|
-
* Windows doesn't populate these fields, and the signage is
|
89
|
-
* wrong in the Windows version of the struct, so lets avoid
|
90
|
-
* the "comparing signed and unsigned" compilation warning in
|
91
|
-
* that case.
|
92
|
-
*/
|
93
|
-
cl_assert(entry->uid == st.st_uid);
|
94
|
-
cl_assert(entry->gid == st.st_gid);
|
95
|
-
#endif
|
96
|
-
}
|
97
|
-
|
98
|
-
/*
|
99
|
-
* Build the tree from the index
|
100
|
-
*/
|
101
|
-
cl_git_pass(git_tree_create_fromindex(&tree_oid, index));
|
102
|
-
|
103
|
-
cl_assert(git_oid_cmp(&expected_tree_oid, &tree_oid) == 0);
|
104
|
-
|
105
|
-
/*
|
106
|
-
* Commit the staged file
|
107
|
-
*/
|
108
|
-
cl_git_pass(git_signature_new(&signature, "nulltoken", "emeric.fermas@gmail.com", 1323847743, 60));
|
109
|
-
cl_git_pass(git_tree_lookup(&tree, repo, &tree_oid));
|
110
|
-
cl_git_pass(git_commit_create_v(
|
111
|
-
&commit_oid,
|
112
|
-
repo,
|
113
|
-
"HEAD",
|
114
|
-
signature,
|
115
|
-
signature,
|
116
|
-
NULL,
|
117
|
-
"Initial commit",
|
118
|
-
tree,
|
119
|
-
0));
|
120
|
-
|
121
|
-
cl_assert(git_oid_cmp(&expected_commit_oid, &commit_oid) == 0);
|
122
|
-
|
123
|
-
git_signature_free(signature);
|
124
|
-
git_tree_free(tree);
|
125
|
-
git_index_free(index);
|
126
|
-
}
|
@@ -1,63 +0,0 @@
|
|
1
|
-
#include "clar_libgit2.h"
|
2
|
-
|
3
|
-
#include "repository.h"
|
4
|
-
|
5
|
-
static git_repository *g_repo;
|
6
|
-
|
7
|
-
void test_object_lookup__initialize(void)
|
8
|
-
{
|
9
|
-
cl_git_pass(git_repository_open(&g_repo, cl_fixture("testrepo.git")));
|
10
|
-
}
|
11
|
-
|
12
|
-
void test_object_lookup__cleanup(void)
|
13
|
-
{
|
14
|
-
git_repository_free(g_repo);
|
15
|
-
}
|
16
|
-
|
17
|
-
void test_object_lookup__lookup_wrong_type_returns_enotfound(void)
|
18
|
-
{
|
19
|
-
const char *commit = "e90810b8df3e80c413d903f631643c716887138d";
|
20
|
-
git_oid oid;
|
21
|
-
git_object *object;
|
22
|
-
|
23
|
-
cl_git_pass(git_oid_fromstr(&oid, commit));
|
24
|
-
cl_assert_equal_i(
|
25
|
-
GIT_ENOTFOUND, git_object_lookup(&object, g_repo, &oid, GIT_OBJ_TAG));
|
26
|
-
}
|
27
|
-
|
28
|
-
void test_object_lookup__lookup_nonexisting_returns_enotfound(void)
|
29
|
-
{
|
30
|
-
const char *unknown = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef";
|
31
|
-
git_oid oid;
|
32
|
-
git_object *object;
|
33
|
-
|
34
|
-
cl_git_pass(git_oid_fromstr(&oid, unknown));
|
35
|
-
cl_assert_equal_i(
|
36
|
-
GIT_ENOTFOUND, git_object_lookup(&object, g_repo, &oid, GIT_OBJ_ANY));
|
37
|
-
}
|
38
|
-
|
39
|
-
void test_object_lookup__lookup_wrong_type_by_abbreviated_id_returns_enotfound(void)
|
40
|
-
{
|
41
|
-
const char *commit = "e90810b";
|
42
|
-
git_oid oid;
|
43
|
-
git_object *object;
|
44
|
-
|
45
|
-
cl_git_pass(git_oid_fromstrn(&oid, commit, strlen(commit)));
|
46
|
-
cl_assert_equal_i(
|
47
|
-
GIT_ENOTFOUND, git_object_lookup_prefix(&object, g_repo, &oid, strlen(commit), GIT_OBJ_TAG));
|
48
|
-
}
|
49
|
-
|
50
|
-
void test_object_lookup__lookup_wrong_type_eventually_returns_enotfound(void)
|
51
|
-
{
|
52
|
-
const char *commit = "e90810b8df3e80c413d903f631643c716887138d";
|
53
|
-
git_oid oid;
|
54
|
-
git_object *object;
|
55
|
-
|
56
|
-
cl_git_pass(git_oid_fromstr(&oid, commit));
|
57
|
-
|
58
|
-
cl_git_pass(git_object_lookup(&object, g_repo, &oid, GIT_OBJ_COMMIT));
|
59
|
-
git_object_free(object);
|
60
|
-
|
61
|
-
cl_assert_equal_i(
|
62
|
-
GIT_ENOTFOUND, git_object_lookup(&object, g_repo, &oid, GIT_OBJ_TAG));
|
63
|
-
}
|
@@ -1,171 +0,0 @@
|
|
1
|
-
#include "clar_libgit2.h"
|
2
|
-
#include "buffer.h"
|
3
|
-
#include "message.h"
|
4
|
-
|
5
|
-
static void assert_message_prettifying(char *expected_output, char *input, int strip_comments)
|
6
|
-
{
|
7
|
-
git_buf prettified_message = GIT_BUF_INIT;
|
8
|
-
|
9
|
-
git_message_prettify(&prettified_message, input, strip_comments);
|
10
|
-
cl_assert_equal_s(expected_output, git_buf_cstr(&prettified_message));
|
11
|
-
|
12
|
-
git_buf_free(&prettified_message);
|
13
|
-
}
|
14
|
-
|
15
|
-
#define t40 "A quick brown fox jumps over the lazy do"
|
16
|
-
#define s40 " "
|
17
|
-
#define sss s40 s40 s40 s40 s40 s40 s40 s40 s40 s40 // # 400
|
18
|
-
#define ttt t40 t40 t40 t40 t40 t40 t40 t40 t40 t40 // # 400
|
19
|
-
|
20
|
-
/* Ported from git.git */
|
21
|
-
/* see https://github.com/git/git/blob/master/t/t0030-stripspace.sh */
|
22
|
-
void test_object_message__long_lines_without_spaces_should_be_unchanged(void)
|
23
|
-
{
|
24
|
-
assert_message_prettifying(ttt "\n", ttt, 0);
|
25
|
-
assert_message_prettifying(ttt ttt "\n", ttt ttt, 0);
|
26
|
-
assert_message_prettifying(ttt ttt ttt "\n", ttt ttt ttt, 0);
|
27
|
-
assert_message_prettifying(ttt ttt ttt ttt "\n", ttt ttt ttt ttt, 0);
|
28
|
-
}
|
29
|
-
|
30
|
-
void test_object_message__lines_with_spaces_at_the_beginning_should_be_unchanged(void)
|
31
|
-
{
|
32
|
-
assert_message_prettifying(sss ttt "\n", sss ttt, 0);
|
33
|
-
assert_message_prettifying(sss sss ttt "\n", sss sss ttt, 0);
|
34
|
-
assert_message_prettifying(sss sss sss ttt "\n", sss sss sss ttt, 0);
|
35
|
-
}
|
36
|
-
|
37
|
-
void test_object_message__lines_with_intermediate_spaces_should_be_unchanged(void)
|
38
|
-
{
|
39
|
-
assert_message_prettifying(ttt sss ttt "\n", ttt sss ttt, 0);
|
40
|
-
assert_message_prettifying(ttt sss sss ttt "\n", ttt sss sss ttt, 0);
|
41
|
-
}
|
42
|
-
|
43
|
-
void test_object_message__consecutive_blank_lines_should_be_unified(void)
|
44
|
-
{
|
45
|
-
assert_message_prettifying(ttt "\n\n" ttt "\n", ttt "\n\n\n\n\n" ttt "\n", 0);
|
46
|
-
assert_message_prettifying(ttt ttt "\n\n" ttt "\n", ttt ttt "\n\n\n\n\n" ttt "\n", 0);
|
47
|
-
assert_message_prettifying(ttt ttt ttt "\n\n" ttt "\n", ttt ttt ttt "\n\n\n\n\n" ttt "\n", 0);
|
48
|
-
|
49
|
-
assert_message_prettifying(ttt "\n\n" ttt ttt "\n", ttt "\n\n\n\n\n" ttt ttt "\n", 0);
|
50
|
-
assert_message_prettifying(ttt "\n\n" ttt ttt ttt "\n", ttt "\n\n\n\n\n" ttt ttt ttt "\n", 0);
|
51
|
-
|
52
|
-
assert_message_prettifying(ttt "\n\n" ttt "\n", ttt "\n\t\n \n\n \t\t\n" ttt "\n", 0);
|
53
|
-
assert_message_prettifying(ttt ttt "\n\n" ttt "\n", ttt ttt "\n\t\n \n\n \t\t\n" ttt "\n", 0);
|
54
|
-
assert_message_prettifying(ttt ttt ttt "\n\n" ttt "\n", ttt ttt ttt "\n\t\n \n\n \t\t\n" ttt "\n", 0);
|
55
|
-
|
56
|
-
assert_message_prettifying(ttt "\n\n" ttt ttt "\n", ttt "\n\t\n \n\n \t\t\n" ttt ttt "\n", 0);
|
57
|
-
assert_message_prettifying(ttt "\n\n" ttt ttt ttt "\n", ttt "\n\t\n \n\n \t\t\n" ttt ttt ttt "\n", 0);
|
58
|
-
}
|
59
|
-
|
60
|
-
void test_object_message__only_consecutive_blank_lines_should_be_completely_removed(void)
|
61
|
-
{
|
62
|
-
assert_message_prettifying("", "\n", 0);
|
63
|
-
assert_message_prettifying("", "\n\n\n", 0);
|
64
|
-
assert_message_prettifying("", sss "\n" sss "\n" sss "\n", 0);
|
65
|
-
assert_message_prettifying("", sss sss "\n" sss "\n\n", 0);
|
66
|
-
}
|
67
|
-
|
68
|
-
void test_object_message__consecutive_blank_lines_at_the_beginning_should_be_removed(void)
|
69
|
-
{
|
70
|
-
assert_message_prettifying(ttt "\n", "\n" ttt "\n", 0);
|
71
|
-
assert_message_prettifying(ttt "\n", "\n\n\n" ttt "\n", 0);
|
72
|
-
assert_message_prettifying(ttt ttt "\n", "\n\n\n" ttt ttt "\n", 0);
|
73
|
-
assert_message_prettifying(ttt ttt ttt "\n", "\n\n\n" ttt ttt ttt "\n", 0);
|
74
|
-
assert_message_prettifying(ttt ttt ttt ttt "\n", "\n\n\n" ttt ttt ttt ttt "\n", 0);
|
75
|
-
assert_message_prettifying(ttt "\n", sss "\n" sss "\n" sss "\n" ttt "\n", 0);
|
76
|
-
assert_message_prettifying(ttt "\n", "\n" sss "\n" sss sss "\n" ttt "\n", 0);
|
77
|
-
assert_message_prettifying(ttt "\n", sss sss "\n" sss "\n\n" ttt "\n", 0);
|
78
|
-
assert_message_prettifying(ttt "\n", sss sss sss "\n\n\n" ttt "\n", 0);
|
79
|
-
assert_message_prettifying(ttt "\n", "\n" sss sss sss "\n\n" ttt "\n", 0);
|
80
|
-
assert_message_prettifying(ttt "\n", "\n\n" sss sss sss "\n" ttt "\n", 0);
|
81
|
-
}
|
82
|
-
|
83
|
-
void test_object_message__consecutive_blank_lines_at_the_end_should_be_removed(void)
|
84
|
-
{
|
85
|
-
assert_message_prettifying(ttt "\n", ttt "\n\n", 0);
|
86
|
-
assert_message_prettifying(ttt "\n", ttt "\n\n\n\n", 0);
|
87
|
-
assert_message_prettifying(ttt ttt "\n", ttt ttt "\n\n\n\n", 0);
|
88
|
-
assert_message_prettifying(ttt ttt ttt "\n", ttt ttt ttt "\n\n\n\n", 0);
|
89
|
-
assert_message_prettifying(ttt ttt ttt ttt "\n", ttt ttt ttt ttt "\n\n\n\n", 0);
|
90
|
-
assert_message_prettifying(ttt "\n", ttt "\n" sss "\n" sss "\n" sss "\n", 0);
|
91
|
-
assert_message_prettifying(ttt "\n", ttt "\n\n" sss "\n" sss sss "\n", 0);
|
92
|
-
assert_message_prettifying(ttt "\n", ttt "\n" sss sss "\n" sss "\n\n", 0);
|
93
|
-
assert_message_prettifying(ttt "\n", ttt "\n" sss sss sss "\n\n\n", 0);
|
94
|
-
assert_message_prettifying(ttt "\n", ttt "\n\n" sss sss sss "\n\n", 0);
|
95
|
-
assert_message_prettifying(ttt "\n", ttt "\n\n\n" sss sss sss "\n\n", 0);
|
96
|
-
}
|
97
|
-
|
98
|
-
void test_object_message__text_without_newline_at_end_should_end_with_newline(void)
|
99
|
-
{
|
100
|
-
assert_message_prettifying(ttt "\n", ttt, 0);
|
101
|
-
assert_message_prettifying(ttt ttt "\n", ttt ttt, 0);
|
102
|
-
assert_message_prettifying(ttt ttt ttt "\n", ttt ttt ttt, 0);
|
103
|
-
assert_message_prettifying(ttt ttt ttt ttt "\n", ttt ttt ttt ttt, 0);
|
104
|
-
}
|
105
|
-
|
106
|
-
void test_object_message__text_plus_spaces_without_newline_should_not_show_spaces_and_end_with_newline(void)
|
107
|
-
{
|
108
|
-
assert_message_prettifying(ttt "\n", ttt sss, 0);
|
109
|
-
assert_message_prettifying(ttt ttt "\n", ttt ttt sss, 0);
|
110
|
-
assert_message_prettifying(ttt ttt ttt "\n", ttt ttt ttt sss, 0);
|
111
|
-
assert_message_prettifying(ttt "\n", ttt sss sss, 0);
|
112
|
-
assert_message_prettifying(ttt ttt "\n", ttt ttt sss sss, 0);
|
113
|
-
assert_message_prettifying(ttt "\n", ttt sss sss sss, 0);
|
114
|
-
}
|
115
|
-
|
116
|
-
void test_object_message__text_plus_spaces_ending_with_newline_should_be_cleaned_and_newline_must_remain(void){
|
117
|
-
assert_message_prettifying(ttt "\n", ttt sss "\n", 0);
|
118
|
-
assert_message_prettifying(ttt "\n", ttt sss sss "\n", 0);
|
119
|
-
assert_message_prettifying(ttt "\n", ttt sss sss sss "\n", 0);
|
120
|
-
assert_message_prettifying(ttt ttt "\n", ttt ttt sss "\n", 0);
|
121
|
-
assert_message_prettifying(ttt ttt "\n", ttt ttt sss sss "\n", 0);
|
122
|
-
assert_message_prettifying(ttt ttt ttt "\n", ttt ttt ttt sss "\n", 0);
|
123
|
-
}
|
124
|
-
|
125
|
-
void test_object_message__spaces_with_newline_at_end_should_be_replaced_with_empty_string(void)
|
126
|
-
{
|
127
|
-
assert_message_prettifying("", sss "\n", 0);
|
128
|
-
assert_message_prettifying("", sss sss "\n", 0);
|
129
|
-
assert_message_prettifying("", sss sss sss "\n", 0);
|
130
|
-
assert_message_prettifying("", sss sss sss sss "\n", 0);
|
131
|
-
}
|
132
|
-
|
133
|
-
void test_object_message__spaces_without_newline_at_end_should_be_replaced_with_empty_string(void)
|
134
|
-
{
|
135
|
-
assert_message_prettifying("", "", 0);
|
136
|
-
assert_message_prettifying("", sss sss, 0);
|
137
|
-
assert_message_prettifying("", sss sss sss, 0);
|
138
|
-
assert_message_prettifying("", sss sss sss sss, 0);
|
139
|
-
}
|
140
|
-
|
141
|
-
void test_object_message__consecutive_text_lines_should_be_unchanged(void)
|
142
|
-
{
|
143
|
-
assert_message_prettifying(ttt ttt "\n" ttt "\n", ttt ttt "\n" ttt "\n", 0);
|
144
|
-
assert_message_prettifying(ttt "\n" ttt ttt "\n" ttt "\n", ttt "\n" ttt ttt "\n" ttt "\n", 0);
|
145
|
-
assert_message_prettifying(ttt "\n" ttt "\n" ttt "\n" ttt ttt "\n", ttt "\n" ttt "\n" ttt "\n" ttt ttt "\n", 0);
|
146
|
-
assert_message_prettifying(ttt "\n" ttt "\n\n" ttt ttt "\n" ttt "\n", ttt "\n" ttt "\n\n" ttt ttt "\n" ttt "\n", 0);
|
147
|
-
assert_message_prettifying(ttt ttt "\n\n" ttt "\n" ttt ttt "\n", ttt ttt "\n\n" ttt "\n" ttt ttt "\n", 0);
|
148
|
-
assert_message_prettifying(ttt "\n" ttt ttt "\n\n" ttt "\n", ttt "\n" ttt ttt "\n\n" ttt "\n", 0);
|
149
|
-
}
|
150
|
-
|
151
|
-
void test_object_message__strip_comments(void)
|
152
|
-
{
|
153
|
-
assert_message_prettifying("", "# comment", 1);
|
154
|
-
assert_message_prettifying("", "# comment\n", 1);
|
155
|
-
assert_message_prettifying("", "# comment \n", 1);
|
156
|
-
|
157
|
-
assert_message_prettifying(ttt "\n", ttt "\n" "# comment\n", 1);
|
158
|
-
assert_message_prettifying(ttt "\n", "# comment\n" ttt "\n", 1);
|
159
|
-
assert_message_prettifying(ttt "\n" ttt "\n", ttt "\n" "# comment\n" ttt "\n", 1);
|
160
|
-
}
|
161
|
-
|
162
|
-
void test_object_message__keep_comments(void)
|
163
|
-
{
|
164
|
-
assert_message_prettifying("# comment\n", "# comment", 0);
|
165
|
-
assert_message_prettifying("# comment\n", "# comment\n", 0);
|
166
|
-
assert_message_prettifying("# comment\n", "# comment \n", 0);
|
167
|
-
|
168
|
-
assert_message_prettifying(ttt "\n" "# comment\n", ttt "\n" "# comment\n", 0);
|
169
|
-
assert_message_prettifying("# comment\n" ttt "\n", "# comment\n" ttt "\n", 0);
|
170
|
-
assert_message_prettifying(ttt "\n" "# comment\n" ttt "\n", ttt "\n" "# comment\n" ttt "\n", 0);
|
171
|
-
}
|