rugged 0.16.0 → 0.17.0b1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +373 -243
- data/Rakefile +22 -0
- data/ext/rugged/extconf.rb +9 -6
- data/ext/rugged/rugged.c +123 -31
- data/ext/rugged/rugged.h +11 -10
- data/ext/rugged/rugged_blob.c +181 -18
- data/ext/rugged/rugged_commit.c +196 -18
- data/ext/rugged/rugged_config.c +94 -5
- data/ext/rugged/rugged_object.c +54 -1
- data/ext/rugged/rugged_reference.c +203 -15
- data/ext/rugged/{remote.c → rugged_remote.c} +35 -10
- data/ext/rugged/rugged_repo.c +323 -81
- data/ext/rugged/rugged_revwalk.c +57 -4
- data/ext/rugged/rugged_signature.c +3 -3
- data/ext/rugged/rugged_tag.c +72 -1
- data/ext/rugged/rugged_tree.c +70 -2
- data/ext/rugged/vendor/libgit2-dist/deps/regex/config.h +7 -0
- data/ext/rugged/vendor/libgit2-dist/deps/regex/regcomp.c +3856 -0
- data/ext/rugged/vendor/libgit2-dist/deps/regex/regex.c +85 -0
- data/ext/rugged/vendor/libgit2-dist/deps/regex/regex.h +582 -0
- data/ext/rugged/vendor/libgit2-dist/deps/regex/regex_internal.c +1744 -0
- data/ext/rugged/vendor/libgit2-dist/deps/regex/regex_internal.h +810 -0
- data/ext/rugged/vendor/libgit2-dist/deps/regex/regexec.c +4369 -0
- data/ext/rugged/vendor/libgit2-dist/examples/diff.c +238 -0
- data/ext/rugged/vendor/libgit2-dist/examples/general.c +4 -4
- data/ext/rugged/vendor/libgit2-dist/examples/network/fetch.c +101 -85
- data/ext/rugged/vendor/libgit2-dist/examples/network/git2.c +7 -3
- data/ext/rugged/vendor/libgit2-dist/examples/network/index-pack.c +80 -25
- data/ext/rugged/vendor/libgit2-dist/examples/network/ls-remote.c +6 -6
- data/ext/rugged/vendor/libgit2-dist/include/git2/attr.h +224 -0
- data/ext/rugged/vendor/libgit2-dist/include/git2/blob.h +59 -5
- data/ext/rugged/vendor/libgit2-dist/include/git2/branch.h +114 -7
- data/ext/rugged/vendor/libgit2-dist/include/git2/commit.h +14 -7
- data/ext/rugged/vendor/libgit2-dist/include/git2/common.h +4 -3
- data/ext/rugged/vendor/libgit2-dist/include/git2/config.h +105 -27
- data/ext/rugged/vendor/libgit2-dist/include/git2/diff.h +409 -0
- data/ext/rugged/vendor/libgit2-dist/include/git2/errors.h +47 -82
- data/ext/rugged/vendor/libgit2-dist/include/git2/index.h +25 -10
- data/ext/rugged/vendor/libgit2-dist/include/git2/indexer.h +46 -1
- data/ext/rugged/vendor/libgit2-dist/include/git2/merge.h +35 -0
- data/ext/rugged/vendor/libgit2-dist/include/git2/net.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/include/git2/notes.h +139 -0
- data/ext/rugged/vendor/libgit2-dist/include/git2/object.h +5 -5
- data/ext/rugged/vendor/libgit2-dist/include/git2/odb.h +13 -13
- data/ext/rugged/vendor/libgit2-dist/include/git2/odb_backend.h +8 -8
- data/ext/rugged/vendor/libgit2-dist/include/git2/oid.h +14 -9
- data/ext/rugged/vendor/libgit2-dist/include/git2/reflog.h +5 -5
- data/ext/rugged/vendor/libgit2-dist/include/git2/refs.h +37 -17
- data/ext/rugged/vendor/libgit2-dist/include/git2/refspec.h +17 -9
- data/ext/rugged/vendor/libgit2-dist/include/git2/remote.h +83 -16
- data/ext/rugged/vendor/libgit2-dist/include/git2/repository.h +24 -10
- data/ext/rugged/vendor/libgit2-dist/include/git2/reset.h +44 -0
- data/ext/rugged/vendor/libgit2-dist/include/git2/revparse.h +36 -0
- data/ext/rugged/vendor/libgit2-dist/include/git2/revwalk.h +74 -6
- data/ext/rugged/vendor/libgit2-dist/include/git2/signature.h +3 -3
- data/ext/rugged/vendor/libgit2-dist/include/git2/status.h +120 -19
- data/ext/rugged/vendor/libgit2-dist/include/git2/submodule.h +103 -0
- data/ext/rugged/vendor/libgit2-dist/include/git2/tag.h +28 -10
- data/ext/rugged/vendor/libgit2-dist/include/git2/threads.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/include/git2/tree.h +13 -13
- data/ext/rugged/vendor/libgit2-dist/include/git2/types.h +16 -2
- data/ext/rugged/vendor/libgit2-dist/include/git2/version.h +3 -3
- data/ext/rugged/vendor/libgit2-dist/include/git2/windows.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/include/git2.h +7 -2
- data/ext/rugged/vendor/libgit2-dist/src/attr.c +677 -0
- data/ext/rugged/vendor/libgit2-dist/src/attr.h +56 -0
- data/ext/rugged/vendor/libgit2-dist/src/attr_file.c +609 -0
- data/ext/rugged/vendor/libgit2-dist/src/attr_file.h +145 -0
- data/ext/rugged/vendor/libgit2-dist/src/blob.c +213 -60
- data/ext/rugged/vendor/libgit2-dist/src/blob.h +2 -1
- data/ext/rugged/vendor/libgit2-dist/src/branch.c +208 -0
- data/ext/rugged/vendor/libgit2-dist/src/branch.h +17 -0
- data/ext/rugged/vendor/libgit2-dist/src/bswap.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/buffer.c +395 -46
- data/ext/rugged/vendor/libgit2-dist/src/buffer.h +112 -9
- data/ext/rugged/vendor/libgit2-dist/src/cache.c +37 -49
- data/ext/rugged/vendor/libgit2-dist/src/cache.h +7 -17
- data/ext/rugged/vendor/libgit2-dist/src/cc-compat.h +18 -16
- data/ext/rugged/vendor/libgit2-dist/src/commit.c +56 -90
- data/ext/rugged/vendor/libgit2-dist/src/commit.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/common.h +12 -5
- data/ext/rugged/vendor/libgit2-dist/src/{win32 → compat}/fnmatch.c +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/{win32 → compat}/fnmatch.h +3 -3
- data/ext/rugged/vendor/libgit2-dist/src/config.c +247 -158
- data/ext/rugged/vendor/libgit2-dist/src/config.h +10 -1
- data/ext/rugged/vendor/libgit2-dist/src/config_cache.c +94 -0
- data/ext/rugged/vendor/libgit2-dist/src/config_file.c +606 -496
- data/ext/rugged/vendor/libgit2-dist/src/config_file.h +31 -0
- data/ext/rugged/vendor/libgit2-dist/src/crlf.c +228 -0
- data/ext/rugged/vendor/libgit2-dist/src/date.c +876 -0
- data/ext/rugged/vendor/libgit2-dist/src/delta-apply.c +15 -9
- data/ext/rugged/vendor/libgit2-dist/src/delta-apply.h +2 -2
- data/ext/rugged/vendor/libgit2-dist/src/diff.c +814 -0
- data/ext/rugged/vendor/libgit2-dist/src/diff.h +43 -0
- data/ext/rugged/vendor/libgit2-dist/src/diff_output.c +794 -0
- data/ext/rugged/vendor/libgit2-dist/src/errors.c +89 -74
- data/ext/rugged/vendor/libgit2-dist/src/fetch.c +94 -66
- data/ext/rugged/vendor/libgit2-dist/src/fetch.h +5 -4
- data/ext/rugged/vendor/libgit2-dist/src/filebuf.c +157 -100
- data/ext/rugged/vendor/libgit2-dist/src/filebuf.h +22 -8
- data/ext/rugged/vendor/libgit2-dist/src/fileops.c +330 -206
- data/ext/rugged/vendor/libgit2-dist/src/fileops.h +82 -51
- data/ext/rugged/vendor/libgit2-dist/src/filter.c +165 -0
- data/ext/rugged/vendor/libgit2-dist/src/filter.h +119 -0
- data/ext/rugged/vendor/libgit2-dist/src/global.c +4 -4
- data/ext/rugged/vendor/libgit2-dist/src/global.h +4 -1
- data/ext/rugged/vendor/libgit2-dist/src/hash.c +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/hash.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/ignore.c +203 -0
- data/ext/rugged/vendor/libgit2-dist/src/ignore.h +38 -0
- data/ext/rugged/vendor/libgit2-dist/src/index.c +220 -169
- data/ext/rugged/vendor/libgit2-dist/src/index.h +5 -1
- data/ext/rugged/vendor/libgit2-dist/src/indexer.c +601 -102
- data/ext/rugged/vendor/libgit2-dist/src/iterator.c +748 -0
- data/ext/rugged/vendor/libgit2-dist/src/iterator.h +151 -0
- data/ext/rugged/vendor/libgit2-dist/src/khash.h +608 -0
- data/ext/rugged/vendor/libgit2-dist/src/map.h +6 -1
- data/ext/rugged/vendor/libgit2-dist/src/message.c +61 -0
- data/ext/rugged/vendor/libgit2-dist/src/message.h +14 -0
- data/ext/rugged/vendor/libgit2-dist/src/mwindow.c +27 -29
- data/ext/rugged/vendor/libgit2-dist/src/mwindow.h +4 -4
- data/ext/rugged/vendor/libgit2-dist/src/netops.c +375 -56
- data/ext/rugged/vendor/libgit2-dist/src/netops.h +12 -9
- data/ext/rugged/vendor/libgit2-dist/src/notes.c +548 -0
- data/ext/rugged/vendor/libgit2-dist/src/notes.h +28 -0
- data/ext/rugged/vendor/libgit2-dist/src/object.c +59 -21
- data/ext/rugged/vendor/libgit2-dist/src/odb.c +212 -175
- data/ext/rugged/vendor/libgit2-dist/src/odb.h +39 -2
- data/ext/rugged/vendor/libgit2-dist/src/odb_loose.c +238 -241
- data/ext/rugged/vendor/libgit2-dist/src/odb_pack.c +94 -106
- data/ext/rugged/vendor/libgit2-dist/src/oid.c +59 -60
- data/ext/rugged/vendor/libgit2-dist/src/oidmap.h +42 -0
- data/ext/rugged/vendor/libgit2-dist/src/pack.c +198 -170
- data/ext/rugged/vendor/libgit2-dist/src/pack.h +16 -9
- data/ext/rugged/vendor/libgit2-dist/src/path.c +496 -106
- data/ext/rugged/vendor/libgit2-dist/src/path.h +214 -20
- data/ext/rugged/vendor/libgit2-dist/src/pkt.c +88 -159
- data/ext/rugged/vendor/libgit2-dist/src/pkt.h +9 -5
- data/ext/rugged/vendor/libgit2-dist/src/pool.c +294 -0
- data/ext/rugged/vendor/libgit2-dist/src/pool.h +125 -0
- data/ext/rugged/vendor/libgit2-dist/src/posix.c +38 -16
- data/ext/rugged/vendor/libgit2-dist/src/posix.h +20 -2
- data/ext/rugged/vendor/libgit2-dist/src/ppc/sha1.c +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/ppc/sha1.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/pqueue.c +7 -7
- data/ext/rugged/vendor/libgit2-dist/src/pqueue.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/protocol.c +21 -13
- data/ext/rugged/vendor/libgit2-dist/src/protocol.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/reflog.c +125 -103
- data/ext/rugged/vendor/libgit2-dist/src/reflog.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/refs.c +713 -640
- data/ext/rugged/vendor/libgit2-dist/src/refs.h +27 -3
- data/ext/rugged/vendor/libgit2-dist/src/refspec.c +51 -17
- data/ext/rugged/vendor/libgit2-dist/src/refspec.h +13 -1
- data/ext/rugged/vendor/libgit2-dist/src/remote.c +307 -119
- data/ext/rugged/vendor/libgit2-dist/src/remote.h +3 -2
- data/ext/rugged/vendor/libgit2-dist/src/repository.c +593 -442
- data/ext/rugged/vendor/libgit2-dist/src/repository.h +80 -2
- data/ext/rugged/vendor/libgit2-dist/src/reset.c +103 -0
- data/ext/rugged/vendor/libgit2-dist/src/revparse.c +753 -0
- data/ext/rugged/vendor/libgit2-dist/src/revwalk.c +434 -158
- data/ext/rugged/vendor/libgit2-dist/src/sha1.c +3 -3
- data/ext/rugged/vendor/libgit2-dist/src/sha1.h +2 -2
- data/ext/rugged/vendor/libgit2-dist/src/sha1_lookup.c +3 -2
- data/ext/rugged/vendor/libgit2-dist/src/sha1_lookup.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/signature.c +69 -80
- data/ext/rugged/vendor/libgit2-dist/src/signature.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/status.c +184 -638
- data/ext/rugged/vendor/libgit2-dist/src/strmap.h +64 -0
- data/ext/rugged/vendor/libgit2-dist/src/submodule.c +387 -0
- data/ext/rugged/vendor/libgit2-dist/src/tag.c +162 -137
- data/ext/rugged/vendor/libgit2-dist/src/tag.h +2 -1
- data/ext/rugged/vendor/libgit2-dist/src/thread-utils.c +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/thread-utils.h +8 -8
- data/ext/rugged/vendor/libgit2-dist/src/transport.c +31 -19
- data/ext/rugged/vendor/libgit2-dist/src/transport.h +31 -11
- data/ext/rugged/vendor/libgit2-dist/src/transports/git.c +168 -193
- data/ext/rugged/vendor/libgit2-dist/src/transports/http.c +192 -241
- data/ext/rugged/vendor/libgit2-dist/src/transports/local.c +92 -86
- data/ext/rugged/vendor/libgit2-dist/src/tree-cache.c +32 -49
- data/ext/rugged/vendor/libgit2-dist/src/tree-cache.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/tree.c +172 -145
- data/ext/rugged/vendor/libgit2-dist/src/tree.h +16 -2
- data/ext/rugged/vendor/libgit2-dist/src/tsort.c +16 -14
- data/ext/rugged/vendor/libgit2-dist/src/unix/map.c +8 -24
- data/ext/rugged/vendor/libgit2-dist/src/unix/posix.h +9 -3
- data/ext/rugged/vendor/libgit2-dist/src/util.c +94 -38
- data/ext/rugged/vendor/libgit2-dist/src/util.h +119 -13
- data/ext/rugged/vendor/libgit2-dist/src/vector.c +84 -31
- data/ext/rugged/vendor/libgit2-dist/src/vector.h +37 -4
- data/ext/rugged/vendor/libgit2-dist/src/win32/dir.c +81 -41
- data/ext/rugged/vendor/libgit2-dist/src/{dir.h → win32/dir.h} +4 -9
- data/ext/rugged/vendor/libgit2-dist/src/win32/map.c +19 -35
- data/ext/rugged/vendor/libgit2-dist/src/win32/mingw-compat.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/win32/msvc-compat.h +5 -1
- data/ext/rugged/vendor/libgit2-dist/src/win32/posix.h +10 -8
- data/ext/rugged/vendor/libgit2-dist/src/win32/posix_w32.c +262 -118
- data/ext/rugged/vendor/libgit2-dist/src/win32/pthread.c +12 -9
- data/ext/rugged/vendor/libgit2-dist/src/win32/pthread.h +1 -1
- data/ext/rugged/vendor/libgit2-dist/src/win32/utf-conv.c +30 -26
- data/ext/rugged/vendor/libgit2-dist/src/win32/utf-conv.h +2 -1
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xdiff.h +135 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xdiffi.c +572 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xdiffi.h +63 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xemit.c +253 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xemit.h +36 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xhistogram.c +371 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xinclude.h +46 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xmacros.h +54 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xmerge.c +619 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xpatience.c +358 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xprepare.c +483 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xprepare.h +34 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xtypes.h +67 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xutils.c +419 -0
- data/ext/rugged/vendor/libgit2-dist/src/xdiff/xutils.h +49 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/attr_expect.h +43 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/file.c +226 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/flags.c +108 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/lookup.c +262 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/repo.c +273 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/buf/basic.c +5 -5
- data/ext/rugged/vendor/libgit2-dist/tests-clar/clar_helpers.c +181 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/clar_libgit2.h +55 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/commit.c +44 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/parse.c +350 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/signature.c +65 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/write.c +140 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/config/add.c +3 -3
- data/ext/rugged/vendor/libgit2-dist/tests-clar/config/multivar.c +151 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/config/new.c +5 -5
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/config/read.c +44 -32
- data/ext/rugged/vendor/libgit2-dist/tests-clar/config/stress.c +61 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/config/write.c +20 -5
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/buffer.c +613 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/core/dirent.c +39 -26
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/env.c +115 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/errors.c +60 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/core/filebuf.c +4 -18
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/hex.c +22 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/core/oid.c +6 -6
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/path.c +420 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/pool.c +85 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/rmdir.c +68 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/core/string.c +1 -1
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/strmap.c +102 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/core/strtol.c +1 -1
- data/ext/rugged/vendor/libgit2-dist/tests-clar/core/vector.c +191 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/date/date.c +15 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/blob.c +254 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/diff_helpers.c +104 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/diff_helpers.h +47 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/index.c +92 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/iterator.c +572 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/patch.c +99 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/tree.c +210 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/workdir.c +543 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/index/read_tree.c +46 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/index/rename.c +2 -12
- data/ext/rugged/vendor/libgit2-dist/tests-clar/index/tests.c +246 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/network/createremotethenload.c +33 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/network/remotelocal.c +137 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/network/remotes.c +183 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/notes/notes.c +133 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/notes/notesref.c +57 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/blob/filter.c +125 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/blob/fromchunks.c +87 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/blob/write.c +69 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/commit/commitstagedfile.c +126 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/lookup.c +63 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/message.c +171 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/chars.c +3 -14
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/compare.c +4 -4
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/convert.c +10 -10
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/data.h +0 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/fromstr.c +1 -1
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/hash.c +21 -17
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/short.c +1 -1
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/size.c +1 -1
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/type2string.c +14 -14
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/write.c +455 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tag/peel.c +56 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tag/read.c +130 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tag/write.c +192 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/tree/frompath.c +22 -16
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tree/read.c +75 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tree/write.c +84 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/odb/loose.c +1 -1
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/odb/loose_data.h +0 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/mixed.c +24 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/odb/pack_data.h +0 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/odb/packed.c +1 -1
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/odb/sorting.c +1 -1
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/create.c +113 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/delete.c +91 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/listall.c +78 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/move.c +72 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/crashes.c +17 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/create.c +149 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/delete.c +85 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/list.c +53 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/listall.c +36 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/lookup.c +42 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/normalize.c +200 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/overwrite.c +136 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/pack.c +67 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/read.c +194 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/reflog.c +123 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/rename.c +339 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/revparse.c +174 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/unicode.c +42 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/discover.c +142 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/repo/getters.c +19 -1
- data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/init.c +235 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/open.c +282 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/setters.c +80 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/mixed.c +47 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/reset_helpers.c +10 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/reset_helpers.h +6 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/soft.c +102 -0
- data/ext/rugged/vendor/libgit2-dist/{tests/t05-revwalk.c → tests-clar/revwalk/basic.c} +85 -44
- data/ext/rugged/vendor/libgit2-dist/tests-clar/revwalk/mergebase.c +148 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/status/ignore.c +133 -0
- data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/status/single.c +2 -11
- data/ext/rugged/vendor/libgit2-dist/tests-clar/status/status_data.h +202 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/status/status_helpers.c +49 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/status/status_helpers.h +33 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/status/submodules.c +112 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/status/worktree.c +649 -0
- data/ext/rugged/vendor/libgit2-dist/tests-clar/threads/basic.c +20 -0
- data/ext/rugged/vendor/libgit2-dist.tar.gz +0 -0
- data/lib/rugged/commit.rb +35 -0
- data/lib/rugged/object.rb +7 -0
- data/lib/rugged/reference.rb +9 -0
- data/lib/rugged/repository.rb +99 -3
- data/lib/rugged/tag.rb +22 -0
- data/lib/rugged/tree.rb +8 -0
- data/lib/rugged/version.rb +1 -1
- data/lib/rugged.rb +4 -1
- data/test/blob_test.rb +2 -2
- data/test/commit_test.rb +27 -13
- data/test/config_test.rb +44 -0
- data/test/coverage/HEAD.json +1 -1
- data/test/fixtures/testrepo.git/config +2 -0
- data/test/fixtures/testrepo.git/objects/7f/043268ea43ce18e3540acaabf9e090c91965b0 +0 -0
- data/test/lib_test.rb +7 -0
- data/test/object_test.rb +3 -3
- data/test/reference_test.rb +46 -8
- data/test/remote_test.rb +8 -2
- data/test/repo_pack_test.rb +3 -3
- data/test/repo_test.rb +79 -11
- data/test/tag_test.rb +9 -2
- data/test/test_helper.rb +21 -0
- data/test/tree_test.rb +18 -6
- metadata +205 -81
- data/ext/rugged/vendor/libgit2-dist/include/git2/zlib.h +0 -40
- data/ext/rugged/vendor/libgit2-dist/src/hashtable.c +0 -243
- data/ext/rugged/vendor/libgit2-dist/src/hashtable.h +0 -80
- data/ext/rugged/vendor/libgit2-dist/tests/t00-core.c +0 -628
- data/ext/rugged/vendor/libgit2-dist/tests/t01-data.h +0 -322
- data/ext/rugged/vendor/libgit2-dist/tests/t01-rawobj.c +0 -638
- data/ext/rugged/vendor/libgit2-dist/tests/t03-data.h +0 -344
- data/ext/rugged/vendor/libgit2-dist/tests/t03-objwrite.c +0 -255
- data/ext/rugged/vendor/libgit2-dist/tests/t04-commit.c +0 -788
- data/ext/rugged/vendor/libgit2-dist/tests/t06-index.c +0 -219
- data/ext/rugged/vendor/libgit2-dist/tests/t07-hashtable.c +0 -192
- data/ext/rugged/vendor/libgit2-dist/tests/t08-tag.c +0 -357
- data/ext/rugged/vendor/libgit2-dist/tests/t09-tree.c +0 -221
- data/ext/rugged/vendor/libgit2-dist/tests/t10-refs.c +0 -1294
- data/ext/rugged/vendor/libgit2-dist/tests/t12-repo.c +0 -174
- data/ext/rugged/vendor/libgit2-dist/tests/t13-threads.c +0 -41
- data/ext/rugged/vendor/libgit2-dist/tests/t17-bufs.c +0 -61
- data/ext/rugged/vendor/libgit2-dist/tests/t18-status.c +0 -448
- data/ext/rugged/vendor/libgit2-dist/tests/test_helpers.c +0 -310
- data/ext/rugged/vendor/libgit2-dist/tests/test_helpers.h +0 -83
- data/ext/rugged/vendor/libgit2-dist/tests/test_lib.c +0 -198
- data/ext/rugged/vendor/libgit2-dist/tests/test_lib.h +0 -54
- data/ext/rugged/vendor/libgit2-dist/tests/test_main.c +0 -89
- data/ext/rugged/vendor/libgit2-dist/tests-clay/clay.h +0 -187
- data/ext/rugged/vendor/libgit2-dist/tests-clay/clay_libgit2.h +0 -28
- data/ext/rugged/vendor/libgit2-dist/tests-clay/clay_main.c +0 -1073
- data/ext/rugged/vendor/libgit2-dist/tests-clay/config/stress.c +0 -39
- data/ext/rugged/vendor/libgit2-dist/tests-clay/core/path.c +0 -139
- data/ext/rugged/vendor/libgit2-dist/tests-clay/core/rmdir.c +0 -50
- data/ext/rugged/vendor/libgit2-dist/tests-clay/core/vector.c +0 -66
- data/ext/rugged/vendor/libgit2-dist/tests-clay/network/remotes.c +0 -50
- data/ext/rugged/vendor/libgit2-dist/tests-clay/repo/init.c +0 -104
- data/ext/rugged/vendor/libgit2-dist/tests-clay/repo/open.c +0 -54
- data/ext/rugged/vendor/libgit2-dist/tests-clay/status/status_data.h +0 -48
- data/ext/rugged/vendor/libgit2-dist/tests-clay/status/worktree.c +0 -124
- data/lib/rugged/objects.rb +0 -45
- data/test/fixtures/testrepo.git/refs/heads/new_name +0 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (C) 2009-
|
2
|
+
* Copyright (C) 2009-2012 the libgit2 contributors
|
3
3
|
*
|
4
4
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
@@ -17,127 +17,92 @@
|
|
17
17
|
*/
|
18
18
|
GIT_BEGIN_DECL
|
19
19
|
|
20
|
-
|
20
|
+
#ifdef GIT_OLD_ERRORS
|
21
|
+
enum {
|
21
22
|
GIT_SUCCESS = 0,
|
22
|
-
GIT_ERROR = -1,
|
23
|
-
|
24
|
-
/** Input was not a properly formatted Git object id. */
|
25
23
|
GIT_ENOTOID = -2,
|
26
|
-
|
27
|
-
/** Input does not exist in the scope searched. */
|
28
24
|
GIT_ENOTFOUND = -3,
|
29
|
-
|
30
|
-
/** Not enough space available. */
|
31
25
|
GIT_ENOMEM = -4,
|
32
|
-
|
33
|
-
/** Consult the OS error information. */
|
34
26
|
GIT_EOSERR = -5,
|
35
|
-
|
36
|
-
/** The specified object is of invalid type */
|
37
27
|
GIT_EOBJTYPE = -6,
|
38
|
-
|
39
|
-
/** The specified repository is invalid */
|
40
28
|
GIT_ENOTAREPO = -7,
|
41
|
-
|
42
|
-
/** The object type is invalid or doesn't match */
|
43
29
|
GIT_EINVALIDTYPE = -8,
|
44
|
-
|
45
|
-
/** The object cannot be written because it's missing internal data */
|
46
30
|
GIT_EMISSINGOBJDATA = -9,
|
47
|
-
|
48
|
-
/** The packfile for the ODB is corrupted */
|
49
31
|
GIT_EPACKCORRUPTED = -10,
|
50
|
-
|
51
|
-
/** Failed to acquire or release a file lock */
|
52
32
|
GIT_EFLOCKFAIL = -11,
|
53
|
-
|
54
|
-
/** The Z library failed to inflate/deflate an object's data */
|
55
33
|
GIT_EZLIB = -12,
|
56
|
-
|
57
|
-
/** The queried object is currently busy */
|
58
34
|
GIT_EBUSY = -13,
|
59
|
-
|
60
|
-
/** The index file is not backed up by an existing repository */
|
61
35
|
GIT_EBAREINDEX = -14,
|
62
|
-
|
63
|
-
/** The name of the reference is not valid */
|
64
36
|
GIT_EINVALIDREFNAME = -15,
|
65
|
-
|
66
|
-
/** The specified reference has its data corrupted */
|
67
37
|
GIT_EREFCORRUPTED = -16,
|
68
|
-
|
69
|
-
/** The specified symbolic reference is too deeply nested */
|
70
38
|
GIT_ETOONESTEDSYMREF = -17,
|
71
|
-
|
72
|
-
/** The pack-refs file is either corrupted or its format is not currently supported */
|
73
39
|
GIT_EPACKEDREFSCORRUPTED = -18,
|
74
|
-
|
75
|
-
/** The path is invalid */
|
76
40
|
GIT_EINVALIDPATH = -19,
|
77
|
-
|
78
|
-
/** The revision walker is empty; there are no more commits left to iterate */
|
79
41
|
GIT_EREVWALKOVER = -20,
|
80
|
-
|
81
|
-
/** The state of the reference is not valid */
|
82
42
|
GIT_EINVALIDREFSTATE = -21,
|
83
|
-
|
84
|
-
/** This feature has not been implemented yet */
|
85
43
|
GIT_ENOTIMPLEMENTED = -22,
|
86
|
-
|
87
|
-
/** A reference with this name already exists */
|
88
44
|
GIT_EEXISTS = -23,
|
89
|
-
|
90
|
-
/** The given integer literal is too large to be parsed */
|
91
45
|
GIT_EOVERFLOW = -24,
|
92
|
-
|
93
|
-
/** The given literal is not a valid number */
|
94
46
|
GIT_ENOTNUM = -25,
|
95
|
-
|
96
|
-
/** Streaming error */
|
97
47
|
GIT_ESTREAM = -26,
|
98
|
-
|
99
|
-
/** invalid arguments to function */
|
100
48
|
GIT_EINVALIDARGS = -27,
|
101
|
-
|
102
|
-
/** The specified object has its data corrupted */
|
103
49
|
GIT_EOBJCORRUPTED = -28,
|
104
|
-
|
105
|
-
/** The given short oid is ambiguous */
|
106
|
-
GIT_EAMBIGUOUSOIDPREFIX = -29,
|
107
|
-
|
108
|
-
/** Skip and passthrough the given ODB backend */
|
50
|
+
GIT_EAMBIGUOUS = -29,
|
109
51
|
GIT_EPASSTHROUGH = -30,
|
110
|
-
|
111
|
-
/** The path pattern and string did not match */
|
112
52
|
GIT_ENOMATCH = -31,
|
113
|
-
|
114
|
-
/** The buffer is too short to satisfy the request */
|
115
53
|
GIT_ESHORTBUFFER = -32,
|
54
|
+
};
|
55
|
+
#endif
|
56
|
+
|
57
|
+
/** Generic return codes */
|
58
|
+
enum {
|
59
|
+
GIT_OK = 0,
|
60
|
+
GIT_ERROR = -1,
|
61
|
+
GIT_ENOTFOUND = -3,
|
62
|
+
GIT_EEXISTS = -4,
|
63
|
+
GIT_EAMBIGUOUS = -5,
|
64
|
+
GIT_EBUFS = -6,
|
65
|
+
|
66
|
+
GIT_PASSTHROUGH = -30,
|
67
|
+
GIT_REVWALKOVER = -31,
|
68
|
+
};
|
69
|
+
|
70
|
+
typedef struct {
|
71
|
+
char *message;
|
72
|
+
int klass;
|
116
73
|
} git_error;
|
117
74
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
75
|
+
typedef enum {
|
76
|
+
GITERR_NOMEMORY,
|
77
|
+
GITERR_OS,
|
78
|
+
GITERR_INVALID,
|
79
|
+
GITERR_REFERENCE,
|
80
|
+
GITERR_ZLIB,
|
81
|
+
GITERR_REPOSITORY,
|
82
|
+
GITERR_CONFIG,
|
83
|
+
GITERR_REGEX,
|
84
|
+
GITERR_ODB,
|
85
|
+
GITERR_INDEX,
|
86
|
+
GITERR_OBJECT,
|
87
|
+
GITERR_NET,
|
88
|
+
GITERR_TAG,
|
89
|
+
GITERR_TREE,
|
90
|
+
GITERR_INDEXER,
|
91
|
+
GITERR_SSL,
|
92
|
+
} git_error_t;
|
124
93
|
|
125
94
|
/**
|
126
|
-
*
|
127
|
-
*
|
128
|
-
* Get a string description for a given error code.
|
129
|
-
* NOTE: This method will be eventually deprecated in favor
|
130
|
-
* of the new `git_lasterror`.
|
95
|
+
* Return the last `git_error` object that was generated for the
|
96
|
+
* current thread or NULL if no error has occurred.
|
131
97
|
*
|
132
|
-
* @
|
133
|
-
* @return a string explaining the error code
|
98
|
+
* @return A git_error object.
|
134
99
|
*/
|
135
|
-
GIT_EXTERN(const
|
100
|
+
GIT_EXTERN(const git_error *) giterr_last(void);
|
136
101
|
|
137
102
|
/**
|
138
|
-
* Clear the
|
103
|
+
* Clear the last library error that occurred for this thread.
|
139
104
|
*/
|
140
|
-
GIT_EXTERN(void)
|
105
|
+
GIT_EXTERN(void) giterr_clear(void);
|
141
106
|
|
142
107
|
/** @} */
|
143
108
|
GIT_END_DECL
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (C) 2009-
|
2
|
+
* Copyright (C) 2009-2012 the libgit2 contributors
|
3
3
|
*
|
4
4
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
@@ -106,7 +106,7 @@ typedef struct git_index_entry_unmerged {
|
|
106
106
|
*
|
107
107
|
* @param index the pointer for the new index
|
108
108
|
* @param index_path the path to the index file in disk
|
109
|
-
* @return
|
109
|
+
* @return 0 or an error code
|
110
110
|
*/
|
111
111
|
GIT_EXTERN(int) git_index_open(git_index **index, const char *index_path);
|
112
112
|
|
@@ -131,7 +131,7 @@ GIT_EXTERN(void) git_index_free(git_index *index);
|
|
131
131
|
* by reading from the hard disk.
|
132
132
|
*
|
133
133
|
* @param index an existing index object
|
134
|
-
* @return
|
134
|
+
* @return 0 or an error code
|
135
135
|
*/
|
136
136
|
GIT_EXTERN(int) git_index_read(git_index *index);
|
137
137
|
|
@@ -140,7 +140,7 @@ GIT_EXTERN(int) git_index_read(git_index *index);
|
|
140
140
|
* using an atomic file lock.
|
141
141
|
*
|
142
142
|
* @param index an existing index object
|
143
|
-
* @return
|
143
|
+
* @return 0 or an error code
|
144
144
|
*/
|
145
145
|
GIT_EXTERN(int) git_index_write(git_index *index);
|
146
146
|
|
@@ -169,10 +169,14 @@ GIT_EXTERN(void) git_index_uniq(git_index *index);
|
|
169
169
|
*
|
170
170
|
* This method will fail in bare index instances.
|
171
171
|
*
|
172
|
+
* This forces the file to be added to the index, not looking
|
173
|
+
* at gitignore rules. Those rules can be evaluated through
|
174
|
+
* the git_status APIs (in status.h) before calling this.
|
175
|
+
*
|
172
176
|
* @param index an existing index object
|
173
177
|
* @param path filename to add
|
174
178
|
* @param stage stage for the entry
|
175
|
-
* @return
|
179
|
+
* @return 0 or an error code
|
176
180
|
*/
|
177
181
|
GIT_EXTERN(int) git_index_add(git_index *index, const char *path, int stage);
|
178
182
|
|
@@ -184,7 +188,7 @@ GIT_EXTERN(int) git_index_add(git_index *index, const char *path, int stage);
|
|
184
188
|
*
|
185
189
|
* @param index an existing index object
|
186
190
|
* @param source_entry new entry object
|
187
|
-
* @return
|
191
|
+
* @return 0 or an error code
|
188
192
|
*/
|
189
193
|
GIT_EXTERN(int) git_index_add2(git_index *index, const git_index_entry *source_entry);
|
190
194
|
|
@@ -203,7 +207,7 @@ GIT_EXTERN(int) git_index_add2(git_index *index, const git_index_entry *source_e
|
|
203
207
|
* @param index an existing index object
|
204
208
|
* @param path filename to add
|
205
209
|
* @param stage stage for the entry
|
206
|
-
* @return
|
210
|
+
* @return 0 or an error code
|
207
211
|
*/
|
208
212
|
GIT_EXTERN(int) git_index_append(git_index *index, const char *path, int stage);
|
209
213
|
|
@@ -220,7 +224,7 @@ GIT_EXTERN(int) git_index_append(git_index *index, const char *path, int stage);
|
|
220
224
|
*
|
221
225
|
* @param index an existing index object
|
222
226
|
* @param source_entry new entry object
|
223
|
-
* @return
|
227
|
+
* @return 0 or an error code
|
224
228
|
*/
|
225
229
|
GIT_EXTERN(int) git_index_append2(git_index *index, const git_index_entry *source_entry);
|
226
230
|
|
@@ -229,7 +233,7 @@ GIT_EXTERN(int) git_index_append2(git_index *index, const git_index_entry *sourc
|
|
229
233
|
*
|
230
234
|
* @param index an existing index object
|
231
235
|
* @param position position of the entry to remove
|
232
|
-
* @return
|
236
|
+
* @return 0 or an error code
|
233
237
|
*/
|
234
238
|
GIT_EXTERN(int) git_index_remove(git_index *index, int position);
|
235
239
|
|
@@ -291,7 +295,7 @@ GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged_byindex(git_
|
|
291
295
|
/**
|
292
296
|
* Return the stage number from a git index entry
|
293
297
|
*
|
294
|
-
* This entry is calculated from the
|
298
|
+
* This entry is calculated from the entry's flag
|
295
299
|
* attribute like this:
|
296
300
|
*
|
297
301
|
* (entry->flags & GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT
|
@@ -301,6 +305,17 @@ GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged_byindex(git_
|
|
301
305
|
*/
|
302
306
|
GIT_EXTERN(int) git_index_entry_stage(const git_index_entry *entry);
|
303
307
|
|
308
|
+
/**
|
309
|
+
* Read a tree into the index file
|
310
|
+
*
|
311
|
+
* The current index contents will be replaced by the specified tree.
|
312
|
+
*
|
313
|
+
* @param index an existing index object
|
314
|
+
* @param tree tree to read
|
315
|
+
* @return 0 or an error code
|
316
|
+
*/
|
317
|
+
GIT_EXTERN(int) git_index_read_tree(git_index *index, git_tree *tree);
|
318
|
+
|
304
319
|
/** @} */
|
305
320
|
GIT_END_DECL
|
306
321
|
#endif
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (C) 2009-
|
2
|
+
* Copyright (C) 2009-2012 the libgit2 contributors
|
3
3
|
*
|
4
4
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
@@ -23,6 +23,51 @@ typedef struct git_indexer_stats {
|
|
23
23
|
|
24
24
|
|
25
25
|
typedef struct git_indexer git_indexer;
|
26
|
+
typedef struct git_indexer_stream git_indexer_stream;
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Create a new streaming indexer instance
|
30
|
+
*
|
31
|
+
* @param out where to store the indexer instance
|
32
|
+
* @param path to the gitdir (metadata directory)
|
33
|
+
*/
|
34
|
+
GIT_EXTERN(int) git_indexer_stream_new(git_indexer_stream **out, const char *gitdir);
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Add data to the indexer
|
38
|
+
*
|
39
|
+
* @param idx the indexer
|
40
|
+
* @param data the data to add
|
41
|
+
* @param size the size of the data
|
42
|
+
* @param stats stat storage
|
43
|
+
*/
|
44
|
+
GIT_EXTERN(int) git_indexer_stream_add(git_indexer_stream *idx, const void *data, size_t size, git_indexer_stats *stats);
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Finalize the pack and index
|
48
|
+
*
|
49
|
+
* Resolve any pending deltas and write out the index file
|
50
|
+
*
|
51
|
+
* @param idx the indexer
|
52
|
+
*/
|
53
|
+
GIT_EXTERN(int) git_indexer_stream_finalize(git_indexer_stream *idx, git_indexer_stats *stats);
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Get the packfile's hash
|
57
|
+
*
|
58
|
+
* A packfile's name is derived from the sorted hashing of all object
|
59
|
+
* names. This is only correct after the index has been finalized.
|
60
|
+
*
|
61
|
+
* @param idx the indexer instance
|
62
|
+
*/
|
63
|
+
GIT_EXTERN(const git_oid *) git_indexer_stream_hash(git_indexer_stream *idx);
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Free the indexer and its resources
|
67
|
+
*
|
68
|
+
* @param idx the indexer to free
|
69
|
+
*/
|
70
|
+
GIT_EXTERN(void) git_indexer_stream_free(git_indexer_stream *idx);
|
26
71
|
|
27
72
|
/**
|
28
73
|
* Create a new indexer instance
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) 2009-2012 the libgit2 contributors
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
#ifndef INCLUDE_git_merge_h__
|
8
|
+
#define INCLUDE_git_merge_h__
|
9
|
+
|
10
|
+
#include "common.h"
|
11
|
+
#include "types.h"
|
12
|
+
#include "oid.h"
|
13
|
+
|
14
|
+
/**
|
15
|
+
* @file git2/merge.h
|
16
|
+
* @brief Git merge-base routines
|
17
|
+
* @defgroup git_revwalk Git merge-base routines
|
18
|
+
* @ingroup Git
|
19
|
+
* @{
|
20
|
+
*/
|
21
|
+
GIT_BEGIN_DECL
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Find a merge base between two commits
|
25
|
+
*
|
26
|
+
* @param out the OID of a merge base between 'one' and 'two'
|
27
|
+
* @param repo the repository where the commits exist
|
28
|
+
* @param one one of the commits
|
29
|
+
* @param two the other commit
|
30
|
+
*/
|
31
|
+
GIT_EXTERN(int) git_merge_base(git_oid *out, git_repository *repo, git_oid *one, git_oid *two);
|
32
|
+
|
33
|
+
/** @} */
|
34
|
+
GIT_END_DECL
|
35
|
+
#endif
|
@@ -0,0 +1,139 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) 2009-2012 the libgit2 contributors
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
#ifndef INCLUDE_git_note_h__
|
8
|
+
#define INCLUDE_git_note_h__
|
9
|
+
|
10
|
+
#include "oid.h"
|
11
|
+
|
12
|
+
/**
|
13
|
+
* @file git2/notes.h
|
14
|
+
* @brief Git notes management routines
|
15
|
+
* @defgroup git_note Git notes management routines
|
16
|
+
* @ingroup Git
|
17
|
+
* @{
|
18
|
+
*/
|
19
|
+
GIT_BEGIN_DECL
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Read the note for an object
|
23
|
+
*
|
24
|
+
* The note must be freed manually by the user.
|
25
|
+
*
|
26
|
+
* @param note the note; NULL in case of error
|
27
|
+
* @param repo the Git repository
|
28
|
+
* @param notes_ref OID reference to use (optional); defaults to "refs/notes/commits"
|
29
|
+
* @param oid OID of the object
|
30
|
+
*
|
31
|
+
* @return 0 or an error code
|
32
|
+
*/
|
33
|
+
GIT_EXTERN(int) git_note_read(git_note **note, git_repository *repo,
|
34
|
+
const char *notes_ref, const git_oid *oid);
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Get the note message
|
38
|
+
*
|
39
|
+
* @param note
|
40
|
+
* @return the note message
|
41
|
+
*/
|
42
|
+
GIT_EXTERN(const char *) git_note_message(git_note *note);
|
43
|
+
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Get the note object OID
|
47
|
+
*
|
48
|
+
* @param note
|
49
|
+
* @return the note object OID
|
50
|
+
*/
|
51
|
+
GIT_EXTERN(const git_oid *) git_note_oid(git_note *note);
|
52
|
+
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Add a note for an object
|
56
|
+
*
|
57
|
+
* @param oid pointer to store the OID (optional); NULL in case of error
|
58
|
+
* @param repo the Git repository
|
59
|
+
* @param author signature of the notes commit author
|
60
|
+
* @param committer signature of the notes commit committer
|
61
|
+
* @param notes_ref OID reference to update (optional); defaults to "refs/notes/commits"
|
62
|
+
* @param oid The OID of the object
|
63
|
+
* @param oid The note to add for object oid
|
64
|
+
*
|
65
|
+
* @return 0 or an error code
|
66
|
+
*/
|
67
|
+
GIT_EXTERN(int) git_note_create(git_oid *out, git_repository *repo,
|
68
|
+
git_signature *author, git_signature *committer,
|
69
|
+
const char *notes_ref, const git_oid *oid,
|
70
|
+
const char *note);
|
71
|
+
|
72
|
+
|
73
|
+
/**
|
74
|
+
* Remove the note for an object
|
75
|
+
*
|
76
|
+
* @param repo the Git repository
|
77
|
+
* @param notes_ref OID reference to use (optional); defaults to "refs/notes/commits"
|
78
|
+
* @param author signature of the notes commit author
|
79
|
+
* @param committer signature of the notes commit committer
|
80
|
+
* @param oid the oid which note's to be removed
|
81
|
+
*
|
82
|
+
* @return 0 or an error code
|
83
|
+
*/
|
84
|
+
GIT_EXTERN(int) git_note_remove(git_repository *repo, const char *notes_ref,
|
85
|
+
git_signature *author, git_signature *committer,
|
86
|
+
const git_oid *oid);
|
87
|
+
|
88
|
+
/**
|
89
|
+
* Free a git_note object
|
90
|
+
*
|
91
|
+
* @param note git_note object
|
92
|
+
*/
|
93
|
+
GIT_EXTERN(void) git_note_free(git_note *note);
|
94
|
+
|
95
|
+
/**
|
96
|
+
* Get the default notes reference for a repository
|
97
|
+
*
|
98
|
+
* @param out Pointer to the default notes reference
|
99
|
+
* @param repo The Git repository
|
100
|
+
*
|
101
|
+
* @return 0 or an error code
|
102
|
+
*/
|
103
|
+
GIT_EXTERN(int) git_note_default_ref(const char **out, git_repository *repo);
|
104
|
+
|
105
|
+
/**
|
106
|
+
* Basic components of a note
|
107
|
+
*
|
108
|
+
* - Oid of the blob containing the message
|
109
|
+
* - Oid of the git object being annotated
|
110
|
+
*/
|
111
|
+
typedef struct {
|
112
|
+
git_oid blob_oid;
|
113
|
+
git_oid annotated_object_oid;
|
114
|
+
} git_note_data;
|
115
|
+
|
116
|
+
/**
|
117
|
+
* Loop over all the notes within a specified namespace
|
118
|
+
* and issue a callback for each one.
|
119
|
+
*
|
120
|
+
* @param repo Repository where to find the notes.
|
121
|
+
*
|
122
|
+
* @param notes_ref OID reference to read from (optional); defaults to "refs/notes/commits".
|
123
|
+
*
|
124
|
+
* @param note_cb Callback to invoke per found annotation.
|
125
|
+
*
|
126
|
+
* @param payload Extra parameter to callback function.
|
127
|
+
*
|
128
|
+
* @return 0 or an error code.
|
129
|
+
*/
|
130
|
+
GIT_EXTERN(int) git_note_foreach(
|
131
|
+
git_repository *repo,
|
132
|
+
const char *notes_ref,
|
133
|
+
int (*note_cb)(git_note_data *note_data, void *payload),
|
134
|
+
void *payload
|
135
|
+
);
|
136
|
+
|
137
|
+
/** @} */
|
138
|
+
GIT_END_DECL
|
139
|
+
#endif
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (C) 2009-
|
2
|
+
* Copyright (C) 2009-2012 the libgit2 contributors
|
3
3
|
*
|
4
4
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
@@ -21,7 +21,7 @@
|
|
21
21
|
GIT_BEGIN_DECL
|
22
22
|
|
23
23
|
/**
|
24
|
-
* Lookup a reference to one of the objects in a
|
24
|
+
* Lookup a reference to one of the objects in a repository.
|
25
25
|
*
|
26
26
|
* The generated reference is owned by the repository and
|
27
27
|
* should be closed with the `git_object_free` method
|
@@ -45,7 +45,7 @@ GIT_EXTERN(int) git_object_lookup(
|
|
45
45
|
git_otype type);
|
46
46
|
|
47
47
|
/**
|
48
|
-
* Lookup a reference to one of the objects in a
|
48
|
+
* Lookup a reference to one of the objects in a repository,
|
49
49
|
* given a prefix of its identifier (short id).
|
50
50
|
*
|
51
51
|
* The object obtained will be so that its identifier
|
@@ -69,7 +69,7 @@ GIT_EXTERN(int) git_object_lookup(
|
|
69
69
|
* @param id a short identifier for the object
|
70
70
|
* @param len the length of the short identifier
|
71
71
|
* @param type the type of the object
|
72
|
-
* @return
|
72
|
+
* @return 0 or an error code
|
73
73
|
*/
|
74
74
|
GIT_EXTERN(int) git_object_lookup_prefix(
|
75
75
|
git_object **object_out,
|
@@ -114,7 +114,7 @@ GIT_EXTERN(git_repository *) git_object_owner(const git_object *obj);
|
|
114
114
|
* This method instructs the library to close an existing
|
115
115
|
* object; note that git_objects are owned and cached by the repository
|
116
116
|
* so the object may or may not be freed after this library call,
|
117
|
-
* depending on how
|
117
|
+
* depending on how aggressive is the caching mechanism used
|
118
118
|
* by the repository.
|
119
119
|
*
|
120
120
|
* IMPORTANT:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (C) 2009-
|
2
|
+
* Copyright (C) 2009-2012 the libgit2 contributors
|
3
3
|
*
|
4
4
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
@@ -29,7 +29,7 @@ GIT_BEGIN_DECL
|
|
29
29
|
*
|
30
30
|
* @param out location to store the database pointer, if opened.
|
31
31
|
* Set to NULL if the open failed.
|
32
|
-
* @return
|
32
|
+
* @return 0 or an error code
|
33
33
|
*/
|
34
34
|
GIT_EXTERN(int) git_odb_new(git_odb **out);
|
35
35
|
|
@@ -47,7 +47,7 @@ GIT_EXTERN(int) git_odb_new(git_odb **out);
|
|
47
47
|
* @param out location to store the database pointer, if opened.
|
48
48
|
* Set to NULL if the open failed.
|
49
49
|
* @param objects_dir path of the backends' "objects" directory.
|
50
|
-
* @return
|
50
|
+
* @return 0 or an error code
|
51
51
|
*/
|
52
52
|
GIT_EXTERN(int) git_odb_open(git_odb **out, const char *objects_dir);
|
53
53
|
|
@@ -62,7 +62,7 @@ GIT_EXTERN(int) git_odb_open(git_odb **out, const char *objects_dir);
|
|
62
62
|
* @param odb database to add the backend to
|
63
63
|
* @param backend pointer to a git_odb_backend instance
|
64
64
|
* @param priority Value for ordering the backends queue
|
65
|
-
* @return 0 on
|
65
|
+
* @return 0 on success; error code otherwise
|
66
66
|
*/
|
67
67
|
GIT_EXTERN(int) git_odb_add_backend(git_odb *odb, git_odb_backend *backend, int priority);
|
68
68
|
|
@@ -83,7 +83,7 @@ GIT_EXTERN(int) git_odb_add_backend(git_odb *odb, git_odb_backend *backend, int
|
|
83
83
|
* @param odb database to add the backend to
|
84
84
|
* @param backend pointer to a git_odb_backend instance
|
85
85
|
* @param priority Value for ordering the backends queue
|
86
|
-
* @return 0 on
|
86
|
+
* @return 0 on success; error code otherwise
|
87
87
|
*/
|
88
88
|
GIT_EXTERN(int) git_odb_add_alternate(git_odb *odb, git_odb_backend *backend, int priority);
|
89
89
|
|
@@ -108,7 +108,7 @@ GIT_EXTERN(void) git_odb_free(git_odb *db);
|
|
108
108
|
* @param db database to search for the object in.
|
109
109
|
* @param id identity of the object to read.
|
110
110
|
* @return
|
111
|
-
* -
|
111
|
+
* - 0 if the object was read;
|
112
112
|
* - GIT_ENOTFOUND if the object is not in the database.
|
113
113
|
*/
|
114
114
|
GIT_EXTERN(int) git_odb_read(git_odb_object **out, git_odb *db, const git_oid *id);
|
@@ -135,7 +135,7 @@ GIT_EXTERN(int) git_odb_read(git_odb_object **out, git_odb *db, const git_oid *i
|
|
135
135
|
* @param db database to search for the object in.
|
136
136
|
* @param short_id a prefix of the id of the object to read.
|
137
137
|
* @param len the length of the prefix
|
138
|
-
* @return
|
138
|
+
* @return 0 if the object was read;
|
139
139
|
* GIT_ENOTFOUND if the object is not in the database.
|
140
140
|
* GIT_EAMBIGUOUS if the prefix is ambiguous (several objects match the prefix)
|
141
141
|
*/
|
@@ -156,7 +156,7 @@ GIT_EXTERN(int) git_odb_read_prefix(git_odb_object **out, git_odb *db, const git
|
|
156
156
|
* @param db database to search for the object in.
|
157
157
|
* @param id identity of the object to read.
|
158
158
|
* @return
|
159
|
-
* -
|
159
|
+
* - 0 if the object was read;
|
160
160
|
* - GIT_ENOTFOUND if the object is not in the database.
|
161
161
|
*/
|
162
162
|
GIT_EXTERN(int) git_odb_read_header(size_t *len_p, git_otype *type_p, git_odb *db, const git_oid *id);
|
@@ -185,10 +185,10 @@ GIT_EXTERN(int) git_odb_exists(git_odb *db, const git_oid *id);
|
|
185
185
|
*
|
186
186
|
* @param oid pointer to store the OID result of the write
|
187
187
|
* @param odb object database where to store the object
|
188
|
-
* @param data buffer with the data to
|
188
|
+
* @param data buffer with the data to store
|
189
189
|
* @param len size of the buffer
|
190
190
|
* @param type type of the data to store
|
191
|
-
* @return
|
191
|
+
* @return 0 or an error code
|
192
192
|
*/
|
193
193
|
GIT_EXTERN(int) git_odb_write(git_oid *oid, git_odb *odb, const void *data, size_t len, git_otype type);
|
194
194
|
|
@@ -250,14 +250,14 @@ GIT_EXTERN(int) git_odb_open_rstream(git_odb_stream **stream, git_odb *db, const
|
|
250
250
|
/**
|
251
251
|
* Determine the object-ID (sha1 hash) of a data buffer
|
252
252
|
*
|
253
|
-
* The resulting SHA-1 OID will the
|
253
|
+
* The resulting SHA-1 OID will be the identifier for the data
|
254
254
|
* buffer as if the data buffer it were to written to the ODB.
|
255
255
|
*
|
256
256
|
* @param id the resulting object-ID.
|
257
257
|
* @param data data to hash
|
258
258
|
* @param len size of the data
|
259
259
|
* @param type of the data to hash
|
260
|
-
* @return
|
260
|
+
* @return 0 or an error code
|
261
261
|
*/
|
262
262
|
GIT_EXTERN(int) git_odb_hash(git_oid *id, const void *data, size_t len, git_otype type);
|
263
263
|
|
@@ -270,7 +270,7 @@ GIT_EXTERN(int) git_odb_hash(git_oid *id, const void *data, size_t len, git_otyp
|
|
270
270
|
* @param out oid structure the result is written into.
|
271
271
|
* @param path file to read and determine object id for
|
272
272
|
* @param type the type of the object that will be hashed
|
273
|
-
* @return
|
273
|
+
* @return 0 or an error code
|
274
274
|
*/
|
275
275
|
GIT_EXTERN(int) git_odb_hashfile(git_oid *out, const char *path, git_otype type);
|
276
276
|
|