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,56 +0,0 @@
|
|
1
|
-
#include "clar_libgit2.h"
|
2
|
-
#include "tag.h"
|
3
|
-
|
4
|
-
static git_repository *repo;
|
5
|
-
static git_tag *tag;
|
6
|
-
static git_object *target;
|
7
|
-
|
8
|
-
void test_object_tag_peel__initialize(void)
|
9
|
-
{
|
10
|
-
cl_fixture_sandbox("testrepo.git");
|
11
|
-
cl_git_pass(git_repository_open(&repo, "testrepo.git"));
|
12
|
-
}
|
13
|
-
|
14
|
-
void test_object_tag_peel__cleanup(void)
|
15
|
-
{
|
16
|
-
git_tag_free(tag);
|
17
|
-
git_object_free(target);
|
18
|
-
git_repository_free(repo);
|
19
|
-
|
20
|
-
cl_fixture_cleanup("testrepo.git");
|
21
|
-
}
|
22
|
-
|
23
|
-
static void retrieve_tag_from_oid(git_tag **tag_out, git_repository *repo, const char *sha)
|
24
|
-
{
|
25
|
-
git_oid oid;
|
26
|
-
|
27
|
-
cl_git_pass(git_oid_fromstr(&oid, sha));
|
28
|
-
cl_git_pass(git_tag_lookup(tag_out, repo, &oid));
|
29
|
-
}
|
30
|
-
|
31
|
-
void test_object_tag_peel__can_peel_to_a_commit(void)
|
32
|
-
{
|
33
|
-
retrieve_tag_from_oid(&tag, repo, "7b4384978d2493e851f9cca7858815fac9b10980");
|
34
|
-
|
35
|
-
cl_git_pass(git_tag_peel(&target, tag));
|
36
|
-
cl_assert(git_object_type(target) == GIT_OBJ_COMMIT);
|
37
|
-
cl_git_pass(git_oid_streq(git_object_id(target), "e90810b8df3e80c413d903f631643c716887138d"));
|
38
|
-
}
|
39
|
-
|
40
|
-
void test_object_tag_peel__can_peel_several_nested_tags_to_a_commit(void)
|
41
|
-
{
|
42
|
-
retrieve_tag_from_oid(&tag, repo, "b25fa35b38051e4ae45d4222e795f9df2e43f1d1");
|
43
|
-
|
44
|
-
cl_git_pass(git_tag_peel(&target, tag));
|
45
|
-
cl_assert(git_object_type(target) == GIT_OBJ_COMMIT);
|
46
|
-
cl_git_pass(git_oid_streq(git_object_id(target), "e90810b8df3e80c413d903f631643c716887138d"));
|
47
|
-
}
|
48
|
-
|
49
|
-
void test_object_tag_peel__can_peel_to_a_non_commit(void)
|
50
|
-
{
|
51
|
-
retrieve_tag_from_oid(&tag, repo, "521d87c1ec3aef9824daf6d96cc0ae3710766d91");
|
52
|
-
|
53
|
-
cl_git_pass(git_tag_peel(&target, tag));
|
54
|
-
cl_assert(git_object_type(target) == GIT_OBJ_BLOB);
|
55
|
-
cl_git_pass(git_oid_streq(git_object_id(target), "1385f264afb75a56a5bec74243be9b367ba4ca08"));
|
56
|
-
}
|
@@ -1,130 +0,0 @@
|
|
1
|
-
#include "clar_libgit2.h"
|
2
|
-
|
3
|
-
#include "tag.h"
|
4
|
-
|
5
|
-
static const char *tag1_id = "b25fa35b38051e4ae45d4222e795f9df2e43f1d1";
|
6
|
-
static const char *tag2_id = "7b4384978d2493e851f9cca7858815fac9b10980";
|
7
|
-
static const char *tagged_commit = "e90810b8df3e80c413d903f631643c716887138d";
|
8
|
-
static const char *bad_tag_id = "eda9f45a2a98d4c17a09d681d88569fa4ea91755";
|
9
|
-
static const char *badly_tagged_commit = "e90810b8df3e80c413d903f631643c716887138d";
|
10
|
-
|
11
|
-
static git_repository *g_repo;
|
12
|
-
|
13
|
-
|
14
|
-
// Helpers
|
15
|
-
static void ensure_tag_pattern_match(git_repository *repo,
|
16
|
-
const char *pattern,
|
17
|
-
const size_t expected_matches)
|
18
|
-
{
|
19
|
-
git_strarray tag_list;
|
20
|
-
int error = 0;
|
21
|
-
|
22
|
-
if ((error = git_tag_list_match(&tag_list, pattern, repo)) < 0)
|
23
|
-
goto exit;
|
24
|
-
|
25
|
-
if (tag_list.count != expected_matches)
|
26
|
-
error = GIT_ERROR;
|
27
|
-
|
28
|
-
exit:
|
29
|
-
git_strarray_free(&tag_list);
|
30
|
-
cl_git_pass(error);
|
31
|
-
}
|
32
|
-
|
33
|
-
|
34
|
-
// Fixture setup and teardown
|
35
|
-
void test_object_tag_read__initialize(void)
|
36
|
-
{
|
37
|
-
g_repo = cl_git_sandbox_init("testrepo");
|
38
|
-
}
|
39
|
-
|
40
|
-
void test_object_tag_read__cleanup(void)
|
41
|
-
{
|
42
|
-
cl_git_sandbox_cleanup();
|
43
|
-
}
|
44
|
-
|
45
|
-
|
46
|
-
void test_object_tag_read__parse(void)
|
47
|
-
{
|
48
|
-
// read and parse a tag from the repository
|
49
|
-
git_tag *tag1, *tag2;
|
50
|
-
git_commit *commit;
|
51
|
-
git_oid id1, id2, id_commit;
|
52
|
-
|
53
|
-
git_oid_fromstr(&id1, tag1_id);
|
54
|
-
git_oid_fromstr(&id2, tag2_id);
|
55
|
-
git_oid_fromstr(&id_commit, tagged_commit);
|
56
|
-
|
57
|
-
cl_git_pass(git_tag_lookup(&tag1, g_repo, &id1));
|
58
|
-
|
59
|
-
cl_assert_equal_s(git_tag_name(tag1), "test");
|
60
|
-
cl_assert(git_tag_type(tag1) == GIT_OBJ_TAG);
|
61
|
-
|
62
|
-
cl_git_pass(git_tag_target((git_object **)&tag2, tag1));
|
63
|
-
cl_assert(tag2 != NULL);
|
64
|
-
|
65
|
-
cl_assert(git_oid_cmp(&id2, git_tag_id(tag2)) == 0);
|
66
|
-
|
67
|
-
cl_git_pass(git_tag_target((git_object **)&commit, tag2));
|
68
|
-
cl_assert(commit != NULL);
|
69
|
-
|
70
|
-
cl_assert(git_oid_cmp(&id_commit, git_commit_id(commit)) == 0);
|
71
|
-
|
72
|
-
git_tag_free(tag1);
|
73
|
-
git_tag_free(tag2);
|
74
|
-
git_commit_free(commit);
|
75
|
-
}
|
76
|
-
|
77
|
-
void test_object_tag_read__list(void)
|
78
|
-
{
|
79
|
-
// list all tag names from the repository
|
80
|
-
git_strarray tag_list;
|
81
|
-
|
82
|
-
cl_git_pass(git_tag_list(&tag_list, g_repo));
|
83
|
-
|
84
|
-
cl_assert(tag_list.count == 3);
|
85
|
-
|
86
|
-
git_strarray_free(&tag_list);
|
87
|
-
}
|
88
|
-
|
89
|
-
void test_object_tag_read__list_pattern(void)
|
90
|
-
{
|
91
|
-
// list all tag names from the repository matching a specified pattern
|
92
|
-
ensure_tag_pattern_match(g_repo, "", 3);
|
93
|
-
ensure_tag_pattern_match(g_repo, "*", 3);
|
94
|
-
ensure_tag_pattern_match(g_repo, "t*", 1);
|
95
|
-
ensure_tag_pattern_match(g_repo, "*b", 2);
|
96
|
-
ensure_tag_pattern_match(g_repo, "e", 0);
|
97
|
-
ensure_tag_pattern_match(g_repo, "e90810b", 1);
|
98
|
-
ensure_tag_pattern_match(g_repo, "e90810[ab]", 1);
|
99
|
-
}
|
100
|
-
|
101
|
-
void test_object_tag_read__parse_without_tagger(void)
|
102
|
-
{
|
103
|
-
// read and parse a tag without a tagger field
|
104
|
-
git_repository *bad_tag_repo;
|
105
|
-
git_tag *bad_tag;
|
106
|
-
git_commit *commit;
|
107
|
-
git_oid id, id_commit;
|
108
|
-
|
109
|
-
// TODO: This is a little messy
|
110
|
-
cl_git_pass(git_repository_open(&bad_tag_repo, cl_fixture("bad_tag.git")));
|
111
|
-
|
112
|
-
git_oid_fromstr(&id, bad_tag_id);
|
113
|
-
git_oid_fromstr(&id_commit, badly_tagged_commit);
|
114
|
-
|
115
|
-
cl_git_pass(git_tag_lookup(&bad_tag, bad_tag_repo, &id));
|
116
|
-
cl_assert(bad_tag != NULL);
|
117
|
-
|
118
|
-
cl_assert_equal_s(git_tag_name(bad_tag), "e90810b");
|
119
|
-
cl_assert(git_oid_cmp(&id, git_tag_id(bad_tag)) == 0);
|
120
|
-
cl_assert(bad_tag->tagger == NULL);
|
121
|
-
|
122
|
-
cl_git_pass(git_tag_target((git_object **)&commit, bad_tag));
|
123
|
-
cl_assert(commit != NULL);
|
124
|
-
|
125
|
-
cl_assert(git_oid_cmp(&id_commit, git_commit_id(commit)) == 0);
|
126
|
-
|
127
|
-
git_tag_free(bad_tag);
|
128
|
-
git_commit_free(commit);
|
129
|
-
git_repository_free(bad_tag_repo);
|
130
|
-
}
|
@@ -1,192 +0,0 @@
|
|
1
|
-
#include "clar_libgit2.h"
|
2
|
-
|
3
|
-
static const char* tagger_name = "Vicent Marti";
|
4
|
-
static const char* tagger_email = "vicent@github.com";
|
5
|
-
static const char* tagger_message = "This is my tag.\n\nThere are many tags, but this one is mine\n";
|
6
|
-
|
7
|
-
static const char *tag2_id = "7b4384978d2493e851f9cca7858815fac9b10980";
|
8
|
-
static const char *tagged_commit = "e90810b8df3e80c413d903f631643c716887138d";
|
9
|
-
|
10
|
-
static git_repository *g_repo;
|
11
|
-
|
12
|
-
// Fixture setup and teardown
|
13
|
-
void test_object_tag_write__initialize(void)
|
14
|
-
{
|
15
|
-
g_repo = cl_git_sandbox_init("testrepo");
|
16
|
-
}
|
17
|
-
|
18
|
-
void test_object_tag_write__cleanup(void)
|
19
|
-
{
|
20
|
-
cl_git_sandbox_cleanup();
|
21
|
-
}
|
22
|
-
|
23
|
-
void test_object_tag_write__basic(void)
|
24
|
-
{
|
25
|
-
// write a tag to the repository and read it again
|
26
|
-
git_tag *tag;
|
27
|
-
git_oid target_id, tag_id;
|
28
|
-
git_signature *tagger;
|
29
|
-
const git_signature *tagger1;
|
30
|
-
git_reference *ref_tag;
|
31
|
-
git_object *target;
|
32
|
-
|
33
|
-
git_oid_fromstr(&target_id, tagged_commit);
|
34
|
-
cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJ_COMMIT));
|
35
|
-
|
36
|
-
/* create signature */
|
37
|
-
cl_git_pass(git_signature_new(&tagger, tagger_name, tagger_email, 123456789, 60));
|
38
|
-
|
39
|
-
cl_git_pass(
|
40
|
-
git_tag_create(&tag_id, g_repo,
|
41
|
-
"the-tag", target, tagger, tagger_message, 0)
|
42
|
-
);
|
43
|
-
|
44
|
-
git_object_free(target);
|
45
|
-
git_signature_free(tagger);
|
46
|
-
|
47
|
-
cl_git_pass(git_tag_lookup(&tag, g_repo, &tag_id));
|
48
|
-
cl_assert(git_oid_cmp(git_tag_target_oid(tag), &target_id) == 0);
|
49
|
-
|
50
|
-
/* Check attributes were set correctly */
|
51
|
-
tagger1 = git_tag_tagger(tag);
|
52
|
-
cl_assert(tagger1 != NULL);
|
53
|
-
cl_assert_equal_s(tagger1->name, tagger_name);
|
54
|
-
cl_assert_equal_s(tagger1->email, tagger_email);
|
55
|
-
cl_assert(tagger1->when.time == 123456789);
|
56
|
-
cl_assert(tagger1->when.offset == 60);
|
57
|
-
|
58
|
-
cl_assert_equal_s(git_tag_message(tag), tagger_message);
|
59
|
-
|
60
|
-
cl_git_pass(git_reference_lookup(&ref_tag, g_repo, "refs/tags/the-tag"));
|
61
|
-
cl_assert(git_oid_cmp(git_reference_oid(ref_tag), &tag_id) == 0);
|
62
|
-
cl_git_pass(git_reference_delete(ref_tag));
|
63
|
-
|
64
|
-
git_tag_free(tag);
|
65
|
-
}
|
66
|
-
|
67
|
-
void test_object_tag_write__overwrite(void)
|
68
|
-
{
|
69
|
-
// Attempt to write a tag bearing the same name than an already existing tag
|
70
|
-
git_oid target_id, tag_id;
|
71
|
-
git_signature *tagger;
|
72
|
-
git_object *target;
|
73
|
-
|
74
|
-
git_oid_fromstr(&target_id, tagged_commit);
|
75
|
-
cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJ_COMMIT));
|
76
|
-
|
77
|
-
/* create signature */
|
78
|
-
cl_git_pass(git_signature_new(&tagger, tagger_name, tagger_email, 123456789, 60));
|
79
|
-
|
80
|
-
cl_git_fail(git_tag_create(
|
81
|
-
&tag_id, /* out id */
|
82
|
-
g_repo,
|
83
|
-
"e90810b",
|
84
|
-
target,
|
85
|
-
tagger,
|
86
|
-
tagger_message,
|
87
|
-
0));
|
88
|
-
|
89
|
-
git_object_free(target);
|
90
|
-
git_signature_free(tagger);
|
91
|
-
|
92
|
-
}
|
93
|
-
|
94
|
-
void test_object_tag_write__replace(void)
|
95
|
-
{
|
96
|
-
// Replace an already existing tag
|
97
|
-
git_oid target_id, tag_id, old_tag_id;
|
98
|
-
git_signature *tagger;
|
99
|
-
git_reference *ref_tag;
|
100
|
-
git_object *target;
|
101
|
-
|
102
|
-
git_oid_fromstr(&target_id, tagged_commit);
|
103
|
-
cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJ_COMMIT));
|
104
|
-
|
105
|
-
cl_git_pass(git_reference_lookup(&ref_tag, g_repo, "refs/tags/e90810b"));
|
106
|
-
git_oid_cpy(&old_tag_id, git_reference_oid(ref_tag));
|
107
|
-
git_reference_free(ref_tag);
|
108
|
-
|
109
|
-
/* create signature */
|
110
|
-
cl_git_pass(git_signature_new(&tagger, tagger_name, tagger_email, 123456789, 60));
|
111
|
-
|
112
|
-
cl_git_pass(git_tag_create(
|
113
|
-
&tag_id, /* out id */
|
114
|
-
g_repo,
|
115
|
-
"e90810b",
|
116
|
-
target,
|
117
|
-
tagger,
|
118
|
-
tagger_message,
|
119
|
-
1));
|
120
|
-
|
121
|
-
git_object_free(target);
|
122
|
-
git_signature_free(tagger);
|
123
|
-
|
124
|
-
cl_git_pass(git_reference_lookup(&ref_tag, g_repo, "refs/tags/e90810b"));
|
125
|
-
cl_assert(git_oid_cmp(git_reference_oid(ref_tag), &tag_id) == 0);
|
126
|
-
cl_assert(git_oid_cmp(git_reference_oid(ref_tag), &old_tag_id) != 0);
|
127
|
-
|
128
|
-
git_reference_free(ref_tag);
|
129
|
-
}
|
130
|
-
|
131
|
-
void test_object_tag_write__lightweight(void)
|
132
|
-
{
|
133
|
-
// write a lightweight tag to the repository and read it again
|
134
|
-
git_oid target_id, object_id;
|
135
|
-
git_reference *ref_tag;
|
136
|
-
git_object *target;
|
137
|
-
|
138
|
-
git_oid_fromstr(&target_id, tagged_commit);
|
139
|
-
cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJ_COMMIT));
|
140
|
-
|
141
|
-
cl_git_pass(git_tag_create_lightweight(
|
142
|
-
&object_id,
|
143
|
-
g_repo,
|
144
|
-
"light-tag",
|
145
|
-
target,
|
146
|
-
0));
|
147
|
-
|
148
|
-
git_object_free(target);
|
149
|
-
|
150
|
-
cl_assert(git_oid_cmp(&object_id, &target_id) == 0);
|
151
|
-
|
152
|
-
cl_git_pass(git_reference_lookup(&ref_tag, g_repo, "refs/tags/light-tag"));
|
153
|
-
cl_assert(git_oid_cmp(git_reference_oid(ref_tag), &target_id) == 0);
|
154
|
-
|
155
|
-
cl_git_pass(git_tag_delete(g_repo, "light-tag"));
|
156
|
-
|
157
|
-
git_reference_free(ref_tag);
|
158
|
-
}
|
159
|
-
|
160
|
-
void test_object_tag_write__lightweight_over_existing(void)
|
161
|
-
{
|
162
|
-
// Attempt to write a lightweight tag bearing the same name than an already existing tag
|
163
|
-
git_oid target_id, object_id, existing_object_id;
|
164
|
-
git_object *target;
|
165
|
-
|
166
|
-
git_oid_fromstr(&target_id, tagged_commit);
|
167
|
-
cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJ_COMMIT));
|
168
|
-
|
169
|
-
cl_git_fail(git_tag_create_lightweight(
|
170
|
-
&object_id,
|
171
|
-
g_repo,
|
172
|
-
"e90810b",
|
173
|
-
target,
|
174
|
-
0));
|
175
|
-
|
176
|
-
git_oid_fromstr(&existing_object_id, tag2_id);
|
177
|
-
cl_assert(git_oid_cmp(&object_id, &existing_object_id) == 0);
|
178
|
-
|
179
|
-
git_object_free(target);
|
180
|
-
}
|
181
|
-
|
182
|
-
void test_object_tag_write__delete(void)
|
183
|
-
{
|
184
|
-
// Delete an already existing tag
|
185
|
-
git_reference *ref_tag;
|
186
|
-
|
187
|
-
cl_git_pass(git_tag_delete(g_repo, "e90810b"));
|
188
|
-
|
189
|
-
cl_git_fail(git_reference_lookup(&ref_tag, g_repo, "refs/tags/e90810b"));
|
190
|
-
|
191
|
-
git_reference_free(ref_tag);
|
192
|
-
}
|
@@ -1,81 +0,0 @@
|
|
1
|
-
#include "clar_libgit2.h"
|
2
|
-
|
3
|
-
static git_repository *repo;
|
4
|
-
const char *tree_with_subtrees_oid = "ae90f12eea699729ed24555e40b9fd669da12a12";
|
5
|
-
static git_tree *tree;
|
6
|
-
|
7
|
-
void test_object_tree_frompath__initialize(void)
|
8
|
-
{
|
9
|
-
git_oid id;
|
10
|
-
|
11
|
-
cl_fixture_sandbox("testrepo.git");
|
12
|
-
cl_git_pass(git_repository_open(&repo, "testrepo.git"));
|
13
|
-
cl_assert(repo != NULL);
|
14
|
-
|
15
|
-
cl_git_pass(git_oid_fromstr(&id, tree_with_subtrees_oid));
|
16
|
-
cl_git_pass(git_tree_lookup(&tree, repo, &id));
|
17
|
-
cl_assert(tree != NULL);
|
18
|
-
}
|
19
|
-
|
20
|
-
void test_object_tree_frompath__cleanup(void)
|
21
|
-
{
|
22
|
-
git_tree_free(tree);
|
23
|
-
git_repository_free(repo);
|
24
|
-
cl_fixture_cleanup("testrepo.git");
|
25
|
-
}
|
26
|
-
|
27
|
-
static void assert_tree_from_path(git_tree *root, const char *path, int expected_result, const char *expected_raw_oid)
|
28
|
-
{
|
29
|
-
git_tree *containing_tree = NULL;
|
30
|
-
|
31
|
-
cl_assert(git_tree_get_subtree(&containing_tree, root, path) == expected_result);
|
32
|
-
|
33
|
-
if (containing_tree == NULL && expected_result != 0)
|
34
|
-
return;
|
35
|
-
|
36
|
-
cl_assert(containing_tree != NULL && expected_result == 0);
|
37
|
-
|
38
|
-
cl_git_pass(git_oid_streq(git_object_id((const git_object *)containing_tree), expected_raw_oid));
|
39
|
-
|
40
|
-
git_tree_free(containing_tree);
|
41
|
-
}
|
42
|
-
|
43
|
-
static void assert_tree_from_path_klass(git_tree *root, const char *path, int expected_result, const char *expected_raw_oid)
|
44
|
-
{
|
45
|
-
assert_tree_from_path(root, path, GIT_ERROR, expected_raw_oid);
|
46
|
-
cl_assert(giterr_last()->klass == expected_result);
|
47
|
-
}
|
48
|
-
|
49
|
-
void test_object_tree_frompath__retrieve_tree_from_path_to_treeentry(void)
|
50
|
-
{
|
51
|
-
/* Will return self if given a one path segment... */
|
52
|
-
assert_tree_from_path(tree, "README", 0, tree_with_subtrees_oid);
|
53
|
-
|
54
|
-
/* ...even one that lead to a non existent tree entry. */
|
55
|
-
assert_tree_from_path(tree, "i-do-not-exist.txt", 0, tree_with_subtrees_oid);
|
56
|
-
|
57
|
-
/* Will return fgh tree oid given this following path... */
|
58
|
-
assert_tree_from_path(tree, "ab/de/fgh/1.txt", 0, "3259a6bd5b57fb9c1281bb7ed3167b50f224cb54");
|
59
|
-
|
60
|
-
/* ... and ab tree oid given this one. */
|
61
|
-
assert_tree_from_path(tree, "ab/de", 0, "f1425cef211cc08caa31e7b545ffb232acb098c3");
|
62
|
-
|
63
|
-
/* Will succeed if given a valid path which leads to a tree entry which doesn't exist */
|
64
|
-
assert_tree_from_path(tree, "ab/de/fgh/i-do-not-exist.txt", 0, "3259a6bd5b57fb9c1281bb7ed3167b50f224cb54");
|
65
|
-
}
|
66
|
-
|
67
|
-
void test_object_tree_frompath__fail_when_processing_an_unknown_tree_segment(void)
|
68
|
-
{
|
69
|
-
assert_tree_from_path(tree, "nope/de/fgh/1.txt", GIT_ENOTFOUND, NULL);
|
70
|
-
assert_tree_from_path(tree, "ab/me-neither/fgh/2.txt", GIT_ENOTFOUND, NULL);
|
71
|
-
}
|
72
|
-
|
73
|
-
void test_object_tree_frompath__fail_when_processing_an_invalid_path(void)
|
74
|
-
{
|
75
|
-
assert_tree_from_path_klass(tree, "/", GITERR_INVALID, NULL);
|
76
|
-
assert_tree_from_path_klass(tree, "/ab", GITERR_INVALID, NULL);
|
77
|
-
assert_tree_from_path_klass(tree, "/ab/de", GITERR_INVALID, NULL);
|
78
|
-
assert_tree_from_path_klass(tree, "ab/", GITERR_INVALID, NULL);
|
79
|
-
assert_tree_from_path_klass(tree, "ab//de", GITERR_INVALID, NULL);
|
80
|
-
assert_tree_from_path_klass(tree, "ab/de/", GITERR_INVALID, NULL);
|
81
|
-
}
|