diff --git a/.travis.yml b/.travis.yml index 2b2add2f6..e1d7ff047 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ sudo: false -# update to Xenial in April 2019; Trusty will be EOL, Xenial new minimum supported OS version -dist: trusty +dist: xenial branches: only: @@ -21,9 +20,9 @@ env: - TARGET_ARCH="ia32" node_js: + - "12" - "10" - "8" - - "6" os: - linux diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d8d9e71..d7cfe392a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,933 @@ # Change Log +## v0.25.0 [(2019-08-09)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.24.3...v0.25.0) + +#### Summary of changes +##### BREAKING +- `getRemotes` no longer returns remote names, it now returns remote objects directly. Use `getRemoteNames` to get a list of remote names. +- Converted Buf.prototype.set and Buf.prototype.grow from async to sync +- `Repository.prototype.continueRebase` will now throw on any error except for EAPPLIED on the first call to `Rebase.prototype.next` +- Drops support for Ubuntu 14 after EOL +- Removed access to the `diff_so_far` param in `git_diff_notify_cb` and `git_diff_progress_cb` +- Changed `FilterSource.prototype.repo` to async to prevent segfaults on filters that run during `Submodule.status` +- Changed `NodeGit.Signature.default` to async, because it actually ends up reading the config. +- Fixed bug where templates were not reporting errors for synchronous methods. It's a bit of a wide net, but in general, + it is now possible certain sync methods in NodeGit will begin failing that did not fail before. This is the correct + behavior. + +##### Deprecations +- Support signing commits in `Repository.prototype.mergeBranches`. The last parameter `processMergeMessageCallback` is now deprecated, but will continue to work. Use the options object instead, which will contain the `processMergeMessageCallback`, as well as the `signingCb`. + +##### New +- Support for Node 12 +- Add signing support for commits and annotated tags + - Enforced consistent use of signing callbacks within the application. Any object that implements the signingCallback + pattern for signing commits or tags should use the exact same callback type and with the same meaning. + `type SigningCallback = (content: string) => {| code: number, field?: string, signedData?: string |};` + If the code is `NodeGit.Error.CODE.OK` or 0, the operation will succeed and _at least_ signedData is expected to be filled out. + If the code is a negative number, except for `NodeGit.Error.CODE.PASSTHROUGH`, the signing operation will fail. + If the code is `NodeGit.Error.CODE.PASSTHROUGH`, the operation will continue without signing the object. +- Exposed `AnnotatedCommit` methods: + - `AnnotatedCommit.prototype.ref` +- Exposed `Apply` methods: + - `Apply.apply` applies a diff to the repository + - `Apply.toTree` applies a diff to a tree +- Exposed `Config` methods: + - `Config.prototype.deleteEntry` + - `Config.prototype.deleteMultivar` + - `Config.prototype.getBool` + - `Config.prototype.getInt32` + - `Config.prototype.getInt64` + - `Config.prototype.setMultivar` + - `Config.prototype.snapshot` +- Exposed `ConfigIterator` with methods: + - `ConfigIterator.create` + - `ConfigIterator.createGlob` + - `ConfigIterator.createMultivar` + - `ConfigIterator.prototype.next` +- Exposed `IndexNameEntry`: + - `IndexNameEntry.add` + - `IndexNameEntry.clear` + - `IndexNameEntry.entryCount` + - `IndexNameEntry.getByIndex` + - `IndexNameEntry.prototype.ancestor` + - `IndexNameEntry.prototype.ours` + - `IndexNameEntry.prototype.theirs` +- Exposed `IndexReucEntry`: + - `IndexReucEntry.add` + - `IndexReucEntry.clear` + - `IndexReucEntry.entryCount` + - `IndexReucEntry.find` + - `IndexReucEntry.getByIndex` + - `IndexReucEntry.getByPath` + - `IndexReucEntry.remove` + - `IndexReucEntry.prototype.mode` + - `IndexReucEntry.prototype.oid` + - `IndexReucEntry.prototype.path` +- Exposed `Mailmap`: + - `Mailmap.prototype.addEntry` + - `Mailmap.fromBuffer` + - `Mailmap.fromRepository` + - `Mailmap.create` + - `Mailmap.prototype.resolve` + - `Mailmap.prototype.resolveSignature` +- Exposed `Merge` methods: + - `Merge.analysis` + - `Merge.analysisForRef` +- Exposed `Path.isGitfile` +- Added `RebaseOptions` to `Repository.prototype.rebaseContinue` +- Added `NodeGit.Reference.updateTerminal` +- Exposed `Remote` methods: + - `Remote.createWithOpts` +- Exposed `Tag.createFromBuffer` +- Expose `Tree.prototype.createUpdated(repo, numUpdates, updates)` + +##### Fixed +- Updates lodash dependency to address security notice +- Fixed a prototype problem with cherrypick, merge, and other collections that have a function at their root. call, apply, and bind should now be on NodeGit.Cherrypick. +- Bumped libssh2 to resolve security notice. +- Improve speed and correctness of fileHistoryWalk. The API should not have changed; however, when the end of the walk has been reached, `reachedEndOfHistory` will be specified on the resulting array. +- Fixes openssl prebuilt downloads for electron builds +- Fixes commits retrieved from `Commit.prototype.parent` +- Bump Node-Gyp to 4.0.0 to fix tar security vulnerability +- Optimized a set of routines in NodeGit. These methods as written in Javascript require hundreds or thousands of requests to async workers to retrieve data. We've batched these requests and performed them on a single async worker. There are now native implementations of the following: + - `Repository.prototype.getReferences`: Retrieves all references on async worker. + - `Repository.prototype.getRemotes`: Retrieves all remotes on async worker. + - `Repository.prototype.getSubmodules`: Retrieves all submodules on async worker. + - `Repository.prototype.refreshReferences`: Open sourced function from GitKraken. Grabs a lot of information about references on an async worker. + - `Revwalk.prototype.commitWalk`: Retrieves up to N commits from a revwalk on an async worker. +- When installing on a machine that has yarn and does not have npm, the preinstall script should succeed now +- `ceiling_dirs` is now an optional parameter to `Repository.discover` +- Added support for building on IBM i (PASE) machines +- Fixed leak where struct/option types were leaking libgit2 pointers +- Switched `NodeGit.Oid.fromString`'s internal implementation from `git_oid_fromstr` to `git_oid_fromstrp` +- Fixed builds for Electron 4 +- Updated `Signature.prototype.toString` to optionally include timestamps + +##### LibGit2 Bump +- Fixes gitignore issue with pattern negation +- `Remote.list` now gets the correct list of remotes if remotes are changed by external process +- Always use builtin regex for linux for portability +- Use Iconv on OSX for better internationalization support. +- Removed LibCurl from LibGit2: + - Now with built-in NTLM proxy support + - Now with built-in Negotiate/Kerberos proxy support + - Working with proxy URLs may be different as curl could auto detect scheme for proxies +- Various git config fixes +- Various git ignore fixes +- Various libgit2 performance improvements +- Windows/Linux now use PCRE for regex, OSX uses regcomp_l, this should address collation issues in diffing + +#### Merged PRs into NodeGit +- [Add deprecation warnings for enums that need them. #1711](https://github.com/nodegit/nodegit/pull/1711) +- [https://github.com/nodegit/nodegit/pull/1706](https://github.com/nodegit/nodegit/pull/1706) +- [Reintroduce Odb.prototype.addDiskAlternate #1695](https://github.com/nodegit/nodegit/pull/1695) +- [Fix behaviour of Repository#getReferences #1708](https://github.com/nodegit/nodegit/pull/1708) +- [Bump libgit2 #1705](https://github.com/nodegit/nodegit/pull/1705) +- [Fix Tree#createUpdated #1704](https://github.com/nodegit/nodegit/pull/1704) +- [Fix failing tests on CI #1703](https://github.com/nodegit/nodegit/pull/1703) +- [Audit lodash and fix package-lock.json #1702](https://github.com/nodegit/nodegit/pull/1702) +- [Implement support for Node 12 #1696](https://github.com/nodegit/nodegit/pull/1696) +- [Remove NSEC #1699](https://github.com/nodegit/nodegit/pull/1699) +- [Use builtin regex library for linux for better portability #1693](https://github.com/nodegit/nodegit/pull/1693) +- [Remove pcre-config from binding.gyp #1694](https://github.com/nodegit/nodegit/pull/1694) +- [refresh_references.cc: skip refs that can't be directly resolved #1689](https://github.com/nodegit/nodegit/pull/1689) +- [Bump libgit2 to fork of latest master #1690](https://github.com/nodegit/nodegit/pull/1690) +- [Bump libssh2 to 1.8.2 and fix some npm audit warnings #1678](https://github.com/nodegit/nodegit/pull/1678) +- [Root functions should keep their function prototypes correctly #1681](https://github.com/nodegit/nodegit/pull/1681) +- [refresh_references.cc: bust LibGit2 remote list cache by reading config #1685](https://github.com/nodegit/nodegit/pull/1685) +- [Implement faster file history walk #1676](https://github.com/nodegit/nodegit/pull/1676) +- [EOL for Node 6 and Ubuntu 14.04 #1649](https://github.com/nodegit/nodegit/pull/1649) +- [Ensures that commits from parent(*) has a repository #1658](https://github.com/nodegit/nodegit/pull/1658) +- [Update openssl conan distributions #1663](https://github.com/nodegit/nodegit/pull/1663) +- [Support signing in Repository#mergeBranches #1664](https://github.com/nodegit/nodegit/pull/1664) +- [Dependency upgrade node-gyp upgraded to 4.0.0 #1672](https://github.com/nodegit/nodegit/pull/1672) +- [Add additional getters to streamline information gathering (breaking change) #1671](https://github.com/nodegit/nodegit/pull/1671) +- [Clean up some dangerous memory accesses in callbacks #1642](https://github.com/nodegit/nodegit/pull/1642) +- [Output the item that was deprecated when giving deprecation notice #1643](https://github.com/nodegit/nodegit/pull/1643) +- [Don't fail yarn installs when we can't find npm #1644](https://github.com/nodegit/nodegit/pull/1644) +- [`ceiling_dirs` parameter in `Repository.discover` is optional #1245](https://github.com/nodegit/nodegit/pull/1245) +- [Add missing `shouldAlloc` declarations for git_merge_analysis* functions #1641](https://github.com/nodegit/nodegit/pull/1641) +- [Fix regex state causing subsequent runs of Tag.extractSignature to fail #1630](https://github.com/nodegit/nodegit/pull/1630) +- [Update LibGit2 docs to v0.28.0 #1631](https://github.com/nodegit/nodegit/pull/1631) +- [Add support for building on IBM i (PASE) #1634](https://github.com/nodegit/nodegit/pull/1634) +- [Expose more config methods #1635](https://github.com/nodegit/nodegit/pull/1635) +- [Catch errors and pass them to libgit2 as error codes in rebase signingcb #1636](https://github.com/nodegit/nodegit/pull/1636) +- [Simplify check for IBM i operating system #1637](https://github.com/nodegit/nodegit/pull/1637) +- [Bump LibGit2 to fork of v0.28.1 #1638](https://github.com/nodegit/nodegit/pull/1638) +- [We should clear the persistent cell in structs when they are destroyed #1629](https://github.com/nodegit/nodegit/pull/1629) +- [Fix "errorno" typo #1628](https://github.com/nodegit/nodegit/pull/1628) +- [Bump Libgit2 fork to v0.28.0 #1627](https://github.com/nodegit/nodegit/pull/1627) +- [Fix macOS and Windows Electron 4 builds #1626](https://github.com/nodegit/nodegit/pull/1626) +- [Fix non-existent / dangling refs cause Repository.prototype.createCommitWithSignature to fail #1624](https://github.com/nodegit/nodegit/pull/1624) +- [Handle new gyp information for electron builds #1623](https://github.com/nodegit/nodegit/pull/1623) +- [Use same API for signingCb in all places that can be crypto signed #1621](https://github.com/nodegit/nodegit/pull/1621) +- [Breaking: Repository.prototype.continueRebase enhancements #1619](https://github.com/nodegit/nodegit/pull/1619) +- [adds support for gpg commit signing (fixes #1018) #1448](https://github.com/nodegit/nodegit/pull/1448) +- [Add `updateRef` parameter to Repository#createCommitWithSignature #1610](https://github.com/nodegit/nodegit/pull/1610) +- [Documentation fixes. #1611](https://github.com/nodegit/nodegit/pull/1611) +- [Add Commit#amendWithSignature #1616](https://github.com/nodegit/nodegit/pull/1616) +- [Bump libgit2 to a preview of v0.28 #1615](https://github.com/nodegit/nodegit/pull/1615) +- [Fix issues with Commit#amendWithSignature #1617](https://github.com/nodegit/nodegit/pull/1617) +- [Marked Repository.createBlobFromBuffer as async #1614](https://github.com/nodegit/nodegit/pull/1614) +- [Add functionality for creating Tags with signatures and extracting signatures from Tags #1618](https://github.com/nodegit/nodegit/pull/1618) + +#### Merged PRs into LibGit2 +- [Add sign capability to git_rebase_commit #4913](https://github.com/libgit2/libgit2/pull/4913) +- [Parallelize checkout_create_the_new for perf #4205](https://github.com/libgit2/libgit2/pull/4205) +- [config_file: refresh when creating an iterator](https://github.com/libgit2/libgit2/pull/5181) +- [azure: drop powershell](https://github.com/libgit2/libgit2/pull/5141) +- [fuzzer: use futils instead of fileops](https://github.com/libgit2/libgit2/pull/5180) +- [w32: fix unlinking of directory symlinks](https://github.com/libgit2/libgit2/pull/5151) +- [patch_parse: fix segfault due to line containing static contents](https://github.com/libgit2/libgit2/pull/5179) +- [ignore: fix determining whether a shorter pattern negates another](https://github.com/libgit2/libgit2/pull/5173) +- [patch_parse: handle missing newline indicator in old file](https://github.com/libgit2/libgit2/pull/5159) +- [patch_parse: do not depend on parsed buffer's lifetime](https://github.com/libgit2/libgit2/pull/5158) +- [sha1: fix compilation of WinHTTP backend](https://github.com/libgit2/libgit2/pull/5174) +- [repository: do not initialize HEAD if it's provided by templates](https://github.com/libgit2/libgit2/pull/5176) +- [configuration: cvar -> configmap](https://github.com/libgit2/libgit2/pull/5138) +- [Evict cache items more efficiently](https://github.com/libgit2/libgit2/pull/5172) +- [clar: fix suite count](https://github.com/libgit2/libgit2/pull/5175) +- [Ignore VS2017 specific files and folders](https://github.com/libgit2/libgit2/pull/5163) +- [gitattributes: ignore macros defined in subdirectories](https://github.com/libgit2/libgit2/pull/5156) +- [clar: correctly account for "data" suites when counting](https://github.com/libgit2/libgit2/pull/5168) +- [Allocate memory more efficiently when packing objects](https://github.com/libgit2/libgit2/pull/5170) +- [fileops: fix creation of directory in filesystem root](https://github.com/libgit2/libgit2/pull/5131) +- [win32: fix fuzzers and have CI build them](https://github.com/libgit2/libgit2/pull/5160) +- [Config parser separation](https://github.com/libgit2/libgit2/pull/5134) +- [config_file: implement stat cache to avoid repeated rehashing](https://github.com/libgit2/libgit2/pull/5132) +- [ci: build with ENABLE_WERROR on Windows](https://github.com/libgit2/libgit2/pull/5143) +- [Fix Regression: attr: Correctly load system attr file (on Windows)](https://github.com/libgit2/libgit2/pull/5152) +- [hash: fix missing error return on production builds](https://github.com/libgit2/libgit2/pull/5145) +- [Resolve static check warnings in example code](https://github.com/libgit2/libgit2/pull/5142) +- [Multiple hash algorithms](https://github.com/libgit2/libgit2/pull/4438) +- [More documentation](https://github.com/libgit2/libgit2/pull/5128) +- [Incomplete commondir support](https://github.com/libgit2/libgit2/pull/4967) +- [Remove warnings](https://github.com/libgit2/libgit2/pull/5078) +- [Re-run flaky tests](https://github.com/libgit2/libgit2/pull/5140) +- [errors: use lowercase](https://github.com/libgit2/libgit2/pull/5137) +- [largefile tests: only write 2GB on 32-bit platforms](https://github.com/libgit2/libgit2/pull/5136) +- [Fix broken link in README](https://github.com/libgit2/libgit2/pull/5129) +- [net: remove unused `git_headlist_cb`](https://github.com/libgit2/libgit2/pull/5122) +- [cmake: default NTLM client to off if no HTTPS support](https://github.com/libgit2/libgit2/pull/5124) +- [attr: rename constants and macros for consistency](https://github.com/libgit2/libgit2/pull/5119) +- [Change API instances of `fromnoun` to `from_noun` (with an underscore)](https://github.com/libgit2/libgit2/pull/5117) +- [object: rename git_object__size to git_object_size](https://github.com/libgit2/libgit2/pull/5118) +- [Replace fnmatch with wildmatch](https://github.com/libgit2/libgit2/pull/5110) +- [Documentation fixes](https://github.com/libgit2/libgit2/pull/5111) +- [Removal of `p_fallocate`](https://github.com/libgit2/libgit2/pull/5114) +- [Modularize our TLS & hash detection](https://github.com/libgit2/libgit2/pull/5055) +- [tests: merge::analysis: use test variants to avoid duplicated test suites](https://github.com/libgit2/libgit2/pull/5109) +- [Rename options initialization functions](https://github.com/libgit2/libgit2/pull/5101) +- [deps: ntlmclient: disable implicit fallthrough warnings](https://github.com/libgit2/libgit2/pull/5112) +- [gitignore with escapes](https://github.com/libgit2/libgit2/pull/5097) +- [Handle URLs with a colon after host but no port](https://github.com/libgit2/libgit2/pull/5108) +- [Merge analysis support for bare repos](https://github.com/libgit2/libgit2/pull/5022) +- [Add memleak check docs](https://github.com/libgit2/libgit2/pull/5104) +- [Data-driven tests](https://github.com/libgit2/libgit2/pull/5098) +- [sha1dc: update to fix endianess issues on AIX/HP-UX](https://github.com/libgit2/libgit2/pull/5107) +- [Add NTLM support for HTTP(s) servers and proxies](https://github.com/libgit2/libgit2/pull/5052) +- [Callback type names should be suffixed with `_cb`](https://github.com/libgit2/libgit2/pull/5102) +- [tests: checkout: fix symlink.git being created outside of sandbox](https://github.com/libgit2/libgit2/pull/5099) +- [ignore: handle escaped trailing whitespace](https://github.com/libgit2/libgit2/pull/5095) +- [Ignore: only treat one leading slash as a root identifier](https://github.com/libgit2/libgit2/pull/5074) +- [online tests: use gitlab for auth failures](https://github.com/libgit2/libgit2/pull/5094) +- [Ignore files: don't ignore whitespace](https://github.com/libgit2/libgit2/pull/5076) +- [cache: fix cache eviction using deallocated key](https://github.com/libgit2/libgit2/pull/5088) +- [SECURITY.md: split out security-relevant bits from readme](https://github.com/libgit2/libgit2/pull/5085) +- [Restore NetBSD support](https://github.com/libgit2/libgit2/pull/5086) +- [repository: fix garbage return value](https://github.com/libgit2/libgit2/pull/5084) +- [cmake: disable fallthrough warnings for PCRE](https://github.com/libgit2/libgit2/pull/5083) +- [Configuration parsing: validate section headers with quotes](https://github.com/libgit2/libgit2/pull/5073) +- [Loosen restriction on wildcard "*" refspecs](https://github.com/libgit2/libgit2/pull/5060) +- [Use PCRE for our fallback regex engine when regcomp_l is unavailable](https://github.com/libgit2/libgit2/pull/4935) +- [Remote URL last-chance resolution](https://github.com/libgit2/libgit2/pull/5062) +- [Skip UTF8 BOM in ignore files](https://github.com/libgit2/libgit2/pull/5075) +- [We've already added `ZLIB_LIBRARIES` to `LIBGIT2_LIBS` so don't also add the `z` library](https://github.com/libgit2/libgit2/pull/5080) +- [Define SYMBOLIC_LINK_FLAG_DIRECTORY if required](https://github.com/libgit2/libgit2/pull/5077) +- [Support symlinks for directories in win32](https://github.com/libgit2/libgit2/pull/5065) +- [rebase: orig_head and onto accessors](https://github.com/libgit2/libgit2/pull/5057) +- [cmake: correctly detect if system provides `regcomp`](https://github.com/libgit2/libgit2/pull/5063) +- [Correctly write to missing locked global config](https://github.com/libgit2/libgit2/pull/5023) +- [[RFC] util: introduce GIT_DOWNCAST macro](https://github.com/libgit2/libgit2/pull/4561) +- [examples: implement SSH authentication](https://github.com/libgit2/libgit2/pull/5051) +- [git_repository_init: stop traversing at windows root](https://github.com/libgit2/libgit2/pull/5050) +- [config_file: check result of git_array_alloc](https://github.com/libgit2/libgit2/pull/5053) +- [patch_parse.c: Handle CRLF in parse_header_start](https://github.com/libgit2/libgit2/pull/5027) +- [fix typo](https://github.com/libgit2/libgit2/pull/5045) +- [sha1: don't inline `git_hash_global_init` for win32](https://github.com/libgit2/libgit2/pull/5039) +- [ignore: treat paths with trailing "/" as directories](https://github.com/libgit2/libgit2/pull/5040) +- [Test that largefiles can be read through the tree API](https://github.com/libgit2/libgit2/pull/4874) +- [Tests for symlinked user config](https://github.com/libgit2/libgit2/pull/5034) +- [patch_parse: fix parsing addition/deletion of file with space](https://github.com/libgit2/libgit2/pull/5035) +- [Optimize string comparisons](https://github.com/libgit2/libgit2/pull/5018) +- [Negation of subdir ignore causes other subdirs to be unignored](https://github.com/libgit2/libgit2/pull/5020) +- [xdiff: fix typo](https://github.com/libgit2/libgit2/pull/5024) +- [docs: clarify relation of safe and forced checkout strategy](https://github.com/libgit2/libgit2/pull/5032) +- [Each hash implementation should define `git_hash_global_init`](https://github.com/libgit2/libgit2/pull/5026) +- [[Doc] Update URL to git2-rs](https://github.com/libgit2/libgit2/pull/5012) +- [remote: Rename git_remote_completion_type to _t](https://github.com/libgit2/libgit2/pull/5008) +- [odb: provide a free function for custom backends](https://github.com/libgit2/libgit2/pull/5005) +- [Have git_branch_lookup accept GIT_BRANCH_ALL](https://github.com/libgit2/libgit2/pull/5000) +- [Rename git_transfer_progress to git_indexer_progress](https://github.com/libgit2/libgit2/pull/4997) +- [High-level map APIs](https://github.com/libgit2/libgit2/pull/4901) +- [refdb_fs: fix loose/packed refs lookup racing with repacks](https://github.com/libgit2/libgit2/pull/4984) +- [Allocator restructuring](https://github.com/libgit2/libgit2/pull/4998) +- [cache: fix misnaming of `git_cache_free`](https://github.com/libgit2/libgit2/pull/4992) +- [examples: produce single cgit2 binary](https://github.com/libgit2/libgit2/pull/4956) +- [Remove public 'inttypes.h' header](https://github.com/libgit2/libgit2/pull/4991) +- [Prevent reading out of bounds memory](https://github.com/libgit2/libgit2/pull/4996) +- [Fix a memory leak in odb_otype_fast()](https://github.com/libgit2/libgit2/pull/4987) +- [Make stdalloc__reallocarray call stdalloc__realloc](https://github.com/libgit2/libgit2/pull/4986) +- [Remove `git_time_monotonic`](https://github.com/libgit2/libgit2/pull/4990) +- [Fix a _very_ improbable memory leak in git_odb_new()](https://github.com/libgit2/libgit2/pull/4988) +- [ci: publish documentation on merge](https://github.com/libgit2/libgit2/pull/4989) +- [Enable creation of worktree from bare repo's default branch](https://github.com/libgit2/libgit2/pull/4982) +- [Allow bypassing check for '.keep' file](https://github.com/libgit2/libgit2/pull/4965) +- [Deprecation: export the deprecated functions properly](https://github.com/libgit2/libgit2/pull/4979) +- [ci: skip ssh tests on macOS nightly](https://github.com/libgit2/libgit2/pull/4980) +- [CI build fixups](https://github.com/libgit2/libgit2/pull/4976) +- [v0.28 rc1](https://github.com/libgit2/libgit2/pull/4970) +- [Docs](https://github.com/libgit2/libgit2/pull/4968) +- [Documentation fixes](https://github.com/libgit2/libgit2/pull/4954) +- [ci: add an individual coverity pipeline](https://github.com/libgit2/libgit2/pull/4964) +- [ci: run docurium to create documentation](https://github.com/libgit2/libgit2/pull/4961) +- [ci: return coverity to the nightlies](https://github.com/libgit2/libgit2/pull/4962) +- [Clean up some warnings](https://github.com/libgit2/libgit2/pull/4950) +- [Nightlies: use `latest` docker images](https://github.com/libgit2/libgit2/pull/4869) +- [index: preserve extension parsing errors](https://github.com/libgit2/libgit2/pull/4858) +- [Deprecate functions and constants more gently](https://github.com/libgit2/libgit2/pull/4952) +- [Don't use deprecated constants](https://github.com/libgit2/libgit2/pull/4957) +- [Fix VS warning C4098: 'giterr_set_str' : void function returning a value](https://github.com/libgit2/libgit2/pull/4955) +- [Move `giterr` to `git_error`](https://github.com/libgit2/libgit2/pull/4917) +- [odb: Fix odb foreach to also close on positive error code](https://github.com/libgit2/libgit2/pull/4949) +- [repository: free memory in symlink detection function](https://github.com/libgit2/libgit2/pull/4948) +- [ci: update poxyproxy, run in quiet mode](https://github.com/libgit2/libgit2/pull/4947) +- [Add/multiply with overflow tweaks](https://github.com/libgit2/libgit2/pull/4945) +- [Improve deprecation of old enums](https://github.com/libgit2/libgit2/pull/4944) +- [Move `git_ref_t` to `git_reference_t`](https://github.com/libgit2/libgit2/pull/4939) +- [More `git_obj` to `git_object` updates](https://github.com/libgit2/libgit2/pull/4940) +- [ci: only run invasive tests in nightly](https://github.com/libgit2/libgit2/pull/4943) +- [Always build a cdecl library](https://github.com/libgit2/libgit2/pull/4930) +- [changelog: document changes since 0.27](https://github.com/libgit2/libgit2/pull/4932) +- [Fix a bunch of warnings](https://github.com/libgit2/libgit2/pull/4925) +- [mailmap: prefer ethomson@edwardthomson.com](https://github.com/libgit2/libgit2/pull/4941) +- [Convert tests/resources/push.sh to LF endings](https://github.com/libgit2/libgit2/pull/4937) +- [Get rid of some test files that were accidentally committed](https://github.com/libgit2/libgit2/pull/4936) +- [Fix crash on remote connection when GIT_PROXY_AUTO is set but no proxy is detected](https://github.com/libgit2/libgit2/pull/4934) +- [Make ENABLE_WERROR actually work](https://github.com/libgit2/libgit2/pull/4924) +- [Remove unconditional -Wno-deprecated-declaration on macOS](https://github.com/libgit2/libgit2/pull/4931) +- [Fix warning 'function': incompatible types - from 'git_cvar_value *' to 'int *' (C4133) on VS](https://github.com/libgit2/libgit2/pull/4926) +- [Fix Linux warnings](https://github.com/libgit2/libgit2/pull/4928) +- [Coverity fixes](https://github.com/libgit2/libgit2/pull/4922) +- [Shutdown callback count](https://github.com/libgit2/libgit2/pull/4919) +- [Update CRLF filtering to match modern git](https://github.com/libgit2/libgit2/pull/4904) +- [refdb_fs: refactor error handling in `refdb_reflog_fs__delete`](https://github.com/libgit2/libgit2/pull/4915) +- [Remove empty (sub-)directories when deleting refs](https://github.com/libgit2/libgit2/pull/4833) +- [Support creating annotated commits from annotated tags](https://github.com/libgit2/libgit2/pull/4910) +- [Fix segfault in loose_backend__readstream](https://github.com/libgit2/libgit2/pull/4906) +- [make proxy_stream_close close target stream even on errors](https://github.com/libgit2/libgit2/pull/4905) +- [Index API updates for consistency](https://github.com/libgit2/libgit2/pull/4807) +- [Allow merge analysis against any reference](https://github.com/libgit2/libgit2/pull/4770) +- [revwalk: Allow changing hide_cb](https://github.com/libgit2/libgit2/pull/4888) +- [Unused function warnings](https://github.com/libgit2/libgit2/pull/4895) +- [Add builtin proxy support for the http transport](https://github.com/libgit2/libgit2/pull/4870) +- [config: fix adding files if their parent directory is a file](https://github.com/libgit2/libgit2/pull/4898) +- [Allow certificate and credential callbacks to decline to act](https://github.com/libgit2/libgit2/pull/4879) +- [Fix warning C4133 incompatible types in MSVC](https://github.com/libgit2/libgit2/pull/4896) +- [index: introduce git_index_iterator](https://github.com/libgit2/libgit2/pull/4884) +- [commit: fix out-of-bound reads when parsing truncated author fields](https://github.com/libgit2/libgit2/pull/4894) +- [tests: 🌀 address two null argument instances #4847](https://github.com/libgit2/libgit2/pull/4847) +- [Some OpenSSL issues](https://github.com/libgit2/libgit2/pull/4875) +- [worktree: Expose git_worktree_add_init_options](https://github.com/libgit2/libgit2/pull/4892) +- [transport/http: Include non-default ports in Host header](https://github.com/libgit2/libgit2/pull/4882) +- [Support symlinks on Windows when core.symlinks=true](https://github.com/libgit2/libgit2/pull/4713) +- [strntol: fix out-of-bounds reads when parsing numbers with leading sign](https://github.com/libgit2/libgit2/pull/4886) +- [apply: small fixups in the test suite](https://github.com/libgit2/libgit2/pull/4885) +- [signature: fix out-of-bounds read when parsing timezone offset](https://github.com/libgit2/libgit2/pull/4883) +- [Remote creation API](https://github.com/libgit2/libgit2/pull/4667) +- [Index collision fixes](https://github.com/libgit2/libgit2/pull/4818) +- [Patch (diff) application](https://github.com/libgit2/libgit2/pull/4705) +- [smart transport: only clear url on hard reset (regression)](https://github.com/libgit2/libgit2/pull/4880) +- [Tree parsing fixes](https://github.com/libgit2/libgit2/pull/4871) +- [CI: Fix macOS leak detection](https://github.com/libgit2/libgit2/pull/4860) +- [README: more CI status badges](https://github.com/libgit2/libgit2/pull/4800) +- [ci: Fix some minor issues](https://github.com/libgit2/libgit2/pull/4867) +- [Object parse fixes](https://github.com/libgit2/libgit2/pull/4864) +- [Windows CI: fail build on test failure](https://github.com/libgit2/libgit2/pull/4862) +- [ci: run all the jobs during nightly builds](https://github.com/libgit2/libgit2/pull/4863) +- [strtol removal](https://github.com/libgit2/libgit2/pull/4851) +- [ buf::oom tests: use custom allocator for oom failures](https://github.com/libgit2/libgit2/pull/4854) +- [ci: arm docker builds](https://github.com/libgit2/libgit2/pull/4804) +- [Win32 path canonicalization refactoring](https://github.com/libgit2/libgit2/pull/4852) +- [Check object existence when creating a tree from an index](https://github.com/libgit2/libgit2/pull/4840) +- [Ninja build](https://github.com/libgit2/libgit2/pull/4841) +- [docs: fix transparent/opaque confusion in the conventions file](https://github.com/libgit2/libgit2/pull/4853) +- [Configuration variables can appear on the same line as the section header](https://github.com/libgit2/libgit2/pull/4819) +- [path: export the dotgit-checking functions](https://github.com/libgit2/libgit2/pull/4849) +- [cmake: correct comment from libssh to libssh2](https://github.com/libgit2/libgit2/pull/4850) +- [Object parsing fuzzer](https://github.com/libgit2/libgit2/pull/4845) +- [config: Port config_file_fuzzer to the new in-memory backend.](https://github.com/libgit2/libgit2/pull/4842) +- [Add some more tests for git_futils_rmdir_r and some cleanup](https://github.com/libgit2/libgit2/pull/4828) +- [diff_stats: use git's formatting of renames with common directories](https://github.com/libgit2/libgit2/pull/4830) +- [ignore unsupported http authentication contexts](https://github.com/libgit2/libgit2/pull/4839) +- [submodule: ignore path and url attributes if they look like options](https://github.com/libgit2/libgit2/pull/4837) +- [Smart packet security fixes](https://github.com/libgit2/libgit2/pull/4836) +- [config_file: properly ignore includes without "path" value](https://github.com/libgit2/libgit2/pull/4832) +- [int-conversion](https://github.com/libgit2/libgit2/pull/4831) +- [cmake: enable new quoted argument policy CMP0054](https://github.com/libgit2/libgit2/pull/4829) +- [fix check if blob is uninteresting when inserting tree to packbuilder](https://github.com/libgit2/libgit2/pull/4824) +- [Documentation fixups](https://github.com/libgit2/libgit2/pull/4827) +- [CI: refactoring](https://github.com/libgit2/libgit2/pull/4812) +- [In-memory configuration](https://github.com/libgit2/libgit2/pull/4767) +- [Some warnings](https://github.com/libgit2/libgit2/pull/4784) +- [index: release the snapshot instead of freeing the index](https://github.com/libgit2/libgit2/pull/4803) +- [online::clone: free url and username before resetting](https://github.com/libgit2/libgit2/pull/4816) +- [git_remote_prune to be O(n * logn)](https://github.com/libgit2/libgit2/pull/4794) +- [Rename "VSTS" to "Azure DevOps" and "Azure Pipelines"](https://github.com/libgit2/libgit2/pull/4813) +- [cmake: enable -Wformat and -Wformat-security](https://github.com/libgit2/libgit2/pull/4810) +- [Fix revwalk limiting regression](https://github.com/libgit2/libgit2/pull/4809) +- [path validation: `char` is not signed by default.](https://github.com/libgit2/libgit2/pull/4805) +- [revwalk: refer the sorting modes more to git's options](https://github.com/libgit2/libgit2/pull/4811) +- [Clar XML output redux](https://github.com/libgit2/libgit2/pull/4778) +- [remote: store the connection data in a private struct](https://github.com/libgit2/libgit2/pull/4785) +- [docs: clarify and include licenses of dependencies](https://github.com/libgit2/libgit2/pull/4789) +- [config_file: fix quadratic behaviour when adding config multivars](https://github.com/libgit2/libgit2/pull/4799) +- [config: Fix a leak parsing multi-line config entries](https://github.com/libgit2/libgit2/pull/4792) +- [Prevent heap-buffer-overflow](https://github.com/libgit2/libgit2/pull/4797) +- [ci: remove travis](https://github.com/libgit2/libgit2/pull/4790) +- [Update VSTS YAML files with the latest syntax](https://github.com/libgit2/libgit2/pull/4791) +- [Documentation fixes](https://github.com/libgit2/libgit2/pull/4788) +- [config: convert unbounded recursion into a loop](https://github.com/libgit2/libgit2/pull/4781) +- [Document giterr_last() use only after error. #4772](https://github.com/libgit2/libgit2/pull/4773) +- [util: make the qsort_r check work on macOS](https://github.com/libgit2/libgit2/pull/4765) +- [fuzzer: update for indexer changes](https://github.com/libgit2/libgit2/pull/4782) +- [tree: accept null ids in existing trees when updating](https://github.com/libgit2/libgit2/pull/4727) +- [Pack file verification](https://github.com/libgit2/libgit2/pull/4374) +- [cmake: detect and use libc-provided iconv](https://github.com/libgit2/libgit2/pull/4777) +- [Coverity flavored clang analyzer fixes](https://github.com/libgit2/libgit2/pull/4774) +- [tests: verify adding index conflicts with invalid filemodes fails](https://github.com/libgit2/libgit2/pull/4776) +- [worktree: unlock should return 1 when the worktree isn't locked](https://github.com/libgit2/libgit2/pull/4769) +- [Add a fuzzer for config files](https://github.com/libgit2/libgit2/pull/4752) +- [Fix 'invalid packet line' for ng packets containing errors](https://github.com/libgit2/libgit2/pull/4763) +- [Fix leak in index.c](https://github.com/libgit2/libgit2/pull/4768) +- [threads::diff: use separate git_repository objects](https://github.com/libgit2/libgit2/pull/4754) +- [travis: remove Coverity cron job](https://github.com/libgit2/libgit2/pull/4766) +- [parse: Do not initialize the content in context to NULL](https://github.com/libgit2/libgit2/pull/4749) +- [config_file: Don't crash on options without a section](https://github.com/libgit2/libgit2/pull/4750) +- [ci: Correct the status code check so Coverity doesn't force-fail Travis](https://github.com/libgit2/libgit2/pull/4764) +- [ci: remove appveyor](https://github.com/libgit2/libgit2/pull/4760) +- [diff: fix OOM on AIX when finding similar deltas in empty diff](https://github.com/libgit2/libgit2/pull/4761) +- [travis: do not execute Coverity analysis for all cron jobs](https://github.com/libgit2/libgit2/pull/4755) +- [ci: enable compilation with "-Werror"](https://github.com/libgit2/libgit2/pull/4759) +- [smart_pkt: fix potential OOB-read when processing ng packet](https://github.com/libgit2/libgit2/pull/4758) +- [Fix a double-free in config parsing](https://github.com/libgit2/libgit2/pull/4751) +- [Fuzzers](https://github.com/libgit2/libgit2/pull/4728) +- [ci: run VSTS builds on master and maint branches](https://github.com/libgit2/libgit2/pull/4746) +- [Windows: default credentials / fallback credential handling](https://github.com/libgit2/libgit2/pull/4743) +- [ci: add VSTS build badge to README](https://github.com/libgit2/libgit2/pull/4745) +- [ci: set PKG_CONFIG_PATH for travis](https://github.com/libgit2/libgit2/pull/4744) +- [CI: Refactor and introduce VSTS builds](https://github.com/libgit2/libgit2/pull/4723) +- [revwalk: remove tautologic condition for hiding a commit](https://github.com/libgit2/libgit2/pull/4742) +- [winhttp: retry erroneously failing requests](https://github.com/libgit2/libgit2/pull/4731) +- [Add a configurable limit to the max pack size that will be indexed](https://github.com/libgit2/libgit2/pull/4721) +- [mbedtls: remove unused variable "cacert"](https://github.com/libgit2/libgit2/pull/4739) +- [Squash some leaks](https://github.com/libgit2/libgit2/pull/4732) +- [Add a checkout example](https://github.com/libgit2/libgit2/pull/4692) +- [Assorted Coverity fixes](https://github.com/libgit2/libgit2/pull/4702) +- [Remove GIT_PKT_PACK entirely](https://github.com/libgit2/libgit2/pull/4704) +- [ ignore: improve `git_ignore_path_is_ignored` description Git analogy](https://github.com/libgit2/libgit2/pull/4722) +- [alloc: don't overwrite allocator during init if set](https://github.com/libgit2/libgit2/pull/4724) +- [C90 standard compliance](https://github.com/libgit2/libgit2/pull/4700) +- [Delta OOB access](https://github.com/libgit2/libgit2/pull/4719) +- [Release v0.27.3](https://github.com/libgit2/libgit2/pull/4717) +- [streams: report OpenSSL errors if global init fails](https://github.com/libgit2/libgit2/pull/4710) +- [patch_parse: populate line numbers while parsing diffs](https://github.com/libgit2/libgit2/pull/4687) +- [Fix git_worktree_validate failing on bare repositories](https://github.com/libgit2/libgit2/pull/4686) +- [git_refspec_transform: Handle NULL dst](https://github.com/libgit2/libgit2/pull/4699) +- [Add a "dirty" state to the index when it has unsaved changes](https://github.com/libgit2/libgit2/pull/4536) +- [refspec: rename `git_refspec__free` to `git_refspec__dispose`](https://github.com/libgit2/libgit2/pull/4709) +- [streams: openssl: Handle error in SSL_CTX_new](https://github.com/libgit2/libgit2/pull/4701) +- [refspec: add public parsing api](https://github.com/libgit2/libgit2/pull/4519) +- [Fix interaction between limited flag and sorting over resets](https://github.com/libgit2/libgit2/pull/4688) +- [deps: fix implicit fallthrough warning in http-parser](https://github.com/libgit2/libgit2/pull/4691) +- [Fix assorted leaks found via fuzzing](https://github.com/libgit2/libgit2/pull/4698) +- [Fix type confusion in git_smart__connect](https://github.com/libgit2/libgit2/pull/4695) +- [Verify ref_pkt's are long enough](https://github.com/libgit2/libgit2/pull/4696) +- [Config parser cleanups](https://github.com/libgit2/libgit2/pull/4411) +- [Fix last references to deprecated git_buf_free](https://github.com/libgit2/libgit2/pull/4685) +- [revwalk: avoid walking the entire history when output is unsorted](https://github.com/libgit2/libgit2/pull/4606) +- [Add mailmap support.](https://github.com/libgit2/libgit2/pull/4586) +- [tree: remove unused functions](https://github.com/libgit2/libgit2/pull/4683) +- [Link `mbedTLS` libraries in when `SHA1_BACKEND` == "mbedTLS"](https://github.com/libgit2/libgit2/pull/4678) +- [editorconfig: allow trailing whitespace in markdown](https://github.com/libgit2/libgit2/pull/4676) +- [docs: fix statement about tab width](https://github.com/libgit2/libgit2/pull/4681) +- [diff: fix enum value being out of allowed range](https://github.com/libgit2/libgit2/pull/4680) +- [pack: rename `git_packfile_stream_free`](https://github.com/libgit2/libgit2/pull/4436) +- [Stop leaking the memory](https://github.com/libgit2/libgit2/pull/4677) +- [Bugfix release v0.27.2](https://github.com/libgit2/libgit2/pull/4632) +- [Fix stash save bug with fast path index check](https://github.com/libgit2/libgit2/pull/4668) +- [path: unify `git_path_is_*` APIs](https://github.com/libgit2/libgit2/pull/4662) +- [Fix negative gitignore rules with leading directories ](https://github.com/libgit2/libgit2/pull/4670) +- [Custom memory allocators](https://github.com/libgit2/libgit2/pull/4576) +- [index: Fix alignment issues in write_disk_entry()](https://github.com/libgit2/libgit2/pull/4655) +- [travis: war on leaks](https://github.com/libgit2/libgit2/pull/4558) +- [refdb_fs: fix regression: failure when globbing for non-existant references](https://github.com/libgit2/libgit2/pull/4665) +- [tests: submodule: do not rely on config iteration order](https://github.com/libgit2/libgit2/pull/4673) +- [Detect duplicated submodules for the same path](https://github.com/libgit2/libgit2/pull/4641) +- [Fix docurium missing includes](https://github.com/libgit2/libgit2/pull/4530) +- [github: update issue template](https://github.com/libgit2/libgit2/pull/4627) +- [streams: openssl: add missing check on OPENSSL_LEGACY_API](https://github.com/libgit2/libgit2/pull/4661) +- [mbedtls: don't require mbedtls from our pkgconfig file](https://github.com/libgit2/libgit2/pull/4656) +- [Fixes for CVE 2018-11235](https://github.com/libgit2/libgit2/pull/4660) +- [Backport fixes for CVE 2018-11235](https://github.com/libgit2/libgit2/pull/4659) +- [Added note about Windows junction points to the differences from git document](https://github.com/libgit2/libgit2/pull/4653) +- [cmake: resolve libraries found by pkg-config ](https://github.com/libgit2/libgit2/pull/4642) +- [refdb_fs: enhance performance of globbing](https://github.com/libgit2/libgit2/pull/4629) +- [global: adjust init count under lock](https://github.com/libgit2/libgit2/pull/4645) +- [Fix GCC 8.1 warnings](https://github.com/libgit2/libgit2/pull/4646) +- [Worktrees can be made from bare repositories](https://github.com/libgit2/libgit2/pull/4630) +- [docs: add documentation to state differences from the git cli](https://github.com/libgit2/libgit2/pull/4605) +- [Sanitize the hunk header to ensure it contains UTF-8 valid data](https://github.com/libgit2/libgit2/pull/4542) +- [examples: ls-files: add ls-files to list paths in the index](https://github.com/libgit2/libgit2/pull/4380) +- [OpenSSL legacy API cleanups](https://github.com/libgit2/libgit2/pull/4608) +- [worktree: add functions to get name and path](https://github.com/libgit2/libgit2/pull/4640) +- [Fix deletion of unrelated branch on worktree](https://github.com/libgit2/libgit2/pull/4633) +- [mbedTLS support](https://github.com/libgit2/libgit2/pull/4173) +- [Configuration entry iteration in order](https://github.com/libgit2/libgit2/pull/4525) +- [blame_git: fix coalescing step never being executed](https://github.com/libgit2/libgit2/pull/4580) +- [Fix leaks in master](https://github.com/libgit2/libgit2/pull/4636) +- [Leak fixes for v0.27.1](https://github.com/libgit2/libgit2/pull/4635) +- [worktree: Read worktree specific reflog for HEAD](https://github.com/libgit2/libgit2/pull/4577) +- [fixed stack smashing due to wrong size of struct stat on the stack](https://github.com/libgit2/libgit2/pull/4631) +- [scripts: add backporting script](https://github.com/libgit2/libgit2/pull/4476) +- [worktree: add ability to create worktree with pre-existing branch](https://github.com/libgit2/libgit2/pull/4524) +- [refs: preserve the owning refdb when duping reference](https://github.com/libgit2/libgit2/pull/4618) +- [Submodules-API should report .gitmodules parse errors instead of ignoring them](https://github.com/libgit2/libgit2/pull/4522) +- [Typedef git_pkt_type and clarify recv_pkt return type](https://github.com/libgit2/libgit2/pull/4514) +- [online::clone: validate user:pass in HTTP_PROXY](https://github.com/libgit2/libgit2/pull/4556) +- [ transports: ssh: disconnect session before freeing it ](https://github.com/libgit2/libgit2/pull/4596) +- [revwalk: fix uninteresting revs sometimes not limiting graphwalk](https://github.com/libgit2/libgit2/pull/4622) +- [attr_file: fix handling of directory patterns with trailing spaces](https://github.com/libgit2/libgit2/pull/4614) +- [transports: local: fix assert when fetching into repo with symrefs](https://github.com/libgit2/libgit2/pull/4613) +- [remote/proxy: fix git_transport_certificate_check_db description](https://github.com/libgit2/libgit2/pull/4597) +- [Flag options in describe.h as being optional](https://github.com/libgit2/libgit2/pull/4587) +- [diff: Add missing GIT_DELTA_TYPECHANGE -> 'T' mapping.](https://github.com/libgit2/libgit2/pull/4611) +- [appveyor: fix typo in registry key to disable DHE](https://github.com/libgit2/libgit2/pull/4609) +- [Fix build with LibreSSL 2.7](https://github.com/libgit2/libgit2/pull/4607) +- [appveyor: workaround for intermittent test failures](https://github.com/libgit2/libgit2/pull/4603) +- [sha1dc: update to fix errors with endianess](https://github.com/libgit2/libgit2/pull/4601) +- [submodule: check index for path and prefix before adding submodule](https://github.com/libgit2/libgit2/pull/4378) +- [odb: mempack: fix leaking objects when freeing mempacks](https://github.com/libgit2/libgit2/pull/4602) +- [types: remove unused git_merge_result](https://github.com/libgit2/libgit2/pull/4598) +- [checkout: change default strategy to SAFE](https://github.com/libgit2/libgit2/pull/4531) +- [Add myself to git.git-authors](https://github.com/libgit2/libgit2/pull/4570) + + +## v0.25.0-alpha.16 [(2019-07-23)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.16) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.15...v0.25.0-alpha.16) + +#### Summary of changes +- Adds support for Node 12 +- Updates lodash dependency to address security notice +- Expose Tree.prototype.createUpdated(repo, numUpdates, updates) +- Bumps libgit2 + - Fixes gitignore issue with pattern negation + - Remote.list now gets the correct list of remotes if remotes are changed by external process + +#### Merged PRs into NodeGit +- [Bump libgit2 #1705](https://github.com/nodegit/nodegit/pull/1705) +- [Fix Tree#createUpdated #1704](https://github.com/nodegit/nodegit/pull/1704) +- [Fix failing tests on CI #1703](https://github.com/nodegit/nodegit/pull/1703) +- [Audit lodash and fix package-lock.json #1702](https://github.com/nodegit/nodegit/pull/1702) +- [Implement support for Node 12 #1696](https://github.com/nodegit/nodegit/pull/1696) + +#### Merged PRs into LibGit2 +- [config_file: refresh when creating an iterator #5181](https://github.com/libgit2/libgit2/pull/5181) +- [azure: drop powershell #5141](https://github.com/libgit2/libgit2/pull/5141) +- [fuzzer: use futils instead of fileops #5180](https://github.com/libgit2/libgit2/pull/5180) +- [w32: fix unlinking of directory symlinks #5151](https://github.com/libgit2/libgit2/pull/5151) +- [patch_parse: fix segfault due to line containing static contents #5179](https://github.com/libgit2/libgit2/pull/5179) +- [ignore: fix determining whether a shorter pattern negates another #5173](https://github.com/libgit2/libgit2/pull/5173) +- [patch_parse: handle missing newline indicator in old file #5159](https://github.com/libgit2/libgit2/pull/5159) +- [patch_parse: do not depend on parsed buffer's lifetime #5158](https://github.com/libgit2/libgit2/pull/5158) +- [sha1: fix compilation of WinHTTP backend #5174](https://github.com/libgit2/libgit2/pull/5174) +- [repository: do not initialize HEAD if it's provided by templates #5176](https://github.com/libgit2/libgit2/pull/5176) +- [configuration: cvar -> configmap #5138](https://github.com/libgit2/libgit2/pull/5138) +- [Evict cache items more efficiently #5172](https://github.com/libgit2/libgit2/pull/5172) +- [clar: fix suite count #5175](https://github.com/libgit2/libgit2/pull/5175) +- [Ignore VS2017 specific files and folders #5163](https://github.com/libgit2/libgit2/pull/5163) +- [gitattributes: ignore macros defined in subdirectories #5156](https://github.com/libgit2/libgit2/pull/5156) +- [clar: correctly account for "data" suites when counting #5168](https://github.com/libgit2/libgit2/pull/5168) +- [Allocate memory more efficiently when packing objects #5170](https://github.com/libgit2/libgit2/pull/5170) +- [fileops: fix creation of directory in filesystem root #5131](https://github.com/libgit2/libgit2/pull/5131) +- [win32: fix fuzzers and have CI build them #5160](https://github.com/libgit2/libgit2/pull/5160) +- [Config parser separation #5134](https://github.com/libgit2/libgit2/pull/5134) +- [config_file: implement stat cache to avoid repeated rehashing #5132](https://github.com/libgit2/libgit2/pull/5132) +- [ci: build with ENABLE_WERROR on Windows #5143](https://github.com/libgit2/libgit2/pull/5143) +- [Fix Regression: attr: Correctly load system attr file (on Windows) #5152](https://github.com/libgit2/libgit2/pull/5152) +- [hash: fix missing error return on production builds #5145](https://github.com/libgit2/libgit2/pull/5145) +- [Resolve static check warnings in example code #5142](https://github.com/libgit2/libgit2/pull/5142) +- [Multiple hash algorithms #4438](https://github.com/libgit2/libgit2/pull/4438) +- [More documentation #5128](https://github.com/libgit2/libgit2/pull/5128) +- [Incomplete commondir support #4967](https://github.com/libgit2/libgit2/pull/4967) +- [Remove warnings #5078](https://github.com/libgit2/libgit2/pull/5078) +- [Re-run flaky tests #5140](https://github.com/libgit2/libgit2/pull/5140) + + +## v0.25.0-alpha.15 [(2019-07-15)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.15) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.14...v0.25.0-alpha.15) + +#### Summary of changes +- Removed NSEC optimization due to performance regressions in repositories that did not use NSEC optimization cloned via NodeGit. + +#### Merged PRs into NodeGit +- [Remove NSEC #1699](https://github.com/nodegit/nodegit/pull/1699) + + +## v0.25.0-alpha.14 [(2019-07-01)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.14) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.13...v0.25.0-alpha.14) + +#### Summary of changes +- Always use builtin regex for linux for portability + +#### Merged PRs into NodeGit +- [Use builtin regex library for linux for better portability #1693](https://github.com/nodegit/nodegit/pull/1693) +- [Remove pcre-config from binding.gyp #1694](https://github.com/nodegit/nodegit/pull/1694) + +## v0.25.0-alpha.13 [(2019-06-26)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.13) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.12...v0.25.0-alpha.13) + +#### Summary of changes +- Turn on GIT_USE_NSEC on all platforms +- Use Iconv on OSX for better internationalization support. +- Bump libgit2 to bring in: + - NTLM proxy support + - Negotiate/Kerberos proxy support + - Various git config fixes + - Various git ignore fixes + - Various libgit2 performance improvements + - Windows/Linux now use PCRE for regex, OSX uses regcomp_l, this should address collation issues in diffing +- Fixed bug with Repository.prototype.refreshReferences dying on corrupted reference. We now ignore corrupted references + +#### Merged PRs into NodeGit +- [refresh_references.cc: skip refs that can't be directly resolved #1689](https://github.com/nodegit/nodegit/pull/1689) +- [Bump libgit2 to fork of latest master #1690](https://github.com/nodegit/nodegit/pull/1690) + +#### Merged PRs into LibGit2 +- [errors: use lowercase](https://github.com/libgit2/libgit2/pull/5137) +- [largefile tests: only write 2GB on 32-bit platforms](https://github.com/libgit2/libgit2/pull/5136) +- [Fix broken link in README](https://github.com/libgit2/libgit2/pull/5129) +- [net: remove unused `git_headlist_cb`](https://github.com/libgit2/libgit2/pull/5122) +- [cmake: default NTLM client to off if no HTTPS support](https://github.com/libgit2/libgit2/pull/5124) +- [attr: rename constants and macros for consistency](https://github.com/libgit2/libgit2/pull/5119) +- [Change API instances of `fromnoun` to `from_noun` (with an underscore)](https://github.com/libgit2/libgit2/pull/5117) +- [object: rename git_object__size to git_object_size](https://github.com/libgit2/libgit2/pull/5118) +- [Replace fnmatch with wildmatch](https://github.com/libgit2/libgit2/pull/5110) +- [Documentation fixes](https://github.com/libgit2/libgit2/pull/5111) +- [Removal of `p_fallocate`](https://github.com/libgit2/libgit2/pull/5114) +- [Modularize our TLS & hash detection](https://github.com/libgit2/libgit2/pull/5055) +- [tests: merge::analysis: use test variants to avoid duplicated test suites](https://github.com/libgit2/libgit2/pull/5109) +- [Rename options initialization functions](https://github.com/libgit2/libgit2/pull/5101) +- [deps: ntlmclient: disable implicit fallthrough warnings](https://github.com/libgit2/libgit2/pull/5112) +- [gitignore with escapes](https://github.com/libgit2/libgit2/pull/5097) +- [Handle URLs with a colon after host but no port](https://github.com/libgit2/libgit2/pull/5108) +- [Merge analysis support for bare repos](https://github.com/libgit2/libgit2/pull/5022) +- [Add memleak check docs](https://github.com/libgit2/libgit2/pull/5104) +- [Data-driven tests](https://github.com/libgit2/libgit2/pull/5098) +- [sha1dc: update to fix endianess issues on AIX/HP-UX](https://github.com/libgit2/libgit2/pull/5107) +- [Add NTLM support for HTTP(s) servers and proxies](https://github.com/libgit2/libgit2/pull/5052) +- [Callback type names should be suffixed with `_cb`](https://github.com/libgit2/libgit2/pull/5102) +- [tests: checkout: fix symlink.git being created outside of sandbox](https://github.com/libgit2/libgit2/pull/5099) +- [ignore: handle escaped trailing whitespace](https://github.com/libgit2/libgit2/pull/5095) +- [Ignore: only treat one leading slash as a root identifier](https://github.com/libgit2/libgit2/pull/5074) +- [online tests: use gitlab for auth failures](https://github.com/libgit2/libgit2/pull/5094) +- [Ignore files: don't ignore whitespace](https://github.com/libgit2/libgit2/pull/5076) +- [cache: fix cache eviction using deallocated key](https://github.com/libgit2/libgit2/pull/5088) +- [SECURITY.md: split out security-relevant bits from readme](https://github.com/libgit2/libgit2/pull/5085) +- [Restore NetBSD support](https://github.com/libgit2/libgit2/pull/5086) +- [repository: fix garbage return value](https://github.com/libgit2/libgit2/pull/5084) +- [cmake: disable fallthrough warnings for PCRE](https://github.com/libgit2/libgit2/pull/5083) +- [Configuration parsing: validate section headers with quotes](https://github.com/libgit2/libgit2/pull/5073) +- [Loosen restriction on wildcard "*" refspecs](https://github.com/libgit2/libgit2/pull/5060) +- [Use PCRE for our fallback regex engine when regcomp_l is unavailable](https://github.com/libgit2/libgit2/pull/4935) +- [Remote URL last-chance resolution](https://github.com/libgit2/libgit2/pull/5062) +- [Skip UTF8 BOM in ignore files](https://github.com/libgit2/libgit2/pull/5075) +- [We've already added `ZLIB_LIBRARIES` to `LIBGIT2_LIBS` so don't also add the `z` library](https://github.com/libgit2/libgit2/pull/5080) +- [Define SYMBOLIC_LINK_FLAG_DIRECTORY if required](https://github.com/libgit2/libgit2/pull/5077) +- [Support symlinks for directories in win32](https://github.com/libgit2/libgit2/pull/5065) +- [rebase: orig_head and onto accessors](https://github.com/libgit2/libgit2/pull/5057) +- [cmake: correctly detect if system provides `regcomp`](https://github.com/libgit2/libgit2/pull/5063) +- [Correctly write to missing locked global config](https://github.com/libgit2/libgit2/pull/5023) +- [[RFC] util: introduce GIT_DOWNCAST macro](https://github.com/libgit2/libgit2/pull/4561) +- [examples: implement SSH authentication](https://github.com/libgit2/libgit2/pull/5051) +- [git_repository_init: stop traversing at windows root](https://github.com/libgit2/libgit2/pull/5050) +- [config_file: check result of git_array_alloc](https://github.com/libgit2/libgit2/pull/5053) +- [patch_parse.c: Handle CRLF in parse_header_start](https://github.com/libgit2/libgit2/pull/5027) +- [fix typo](https://github.com/libgit2/libgit2/pull/5045) +- [sha1: don't inline `git_hash_global_init` for win32](https://github.com/libgit2/libgit2/pull/5039) +- [ignore: treat paths with trailing "/" as directories](https://github.com/libgit2/libgit2/pull/5040) +- [Test that largefiles can be read through the tree API](https://github.com/libgit2/libgit2/pull/4874) +- [Tests for symlinked user config](https://github.com/libgit2/libgit2/pull/5034) +- [patch_parse: fix parsing addition/deletion of file with space](https://github.com/libgit2/libgit2/pull/5035) +- [Optimize string comparisons](https://github.com/libgit2/libgit2/pull/5018) +- [Negation of subdir ignore causes other subdirs to be unignored](https://github.com/libgit2/libgit2/pull/5020) +- [xdiff: fix typo](https://github.com/libgit2/libgit2/pull/5024) +- [docs: clarify relation of safe and forced checkout strategy](https://github.com/libgit2/libgit2/pull/5032) +- [Each hash implementation should define `git_hash_global_init`](https://github.com/libgit2/libgit2/pull/5026) +- [[Doc] Update URL to git2-rs](https://github.com/libgit2/libgit2/pull/5012) +- [remote: Rename git_remote_completion_type to _t](https://github.com/libgit2/libgit2/pull/5008) +- [odb: provide a free function for custom backends](https://github.com/libgit2/libgit2/pull/5005) +- [Have git_branch_lookup accept GIT_BRANCH_ALL](https://github.com/libgit2/libgit2/pull/5000) +- [Rename git_transfer_progress to git_indexer_progress](https://github.com/libgit2/libgit2/pull/4997) +- [High-level map APIs](https://github.com/libgit2/libgit2/pull/4901) +- [refdb_fs: fix loose/packed refs lookup racing with repacks](https://github.com/libgit2/libgit2/pull/4984) +- [Allocator restructuring](https://github.com/libgit2/libgit2/pull/4998) +- [cache: fix misnaming of `git_cache_free`](https://github.com/libgit2/libgit2/pull/4992) +- [examples: produce single cgit2 binary](https://github.com/libgit2/libgit2/pull/4956) +- [Remove public 'inttypes.h' header](https://github.com/libgit2/libgit2/pull/4991) +- [Prevent reading out of bounds memory](https://github.com/libgit2/libgit2/pull/4996) +- [Fix a memory leak in odb_otype_fast()](https://github.com/libgit2/libgit2/pull/4987) +- [Make stdalloc__reallocarray call stdalloc__realloc](https://github.com/libgit2/libgit2/pull/4986) +- [Remove `git_time_monotonic`](https://github.com/libgit2/libgit2/pull/4990) +- [Fix a _very_ improbable memory leak in git_odb_new()](https://github.com/libgit2/libgit2/pull/4988) +- [ci: publish documentation on merge](https://github.com/libgit2/libgit2/pull/4989) +- [Enable creation of worktree from bare repo's default branch](https://github.com/libgit2/libgit2/pull/4982) +- [Allow bypassing check for '.keep' file](https://github.com/libgit2/libgit2/pull/4965) +- [Release v0.28.1](https://github.com/libgit2/libgit2/pull/4983) + + + +## v0.25.0-alpha.12 [(2019-06-03)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.12) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.11...v0.25.0-alpha.12) + +#### Summary of changes +- Fix bug in Repository.prototype.refreshReferences where new remote references from a new remote added/fetched on a separte repo instance do not show up in the result. +- Fixed a prototype problem with cherrypick, merge, and other collections that have a function at their root. call, apply, and bind should now be on NodeGit.Cherrypick. +- Bumped libssh2 to resolve security notice. + +#### Merged PRs into NodeGit +- [Bump libssh2 to 1.8.2 and fix some npm audit warnings #1678](https://github.com/nodegit/nodegit/pull/1678) +- [Root functions should keep their function prototypes correctly #1681](https://github.com/nodegit/nodegit/pull/1681) +- [refresh_references.cc: bust LibGit2 remote list cache by reading config #1685](https://github.com/nodegit/nodegit/pull/1685) + + +## v0.25.0-alpha.11 [(2019-05-20)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.11) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.10...v0.25.0-alpha.11) + +#### Summary of changes +- Improve speed and correctness of fileHistoryWalk. The API should not have changed; however, when the end of the walk has been reached, `reachedEndOfHistory` will be specified on the resulting array. + +#### Merged PRs into NodeGit +- [Implement faster file history walk #1676](https://github.com/nodegit/nodegit/pull/1676) + + +## v0.25.0-alpha.10 [(2019-05-03)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.10) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.9...v0.25.0-alpha.10) + +#### Summary of changes +- Drops support for Ubuntu 14 after EOL +- Fixes openssl prebuilt downloads for electron builds +- Fixes commits retrieved from Commit.prototype.parent +- *DEPRECATION* Support signing commits in Repository.prototype.mergeBranches. The last parameter `processMergeMessageCallback` is now deprecated, but will continue to work. Use the options object instead, which will contain the `processMergeMessageCallback`, as well as the `signingCb`. +- Bump Node-Gyp to 4.0.0 to fix tar security vulnerability +- *BREAKING* `getRemotes` no longer returns remote names, it now returns remote objects directly. Use `getRemoteNames` to get a list of remote names. +- Optimized a set of routines in NodeGit. These methods as written in Javascript require hundreds or thousands of requests to async workers to retrieve data. We've batched these requests and performed them on a single async worker. There are now native implementations of the following: + - Repository.prototype.getReferences: Retrieves all references on async worker. + - Repository.prototype.getRemotes: Retrieves all remotes on async worker. + - Repository.prototype.getSubmodules: Retrieves all submodules on async worker. + - Repository.prototype.refreshReferences: Open sourced function from GitKraken. Grabs a lot of information about references on an async worker. + - Revwalk.prototype.commitWalk: Retrieves up to N commits from a revwalk on an async worker. + +#### Merged PRs into NodeGit +- [EOL for Node 6 and Ubuntu 14.04 #1649](https://github.com/nodegit/nodegit/pull/1649) +- [Ensures that commits from parent(*) has a repository #1658](https://github.com/nodegit/nodegit/pull/1658) +- [Update openssl conan distributions #1663](https://github.com/nodegit/nodegit/pull/1663) +- [Support signing in Repository#mergeBranches #1664](https://github.com/nodegit/nodegit/pull/1664) +- [Dependency upgrade node-gyp upgraded to 4.0.0 #1672](https://github.com/nodegit/nodegit/pull/1672) +- [Add additional getters to streamline information gathering (breaking change) #1671](https://github.com/nodegit/nodegit/pull/1671) + + + +## v0.25.0-alpha.9 [(2019-03-04)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.9) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.8...v0.25.0-alpha.9) + +#### Summary of changes +- Removed access to the diff_so_far param in git_diff_notify_cb and git_diff_progress_cb +- Changed FilterSource.prototype.repo to async to prevent segfaults on filters that run during Submodule.status +- Clean up deprecation messages to inform users of what was deprecated, not just what users should switch to +- When installing on a machine that has yarn and does not have npm, the preinstall script should succeed now +- ceiling_dirs is now an optional parameter to Repository.discover + +#### Merged PRs into NodeGit +- [Clean up some dangerous memory accesses in callbacks #1642](https://github.com/nodegit/nodegit/pull/1642) +- [Output the item that was deprecated when giving deprecation notice #1643](https://github.com/nodegit/nodegit/pull/1643) +- [Don't fail yarn installs when we can't find npm #1644](https://github.com/nodegit/nodegit/pull/1644) +- [`ceiling_dirs` parameter in `Repository.discover` is optional #1245](https://github.com/nodegit/nodegit/pull/1245) + + +## v0.25.0-alpha.8 [(2019-02-27)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.8) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.7...v0.25.0-alpha.8) + +#### Summary of changes +- Fixed segfault in NodeGit.Merge.analysis and NodeGit.Merge.analysisForRef + +#### Merged PRs into NodeGit +- [Add missing `shouldAlloc` declarations for git_merge_analysis* functions #1641](https://github.com/nodegit/nodegit/pull/1641) + + +## v0.25.0-alpha.7 [(2019-02-20)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.7) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.6...v0.25.0-alpha.7) + +#### Summary of changes +- Fixed bug where repeated uses of extractSignature would fail because of the use of regex.prototype.match +- Added support for building on IBM i (PASE) machines +- Fixed bug where signingCb in rebases would not return error codes to LibGit2 if the signingCb threw or rejected +- Exposed AnnotatedCommit methods: + - AnnotatedCommit.prototype.ref +- Exposed Apply methods: + - Apply.apply applies a diff to the repository + - Apply.toTree applies a diff to a tree +- Exposed Config methods: + - Config.prototype.deleteEntry + - Config.prototype.deleteMultivar + - Config.prototype.getBool + - Config.prototype.getInt32 + - Config.prototype.getInt64 + - Config.prototype.setMultivar + - Config.prototype.snapshot +- Exposed ConfigIterator with methods: + - ConfigIterator.create + - ConfigIterator.createGlob + - ConfigIterator.createMultivar + - ConfigIterator.prototype.next +- Exposed Merge methods: + - Merge.analysis + - Merge.analysisForRef +- Expose Remote methods: + - Remote.createWithOpts + +#### Merged PRs into NodeGit +- [Fix regex state causing subsequent runs of Tag.extractSignature to fail #1630](https://github.com/nodegit/nodegit/pull/1630) +- [Update LibGit2 docs to v0.28.0 #1631](https://github.com/nodegit/nodegit/pull/1631) +- [Add support for building on IBM i (PASE) #1634](https://github.com/nodegit/nodegit/pull/1634) +- [Expose more config methods #1635](https://github.com/nodegit/nodegit/pull/1635) +- [Catch errors and pass them to libgit2 as error codes in rebase signingcb #1636](https://github.com/nodegit/nodegit/pull/1636) +- [Simplify check for IBM i operating system #1637](https://github.com/nodegit/nodegit/pull/1637) +- [Bump LibGit2 to fork of v0.28.1 #1638](https://github.com/nodegit/nodegit/pull/1638) + + +## v0.25.0-alpha.6 [(2019-02-14)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.6) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.5...v0.25.0-alpha.6) + +#### Summary of changes +- Bumped LibGit2 to v0.28.0. +- Fixed problem with continue rebase preventing users from skipping commits +- Fixed leak where struct/option types were leaking libgit2 pointers + +#### Merged PRs into NodeGit +- [We should clear the persistent cell in structs when they are destroyed #1629](https://github.com/nodegit/nodegit/pull/1629) +- [Fix "errorno" typo #1628](https://github.com/nodegit/nodegit/pull/1628) +- [Bump Libgit2 fork to v0.28.0 #1627](https://github.com/nodegit/nodegit/pull/1627) + + +## v0.25.0-alpha.5 [(2019-02-11)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.5) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.4...v0.25.0-alpha.5) + +#### Summary of changes +- Fixed builds for Electron 4 for real this time + +#### Merged PRs into NodeGit +- [Fix macOS and Windows Electron 4 builds #1626](https://github.com/nodegit/nodegit/pull/1626) + + +## v0.25.0-alpha.4 [(2019-02-08)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.4) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.3...v0.25.0-alpha.4) + +#### Summary of changes +- Fixed bug where signing the init commit failed due to being unable to update the `HEAD` ref. +- Changed `NodeGit.Signature.default` to async, because it actually ends up reading the config. +- Fixed bug where templates were not reporting errors for synchronous methods. It's a bit of a wide net, but in general, + it is now possible certain sync methods in NodeGit will begin failin that did not fail before. This is the correct + behavior. +- Switched `NodeGit.Oid.fromString`'s internal implementation from `git_oid_fromstr` to `git_oid_fromstrp` +- Fixed builds for Electron 4 +- Added `NodeGit.Reference.updateTerminal` + +#### Merged PRs into NodeGit +- [Fix non-existent / dangling refs cause Repository.prototype.createCommitWithSignature to fail #1624](https://github.com/nodegit/nodegit/pull/1624) +- [Handle new gyp information for electron builds #1623](https://github.com/nodegit/nodegit/pull/1623) + + +## v0.25.0-alpha.3 [(2019-02-05)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.3) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.2...v0.25.0-alpha.3) + +#### Summary of changes +- Enforced consistent use of signing callbacks within the application. Any object that implements the signingCallback + pattern for signing commits or tags should use the exact same callback type and with the same meaning. + `type SigningCallback = (content: string) => {| code: number, field?: string, signedData?: string |};` + If the code is `NodeGit.Error.CODE.OK` or 0, the operation will succeed and _at least_ signedData is expected to be filled out. + If the code is a negative number, except for `NodeGit.Error.CODE.PASSTHROUGH`, the signing operation will fail. + If the code is `NodeGit.Error.CODE.PASSTHROUGH`, the operation will continue without signing the object. + +#### Merged PRs into NodeGit +- [Use same API for signingCb in all places that can be crypto signed #1621](https://github.com/nodegit/nodegit/pull/1621) + + +## v0.25.0-alpha.2 [(2019-02-01)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.1...v0.25.0-alpha.2) + +#### Summary of changes +- Added RebaseOptions to repository.prototype.rebaseContinue + +#### Merged PRs into NodeGit +- [Breaking: Repository.prototype.continueRebase enhancements #1619](https://github.com/nodegit/nodegit/pull/1619) + + +## v0.25.0-alpha.1 [(2019-01-30)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.24.0...v0.25.0-alpha.1) + +#### Summary of changes +- Bump Libgit2 to preview of v0.28.0 +- Add signing support for commits and annotated tags +- Updated Signature.prototype.toString to optionally include timestamps +- [BREAKING] Converted Buf.prototype.set and Buf.prototype.grow from async to sync +- Added complete support for libgit2 types: + - git_index_name_entry + - git_index_reuc_entry + - git_mailmap +- Exposed git_path_is_gitfile +- Exposed git_tag_create_frombuffer + +#### Merged PRs into NodeGit +- [adds support for gpg commit signing (fixes #1018) #1448](https://github.com/nodegit/nodegit/pull/1448) +- [Add `updateRef` parameter to Repository#createCommitWithSignature #1610](https://github.com/nodegit/nodegit/pull/1610) +- [Documentation fixes. #1611](https://github.com/nodegit/nodegit/pull/1611) +- [Add Commit#amendWithSignature #1616](https://github.com/nodegit/nodegit/pull/1616) +- [Bump libgit2 to a preview of v0.28 #1615](https://github.com/nodegit/nodegit/pull/1615) +- [Fix issues with Commit#amendWithSignature #1617](https://github.com/nodegit/nodegit/pull/1617) +- [Marked Repository.createBlobFromBuffer as async #1614](https://github.com/nodegit/nodegit/pull/1614) +- [Add functionality for creating Tags with signatures and extracting signatures from Tags #1618](https://github.com/nodegit/nodegit/pull/1618) + + ## v0.24.0 [(2019-01-16)](https://github.com/nodegit/nodegit/releases/tag/v0.24.0) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.23.0...v0.24.0) diff --git a/README.md b/README.md index ddd922d4c..c547e32e7 100644 --- a/README.md +++ b/README.md @@ -76,10 +76,17 @@ In Ubuntu: sudo apt-get install libssl-dev ``` -Additionally, you need `curl-config` on your system. You need one of these packages: - * libcurl4-gnutls-dev - * libcurl4-nss-dev - * libcurl4-openssl-dev +You will need the following libraries installed on your linux machine: + - libpcre + - libpcreposix + - libkrb5 + - libk5crypto + - libcom_err + +When building locally, you will also need development packages for kerberos and pcre, so both of these utilities must be present on your machine: + - pcre-config + - krb5-config + If you are still encountering problems while installing, you should try the [Building from source](http://www.nodegit.org/guides/install/from-source/) diff --git a/appveyor.yml b/appveyor.yml index 34f73e23d..891225fd7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,9 +26,9 @@ environment: GYP_MSVS_VERSION: 2015 matrix: # Node.js + - nodejs_version: "12" - nodejs_version: "10" - nodejs_version: "8" - - nodejs_version: "6" matrix: fast_finish: true @@ -58,5 +58,6 @@ build: off branches: only: + - /backport\/.*/ - master - v0.3 diff --git a/examples/clone.js b/examples/clone.js index 2b9937949..459713d94 100644 --- a/examples/clone.js +++ b/examples/clone.js @@ -14,7 +14,7 @@ fse.remove(path).then(function() { certificateCheck: function() { // github will fail cert check on some OSX machines // this overrides that check - return 1; + return 0; } } } diff --git a/examples/cloneFromGithubWith2Factor.js b/examples/cloneFromGithubWith2Factor.js index 35b08432e..62e0df807 100644 --- a/examples/cloneFromGithubWith2Factor.js +++ b/examples/cloneFromGithubWith2Factor.js @@ -20,7 +20,7 @@ var opts = { return nodegit.Cred.userpassPlaintextNew(token, "x-oauth-basic"); }, certificateCheck: function() { - return 1; + return 0; } } } diff --git a/examples/pull.js b/examples/pull.js index 7f5fc9af0..fe2d83411 100644 --- a/examples/pull.js +++ b/examples/pull.js @@ -16,7 +16,7 @@ nodegit.Repository.open(path.resolve(__dirname, repoDir)) return nodegit.Cred.sshKeyFromAgent(userName); }, certificateCheck: function() { - return 1; + return 0; } } }); diff --git a/generate/input/callbacks.json b/generate/input/callbacks.json index a94faa030..0d8720b79 100644 --- a/generate/input/callbacks.json +++ b/generate/input/callbacks.json @@ -1,13 +1,27 @@ { - "git_attr_foreach_cb": { + "git_apply_delta_cb": { "args": [ { - "name": "name", - "cType": "const char *" + "name": "delta", + "cType": "const git_diff_delta *" }, { - "name": "value", - "cType": "const char *" + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 1, + "success": 0, + "error": -1 + } + }, + "git_apply_hunk_cb": { + "args": [ + { + "name": "hunk", + "cType": "const git_diff_hunk *" }, { "name": "payload", @@ -21,11 +35,15 @@ "error": -1 } }, - "git_blob_chunk_cb": { + "git_attr_foreach_cb": { "args": [ { - "name": "entry", - "cType": "const git_config_entry *" + "name": "name", + "cType": "const char *" + }, + { + "name": "value", + "cType": "const char *" }, { "name": "payload", @@ -118,6 +136,32 @@ "error": -1 } }, + "git_commit_signing_cb": { + "args": [ + { + "name": "signature", + "cType": "git_buf *" + }, + { + "name": "signature_field", + "cType": "git_buf *" + }, + { + "name": "commit_content", + "cType": "const char *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": -30, + "success": 0, + "error": -1 + } + }, "git_config_foreach_cb": { "args": [ { @@ -264,7 +308,8 @@ "args": [ { "name": "diff_so_far", - "cType": "const git_diff *" + "cType": "const git_diff *", + "ignore": true }, { "name": "delta_to_add", @@ -285,11 +330,13 @@ "success": 0, "error": -1 } - },"git_diff_progress_cb": { + }, + "git_diff_progress_cb": { "args": [ { "name": "diff_so_far", - "cType": "const git_diff *" + "cType": "const git_diff *", + "ignore": true }, { "name": "old_path", @@ -311,101 +358,101 @@ "error": -1 } }, - "git_filter_apply_fn": { - "args": [ - { - "name": "self", - "cType": "git_filter *" - }, - { - "name": "payload", - "cType": "void **" - }, - { - "name": "to", - "cType": "git_buf *" - }, - { - "name": "from", - "cType": "const git_buf *" - }, - { - "name": "src", - "cType": "const git_filter_source *" - } - ], - "return": { - "type": "int", - "noResults": -30, - "success": 0, - "error": -1 - } - }, - "git_filter_check_fn": { - "args": [ - { - "name": "self", - "cType": "git_filter *" - }, - { + "git_filter_apply_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + }, + { "name": "payload", "cType": "void **" - }, - { + }, + { + "name": "to", + "cType": "git_buf *" + }, + { + "name": "from", + "cType": "const git_buf *" + }, + { "name": "src", "cType": "const git_filter_source *" - }, - { - "name": "attr_values", - "cType": "const char **" - } - ], - "return": { - "type": "int", - "noResults": -30, - "success": 0, - "error": -1 - } - }, - "git_filter_cleanup_fn": { - "args": [ - { - "name": "self", - "cType": "git_filter *" - }, - { - "name": "payload", - "cType": "void *" - } - ], - "return": { - "type": "void" - } - }, - "git_filter_init_fn": { - "args": [ - { - "name": "self", - "cType": "git_filter *" - } - ], - "return": { - "type": "int", + } + ], + "return": { + "type": "int", + "noResults": -30, + "success": 0, + "error": -1 + } + }, + "git_filter_check_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + }, + { + "name": "payload", + "cType": "void **" + }, + { + "name": "src", + "cType": "const git_filter_source *" + }, + { + "name": "attr_values", + "cType": "const char **" + } + ], + "return": { + "type": "int", + "noResults": -30, + "success": 0, + "error": -1 + } + }, + "git_filter_cleanup_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "void" + } + }, + "git_filter_init_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + } + ], + "return": { + "type": "int", "noResults": 0, - "success": 0, - "error": -1 - } - }, - "git_filter_shutdown_fn": { - "args": [ - { - "name": "self", - "cType": "git_filter *" - } - ], - "return": { - "type": "void" - } + "success": 0, + "error": -1 + } + }, + "git_filter_shutdown_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + } + ], + "return": { + "type": "void" + } }, "git_index_matched_path_cb": { "args": [ @@ -429,6 +476,25 @@ "error": -1 } }, + "git_indexer_progress_cb": { + "args": [ + { + "name": "stats", + "cType": "const git_indexer_progress *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 0, + "success": 0, + "error": -1, + "throttle": 100 + } + }, "git_note_foreach_cb": { "args": [ { @@ -485,11 +551,33 @@ "error": -1 } }, + "git_push_update_reference_cb": { + "args": [ + { + "name": "refname", + "cType": "const char *" + }, + { + "name": "status", + "cType": "const char *" + }, + { + "name": "data", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 1, + "success": 0, + "error": -1 + } + }, "git_remote_create_cb": { "args": [ { "name": "out", - "cType": "git_repository **", + "cType": "git_remote **", "isReturn": true }, { @@ -645,29 +733,6 @@ "error": -1 } }, - "git_smart_subtransport_cb": { - "args": [ - { - "name": "out", - "cType": "git_smart_subtransport **", - "isReturn": true - }, - { - "name": "owner", - "cType": "git_transport*" - }, - { - "name": "param", - "cType": "void *" - } - ], - "return": { - "type": "int", - "noResults": 0, - "success": 0, - "error": -1 - } - }, "git_stash_apply_progress_cb": { "args": [ { @@ -779,26 +844,7 @@ "error": -1 } }, - "git_transfer_progress_cb": { - "args": [ - { - "name": "stats", - "cType": "const git_transfer_progress *" - }, - { - "name": "payload", - "cType": "void *" - } - ], - "return": { - "type": "int", - "noResults": 0, - "success": 0, - "error": -1, - "throttle": 100 - } - }, - "git_push_transfer_progress": { + "git_push_transfer_progress_cb": { "args": [ { "name": "current", @@ -936,24 +982,28 @@ "error": -1 } }, - "git_push_update_reference_cb": { + "git_url_resolve_cb": { "args": [ { - "name": "refname", - "cType": "const char *" + "name": "url_resolved", + "cType": "git_buf *" }, { - "name": "status", + "name": "url", "cType": "const char *" }, { - "name": "data", + "name": "direction", + "cType": "int" + }, + { + "name": "payload", "cType": "void *" } ], "return": { "type": "int", - "noResults": 1, + "noResults": -30, "success": 0, "error": -1 } diff --git a/generate/input/descriptor.json b/generate/input/descriptor.json index 096d4df9b..b61702214 100644 --- a/generate/input/descriptor.json +++ b/generate/input/descriptor.json @@ -48,7 +48,7 @@ "repository_init_flag": { "removeString": "INIT_" }, - "otype": { + "object": { "JsName": "TYPE", "owner": "Object", "removeString": "OBJ_" @@ -57,7 +57,7 @@ "JsName": "PROXY", "isMask": false }, - "ref": { + "reference": { "owner": "Reference", "JsName": "TYPE" }, @@ -71,10 +71,16 @@ "status": { "JsName": "STATUS", "isMask": false + }, + "stream": { + "ignore": true } }, "types": { + "allocator": { + "ignore": true + }, "annotated_commit": { "selfFreeing": true, "functions": { @@ -108,6 +114,9 @@ } } }, + "apply_options": { + "hasConstructor": true + }, "attr": { "functions": { "git_attr_foreach": { @@ -174,6 +183,9 @@ }, "git_blame_init_options": { "ignore": true + }, + "git_blame_options_init": { + "ignore": true } } }, @@ -191,7 +203,7 @@ "singletonCppClassName": "GitRepository" }, "functions": { - "git_blob_create_frombuffer": { + "git_blob_create_from_buffer": { "isAsync": true, "args": { "id": { @@ -206,7 +218,7 @@ "isErrorCode": true } }, - "git_blob_create_fromworkdir": { + "git_blob_create_from_workdir": { "isAsync": true, "args": { "id": { @@ -217,7 +229,10 @@ "isErrorCode": true } }, - "git_blob_create_fromdisk": { + "git_blob_create_fromworkdir": { + "ignore": true + }, + "git_blob_create_from_disk": { "isAsync": true, "args": { "id": { @@ -228,10 +243,10 @@ "isErrorCode": true } }, - "git_blob_create_fromstream": { + "git_blob_create_from_stream": { "ignore": true }, - "git_blob_create_fromstream_commit": { + "git_blob_create_from_stream_commit": { "ignore": true }, "git_blob_filtered_content": { @@ -378,6 +393,7 @@ ] }, "buf": { + "freeFunctionName": "git_buf_dispose", "functions": { "git_buf_free": { "ignore": true @@ -397,7 +413,7 @@ "jsClassName": "Number", "isErrorCode": true }, - "isAsync": true + "isAsync": false }, "git_buf_set": { "cppFunctionName": "Set", @@ -418,7 +434,7 @@ "jsClassName": "Number", "isErrorCode": true }, - "isAsync": true + "isAsync": false } }, "dependencies": [ @@ -476,6 +492,9 @@ "git_checkout_init_options": { "ignore": true }, + "git_checkout_options_init": { + "ignore": true + }, "git_checkout_tree": { "args": { "treeish": { @@ -502,6 +521,9 @@ }, "git_cherrypick_init_options": { "ignore": true + }, + "git_cherrypick_options_init": { + "ignore": true } } }, @@ -516,6 +538,9 @@ }, "git_clone_init_options": { "ignore": true + }, + "git_clone_options_init": { + "ignore": true } } }, @@ -685,10 +710,14 @@ "ignore": true }, "git_config_delete_entry": { - "ignore": true + "return": { + "isErrorCode": true + } }, "git_config_delete_multivar": { - "ignore": true + "return": { + "isErrorCode": true + } }, "git_config_entry_free": { "ignore": true @@ -752,7 +781,14 @@ "ignore": true }, "git_config_get_bool": { - "ignore": true + "args": { + "out": { + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_get_entry": { "args": { @@ -763,10 +799,26 @@ } }, "git_config_get_int32": { - "ignore": true + "args": { + "out": { + "cType": "int32_t *", + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_get_int64": { - "ignore": true + "args": { + "out": { + "cType": "int64_t *", + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_get_mapped": { "ignore": true @@ -804,15 +856,6 @@ "git_config_init_backend": { "ignore": true }, - "git_config_iterator_free": { - "ignore": true - }, - "git_config_iterator_glob_new": { - "ignore": true - }, - "git_config_iterator_new": { - "ignore": true - }, "git_config_lock": { "isAsync": true, "args": { @@ -820,20 +863,17 @@ "isReturn": true, "ownedByThis": true } + }, + "return": { + "isErrorCode": true } }, "git_config_lookup_map_value": { "ignore": true }, - "git_config_multivar_iterator_new": { - "ignore": true - }, "git_config_new": { "ignore": true }, - "git_config_next": { - "ignore": true - }, "git_config_open_default": { "isAsync": true, "return": { @@ -887,6 +927,12 @@ "isErrorCode": true } }, + "git_config_set_multivar": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, "git_config_set_string": { "isAsync": true, "return": { @@ -894,7 +940,14 @@ } }, "git_config_snapshot": { - "ignore": true + "args": { + "out": { + "ownedByThis": true + } + }, + "return": { + "isErrorCode": true + } } }, "dependencies": [ @@ -908,11 +961,79 @@ "selfFreeing": true }, "config_iterator": { - "ignore": true + "selfFreeing": true, + "fields": { + "backend": { + "ignore": true + }, + "flags": { + "ignore": true + }, + "free": { + "ignore": true + }, + "next": { + "ignore": true + } + }, + "functions": { + "git_config_iterator_free": { + "ignore": true + }, + "git_config_iterator_new": { + "args": { + "out": { + "ownedBy": ["cfg"] + } + }, + "return": { + "isErrorCode": true + } + }, + "git_config_iterator_glob_new": { + "jsFunctionName": "createGlob", + "args": { + "out": { + "ownedBy": ["cfg"] + } + }, + "return": { + "isErrorCode": true + } + }, + "git_config_multivar_iterator_new": { + "jsFunctionName": "createMultivar", + "args": { + "out": { + "ownedBy": ["cfg"] + } + }, + "return": { + "isErrorCode": true + } + }, + "git_config_next": { + "jsFunctionName": "next", + "args": { + "entry": { + "ownedByThis": true + } + }, + "return": { + "isErrorCode": true + } + } + } }, "cred": { + "needsForwardDeclaration": false, "selfFreeing": true, "cType": "git_cred", + "fields": { + "free": { + "ignore": true + } + }, "functions": { "git_cred_default_new": { "isAsync": false @@ -1023,6 +1144,9 @@ "git_diff_find_init_options": { "ignore": true }, + "git_diff_find_options_init": { + "ignore": true + }, "git_diff_find_similar": { "args": { "diff": { @@ -1048,6 +1172,9 @@ "git_diff_format_email_init_options": { "ignore": true }, + "git_diff_format_email_options_init": { + "ignore": true + }, "git_diff_free": { "ignore": true }, @@ -1121,9 +1248,15 @@ "git_diff_num_deltas_of_type": { "ignore": true }, + "git_diff_options_init": { + "ignore": true + }, "git_diff_patchid_init_options": { "ignore": true }, + "git_diff_patchid_options_init": { + "ignore": true + }, "git_diff_print": { "ignore": true }, @@ -1278,9 +1411,17 @@ "functions": { "git_fetch_init_options": { "ignore": true + }, + "git_fetch_options_init": { + "ignore": true } } }, + "fetch_options": { + "dependencies": [ + "../include/str_array_converter.h" + ] + }, "filter": { "selfFreeing": false, "hasConstructor": true, @@ -1398,9 +1539,13 @@ } }, "dependencies": [ + "../include/git_buf_converter.h", "../include/filter_registry.h" ] }, + "giterr": { + "ignore": true + }, "graph": { "functions": { "git_graph_ahead_behind": { @@ -1429,7 +1574,20 @@ }, "hashsig": { "selfFreeing": true, + "freeFunctionName": "git_hashsig_free", "functions": { + "git_hashsig_create": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_hashsig_create_fromfile": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, "git_hashsig_free": { "ignore": true } @@ -1454,6 +1612,12 @@ } } }, + "imaxdiv": { + "ignore": true + }, + "imaxdiv_t": { + "ignore": true + }, "index": { "selfFreeing": true, "ownerFn": { @@ -1493,6 +1657,9 @@ "git_index_add_frombuffer": { "ignore": true }, + "git_index_add_from_buffer": { + "ignore": true + }, "git_index_checksum": { "return": { "ownedByThis": true @@ -1667,12 +1834,6 @@ "isErrorCode": true } }, - "git_index_reuc_get_byindex": { - "ignore": true - }, - "git_index_reuc_get_bypath": { - "ignore": true - }, "git_index_update_all": { "args": { "pathspec": { @@ -1707,23 +1868,244 @@ "isErrorCode": true } }, - "git_index_write_tree_to": { - "isAsync": true, + "git_index_write_tree_to": { + "isAsync": true, + "return": { + "isErrorCode": true + } + } + }, + "dependencies": [ + "../include/str_array_converter.h" + ] + }, + "index_conflict_iterator": { + "selfFreeing": true, + "freeFunctionName": "git_index_conflict_iterator_free", + "functions": { + "git_index_conflict_iterator_free": { + "ignore": true + }, + "git_index_conflict_iterator_new": { + "args": { + "iterator_out": { + "ownedBy": ["index"] + } + } + }, + "git_index_conflict_next": { + "isAsync": false, + "jsFunctionName": "next", + "cppFunctionName": "Next", + "args": { + "ancestor_out": { + "isReturn": true, + "ownedByThis": true + }, + "our_out": { + "isReturn": true, + "ownedByThis": true + }, + "their_out": { + "isReturn": true, + "ownedByThis": true + } + } + } + } + }, + "index_entry": { + "hasConstructor": true, + "ignoreInit": true + }, + "index_iterator": { + "selfFreeing": true, + "freeFunctionName": "git_index_iterator_free", + "functions": { + "git_index_iterator_free": { + "ignore": true + }, + "git_index_iterator_new": { + "args": { + "iterator_out": { + "ownedBy": ["index"] + } + } + }, + "git_index_iterator_next": { + "isAsync": false, + "args": { + "out": { + "ownedByThis": true + } + } + } + } + }, + "index_name_entry": { + "functions": { + "git_index_name_add": { + "cppFunctionName": "Add", + "jsFunctionName": "add", + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_name_clear": { + "cppFunctionName": "Clear", + "jsFunctionName": "clear", + "isAsync": true + }, + "git_index_name_entrycount": { + "cppFunctionName": "Entrycount", + "jsFunctionName": "entryCount" + }, + "git_index_name_get_byindex": { + "cppFunctionName": "GetByIndex", + "jsFunctionName": "getByIndex", + "isPrototypeMethod": false + } + }, + "cDependencies": [ + "git2/sys/index.h" + ] + }, + "index_reuc_entry": { + "fields": { + "mode": { + "cType": "uint32_t [3]" + } + }, + "functions": { + "git_index_reuc_add": { + "cppFunctionName": "Add", + "jsFunctionName": "add", + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_reuc_clear": { + "cppFunctionName": "Clear", + "jsFunctionName": "clear", + "isAsync": true, + "isPrototypeMethod": false + }, + "git_index_reuc_entrycount": { + "cppFunctionName": "Entrycount", + "jsFunctionName": "entryCount" + }, + "git_index_reuc_find": { + "args": { + "at_pos": { + "isReturn": true, + "shouldAlloc": true + } + }, + "cppFunctionName": "Find", + "jsFunctionName": "find", + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_reuc_get_byindex": { + "cppFunctionName": "GetByIndex", + "jsFunctionName": "getByIndex", + "isPrototypeMethod": false + }, + "git_index_reuc_get_bypath": { + "cppFunctionName": "GetByPath", + "jsFunctionName": "getByPath", + "isPrototypeMethod": false + }, + "git_index_reuc_remove": { + "cppFunctionName": "Remove", + "jsFunctionName": "remove", + "isAsync": true, + "isPrototypeMethod": false, + "return": { + "isErrorCode": true + } + } + }, + "cDependencies": [ + "git2/sys/index.h" + ] + }, + "indexer": { + "ignore": true + }, + "indexer_options": { + "ignore": true + }, + "LIBSSH2_SESSION": { + "ignore": true + }, + "LIBSSH2_USERAUTH_KBDINT_PROMPT": { + "ignore": true + }, + "LIBSSH2_USERAUTH_KBDINT_RESPONSE": { + "ignore": true + }, + "_LIBSSH2_SESSION": { + "ignore": true + }, + "_LIBSSH2_USERAUTH_KBDINT_PROMPT": { + "ignore": true + }, + "_LIBSSH2_USERAUTH_KBDINT_RESPONSE": { + "ignore": true + }, + "mailmap": { + "selfFreeing": true, + "freeFunctionName": "git_mailmap_free", + "functions": { + "git_mailmap_add_entry": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_mailmap_free": { + "ignore": true + }, + "git_mailmap_from_buffer": { + "return": { + "isErrorCode": true + } + }, + "git_mailmap_from_repository": { + "args": { + "out": { + "ownedBy": ["repo"] + } + }, + "return": { + "isErrorCode": true + } + }, + "git_mailmap_resolve": { + "args": { + "real_name": { + "isReturn": true + }, + "real_email": { + "isReturn": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_mailmap_resolve_signature": { "return": { "isErrorCode": true } } - }, - "dependencies": [ - "../include/str_array_converter.h" - ] - }, - "index_entry": { - "hasConstructor": true, - "ignoreInit": true - }, - "indexer": { - "ignore": true + } }, "mempack": { "ignore": true @@ -1763,7 +2145,55 @@ } }, "git_merge_analysis": { - "ignore": true + "isAsync": true, + "args": { + "analysis_out": { + "isReturn": true, + "shouldAlloc": true + }, + "preference_out": { + "isReturn": true, + "shouldAlloc": true + }, + "their_heads": { + "cType": "const git_annotated_commit **", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitAnnotatedCommit" + }, + "their_heads_len": { + "cType": "size_t", + "cppClassName": "Number", + "jsClassName": "Number" + } + } + }, + "git_merge_analysis_for_ref": { + "isAsync": true, + "args": { + "analysis_out": { + "isReturn": true, + "shouldAlloc": true + }, + "preference_out": { + "isReturn": true, + "shouldAlloc": true + }, + "their_heads": { + "cType": "const git_annotated_commit **", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitAnnotatedCommit" + }, + "their_heads_len": { + "cType": "size_t", + "cppClassName": "Number", + "jsClassName": "Number" + } + }, + "return": { + "isErrorCode": true + } }, "git_merge_base_many": { "ignore": true @@ -1787,12 +2217,24 @@ "git_merge_file_from_index": { "ignore": true }, + "git_merge_file_input_init": { + "ignore": true + }, + "git_merge_file_init_input": { + "ignore": true + }, "git_merge_file_init_options": { "ignore": true }, + "git_merge_file_options_init": { + "ignore": true + }, "git_merge_init_options": { "ignore": true }, + "git_merge_options_init": { + "ignore": true + }, "git_merge_trees": { "args": { "ancestor_tree": { @@ -1931,16 +2373,10 @@ "ignore": true }, "git_odb_add_disk_alternate": { - "ignore": true - }, - "git_odb_backend_loose": { - "ignore": true - }, - "git_odb_backend_one_pack": { - "ignore": true - }, - "git_odb_backend_pack": { - "ignore": true + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_odb_exists": { "ignore": true, @@ -2107,13 +2543,14 @@ "ignore": true }, "git_oid_fromstr": { - "isAsync": false + "ignore": true }, "git_oid_fromstrn": { "ignore": true }, "git_oid_fromstrp": { - "ignore": true + "isAsync": false, + "jsFunctionName": "fromString" }, "git_oid_nfmt": { "ignore": true @@ -2158,9 +2595,7 @@ } }, "openssl": { - "cDependencies": [ - "git2/sys/openssl.h" - ] + "ignore": true }, "packbuilder": { "selfFreeing": true, @@ -2292,6 +2727,11 @@ } } }, + "path": { + "cDependencies": [ + "git2/sys/path.h" + ] + }, "pathspec": { "selfFreeing": true, "dependencies": [ @@ -2359,13 +2799,22 @@ "functions": { "git_proxy_init_options": { "ignore": true + }, + "git_proxy_options_init": { + "ignore": true } } }, "push": { "ignore": true }, + "push_options": { + "dependencies": [ + "../include/str_array_converter.h" + ] + }, "rebase": { + "hasConstructor": false, "selfFreeing": true, "functions": { "git_rebase_abort": { @@ -2448,11 +2897,15 @@ } }, "git_rebase_next": { + "isAsync": true, "args": { "operation": { "isReturn": true, "ownedByThis": true } + }, + "return": { + "isErrorCode": true } }, "git_rebase_open": { @@ -2472,6 +2925,9 @@ "return": { "ownedByThis": true } + }, + "git_rebase_options_init": { + "ignore": true } } }, @@ -2686,6 +3142,19 @@ } } }, + "git_remote_create_init_options": { + "ignore": true + }, + "git_remote_create_options_init": { + "ignore": true + }, + "git_remote_create_with_opts": { + "args": { + "opts": { + "isOptional": true + } + } + }, "git_remote_connect": { "isAsync": true, "return": { @@ -2779,6 +3248,7 @@ }, "git_remote_get_refspec": { "return": { + "selfFreeing": false, "ownedByThis": true } }, @@ -2857,12 +3327,18 @@ "selfFreeing": true }, "repository": { + "hasConstructor": false, "selfFreeing": true, "isSingleton": true, "dependencies": [ - "git2/sys/repository.h" + "git2/sys/repository.h", + "../include/submodule.h", + "../include/remote.h" ], "functions": { + "git_repository__cleanup": { + "isAsync": true + }, "git_repository_config": { "args": { "out": { @@ -2879,6 +3355,9 @@ "isErrorCode": true }, "args": { + "ceiling_dirs": { + "isOptional": true + }, "out": { "isReturn": true, "isSelf": false, @@ -2899,11 +3378,22 @@ "ignore": true }, "git_repository_ident": { - "ignore": true + "args": { + "name": { + "isReturn": true + }, + "email": { + "isReturn": true + } + }, + "isAsync": false }, "git_repository_init_init_options": { "ignore": true }, + "git_repository_init_options_init": { + "ignore": true + }, "git_repository_mergehead_foreach": { "isAsync": true, "return": { @@ -2971,6 +3461,16 @@ }, "git_repository_set_refdb": { "ignore": true + }, + "git_repository_submodule_cache_all": { + "return": { + "isErrorCode": true + } + }, + "git_repository_submodule_cache_clear": { + "return": { + "isErrorCode": true + } } } }, @@ -2997,6 +3497,9 @@ }, "git_revert_init_options": { "ignore": true + }, + "git_revert_options_init": { + "ignore": true } } }, @@ -3013,6 +3516,7 @@ ], "functions": { "git_reset": { + "isCollectionRoot": true, "args": { "checkout_opts": { "isOptional": true @@ -3083,7 +3587,10 @@ "dupFunction": "git_signature_dup", "functions": { "git_signature_default": { - "isAsync": false + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_signature_dup": { "ignore": true @@ -3095,7 +3602,15 @@ "isAsync": false }, "git_signature_now": { - "isAsync": false + "isAsync": false, + "args": { + "sig_out": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } } } }, @@ -3112,9 +3627,15 @@ } } }, + "smart_subtransport": { + "ignore": true + }, "smart_subtransport_definition": { "ignore": true }, + "smart_subtransport_stream": { + "ignore": true + }, "stash": { "functions": { "git_stash_apply": { @@ -3123,6 +3644,12 @@ "isErrorCode": true } }, + "git_stash_apply_init_options": { + "ignore": true + }, + "git_stash_apply_options_init": { + "ignore": true + }, "git_stash_drop": { "isAsync": true, "return": { @@ -3135,9 +3662,6 @@ "isErrorCode": true } }, - "git_stash_apply_init_options": { - "ignore": true - }, "git_stash_pop": { "isAsync": true, "return": { @@ -3157,6 +3681,9 @@ } } }, + "stdalloc": { + "ignore": true + }, "status": { "cDependencies": [ "git2/sys/diff.h" @@ -3194,6 +3721,9 @@ }, "git_status_init_options": { "ignore": true + }, + "git_status_options_init": { + "ignore": true } } }, @@ -3203,6 +3733,21 @@ "git_status_list_free": { "ignore": true }, + "git_status_list_get_perfdata": { + "isAsync": false, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + }, + "status": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } + }, "git_status_list_new": { "isAsync": true, "args": { @@ -3236,7 +3781,11 @@ "git2/sys/stream.h" ] }, + "stream_registration": { + "ignore": true + }, "submodule": { + "hasConstructor": false, "selfFreeing": true, "ownerFn": { "name": "git_submodule_owner", @@ -3384,6 +3933,9 @@ }, "git_submodule_update_init_options": { "ignore": true + }, + "git_submodule_update_options_init": { + "ignore": true } } }, @@ -3419,8 +3971,16 @@ }, "isAsync": true }, - "git_tag_create_frombuffer": { - "ignore": true + "git_tag_create_from_buffer": { + "args": { + "oid": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + }, + "isAsync": true }, "git_tag_create_lightweight": { "args": { @@ -3518,14 +4078,6 @@ }, "time": { "dupFunction": "git_time_dup", - "dependencies": [ - "git2/sys/time.h" - ], - "fields": { - "sign": { - "ignore": true - } - }, "functions": { "git_time_sign": { "ignore": true @@ -3560,6 +4112,47 @@ "transport": { "cType": "git_transport", "needsForwardDeclaration": false, + "fields": { + "cancel": { + "ignore": true + }, + "close": { + "ignore": true + }, + "connect": { + "ignore": true + }, + "download_pack": { + "ignore": true + }, + "free": { + "ignore": true + }, + "is_connected": { + "ignore": true + }, + "ls": { + "ignore": true + }, + "negotiate_fetch": { + "ignore": true + }, + "push": { + "ignore": true + }, + "read_flags": { + "ignore": true + }, + "set_callbacks": { + "ignore": true + }, + "set_custom_headers": { + "ignore": true + }, + "version": { + "ignore": true + } + }, "functions": { "git_transport_dummy": { "ignore": true @@ -3597,6 +4190,16 @@ "singletonCppClassName": "GitRepository" }, "functions": { + "git_tree_create_updated": { + "args": { + "updates": { + "cType": "git_tree_update *", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitTreeUpdate" + } + } + }, "git_tree_entry_byid": { "return": { "ownedByThis": true @@ -3722,6 +4325,9 @@ } } }, + "win32": { + "ignore": true + }, "worktree": { "selfFreeing": true, "cType": "git_worktree", @@ -3737,6 +4343,9 @@ "git_worktree_add_init_options": { "ignore": true }, + "git_worktree_add_options_init": { + "ignore": true + }, "git_worktree_free": { "ignore": true }, @@ -3756,12 +4365,33 @@ }, "git_worktree_prune_init_options": { "ignore": true + }, + "git_worktree_prune_options_init": { + "ignore": true } - } + }, + "dependencies": [ + "../include/git_buf_converter.h" + ] + }, + "tree_update": { + "hasConstructor": true, + "ignoreInit": true }, "writestream": { "cType": "git_writestream", - "needsForwardDeclaration": false + "needsForwardDeclaration": false, + "fields": { + "close": { + "ignore": true + }, + "free": { + "ignore": true + }, + "write": { + "ignore": true + } + } } } } diff --git a/generate/input/libgit2-docs.json b/generate/input/libgit2-docs.json index 75f9a46af..6f40724ce 100644 --- a/generate/input/libgit2-docs.json +++ b/generate/input/libgit2-docs.json @@ -1,35 +1,48 @@ { "files": [ { - "file": "annotated_commit.h", + "file": "git2/annotated_commit.h", "functions": [ "git_annotated_commit_from_ref", "git_annotated_commit_from_fetchhead", "git_annotated_commit_lookup", "git_annotated_commit_from_revspec", "git_annotated_commit_id", + "git_annotated_commit_ref", "git_annotated_commit_free" ], "meta": {}, - "lines": 112 + "lines": 121 }, { - "file": "attr.h", + "file": "git2/apply.h", + "functions": [ + "git_apply_delta_cb", + "git_apply_hunk_cb", + "git_apply_to_tree", + "git_apply" + ], + "meta": {}, + "lines": 133 + }, + { + "file": "git2/attr.h", "functions": [ "git_attr_value", "git_attr_get", "git_attr_get_many", + "git_attr_foreach_cb", "git_attr_foreach", "git_attr_cache_flush", "git_attr_add_macro" ], "meta": {}, - "lines": 240 + "lines": 251 }, { - "file": "blame.h", + "file": "git2/blame.h", "functions": [ - "git_blame_init_options", + "git_blame_options_init", "git_blame_get_hunk_count", "git_blame_get_hunk_byindex", "git_blame_get_hunk_byline", @@ -38,10 +51,10 @@ "git_blame_free" ], "meta": {}, - "lines": 207 + "lines": 224 }, { - "file": "blob.h", + "file": "git2/blob.h", "functions": [ "git_blob_lookup", "git_blob_lookup_prefix", @@ -51,11 +64,11 @@ "git_blob_rawcontent", "git_blob_rawsize", "git_blob_filtered_content", - "git_blob_create_fromworkdir", - "git_blob_create_fromdisk", - "git_blob_create_fromstream", - "git_blob_create_fromstream_commit", - "git_blob_create_frombuffer", + "git_blob_create_from_workdir", + "git_blob_create_from_disk", + "git_blob_create_from_stream", + "git_blob_create_from_stream_commit", + "git_blob_create_from_buffer", "git_blob_is_binary", "git_blob_dup" ], @@ -63,7 +76,7 @@ "lines": 228 }, { - "file": "branch.h", + "file": "git2/branch.h", "functions": [ "git_branch_create", "git_branch_create_from_annotated", @@ -76,61 +89,64 @@ "git_branch_name", "git_branch_upstream", "git_branch_set_upstream", + "git_branch_upstream_name", "git_branch_is_head", - "git_branch_is_checked_out" + "git_branch_is_checked_out", + "git_branch_remote_name", + "git_branch_upstream_remote" ], "meta": {}, - "lines": 258 + "lines": 288 }, { - "file": "buffer.h", + "file": "git2/buffer.h", "functions": [ - "git_buf_free", + "git_buf_dispose", "git_buf_grow", "git_buf_set", "git_buf_is_binary", "git_buf_contains_nul" ], "meta": {}, - "lines": 122 + "lines": 128 }, { - "file": "checkout.h", + "file": "git2/checkout.h", "functions": [ "git_checkout_notify_cb", "git_checkout_progress_cb", "git_checkout_perfdata_cb", - "git_checkout_init_options", + "git_checkout_options_init", "git_checkout_head", "git_checkout_index", "git_checkout_tree" ], "meta": {}, - "lines": 361 + "lines": 394 }, { - "file": "cherrypick.h", + "file": "git2/cherrypick.h", "functions": [ - "git_cherrypick_init_options", + "git_cherrypick_options_init", "git_cherrypick_commit", "git_cherrypick" ], "meta": {}, - "lines": 84 + "lines": 86 }, { - "file": "clone.h", + "file": "git2/clone.h", "functions": [ "git_remote_create_cb", "git_repository_create_cb", - "git_clone_init_options", + "git_clone_options_init", "git_clone" ], "meta": {}, - "lines": 203 + "lines": 205 }, { - "file": "commit.h", + "file": "git2/commit.h", "functions": [ "git_commit_lookup", "git_commit_lookup_prefix", @@ -146,6 +162,8 @@ "git_commit_time_offset", "git_commit_committer", "git_commit_author", + "git_commit_committer_with_mailmap", + "git_commit_author_with_mailmap", "git_commit_raw_header", "git_commit_tree", "git_commit_tree_id", @@ -163,22 +181,23 @@ "git_commit_dup" ], "meta": {}, - "lines": 474 + "lines": 502 }, { - "file": "common.h", + "file": "git2/common.h", "functions": [ "git_libgit2_version", "git_libgit2_features", "git_libgit2_opts" ], "meta": {}, - "lines": 352 + "lines": 404 }, { - "file": "config.h", + "file": "git2/config.h", "functions": [ "git_config_entry_free", + "git_config_foreach_cb", "git_config_find_global", "git_config_find_xdg", "git_config_find_system", @@ -223,10 +242,10 @@ "git_config_lock" ], "meta": {}, - "lines": 751 + "lines": 762 }, { - "file": "cred_helpers.h", + "file": "git2/cred_helpers.h", "functions": [ "git_cred_userpass" ], @@ -234,27 +253,45 @@ "lines": 48 }, { - "file": "describe.h", + "file": "git2/deprecated.h", "functions": [ + "git_blob_create_fromworkdir", + "git_buf_free", + "giterr_last", + "giterr_clear", + "giterr_set_str", + "giterr_set_oom", + "git_oid_iszero", + "git_headlist_cb", + "git_blame_init_options" + ], + "meta": {}, + "lines": 437 + }, + { + "file": "git2/describe.h", + "functions": [ + "git_describe_options_init", + "git_describe_format_options_init", "git_describe_commit", "git_describe_workdir", "git_describe_format", "git_describe_result_free" ], "meta": {}, - "lines": 161 + "lines": 184 }, { - "file": "diff.h", + "file": "git2/diff.h", "functions": [ "git_diff_notify_cb", "git_diff_progress_cb", - "git_diff_init_options", + "git_diff_options_init", "git_diff_file_cb", "git_diff_binary_cb", "git_diff_hunk_cb", "git_diff_line_cb", - "git_diff_find_init_options", + "git_diff_find_options_init", "git_diff_free", "git_diff_tree_to_tree", "git_diff_tree_to_index", @@ -284,26 +321,26 @@ "git_diff_stats_free", "git_diff_format_email", "git_diff_commit_as_email", - "git_diff_format_email_init_options", - "git_diff_patchid_init_options", + "git_diff_format_email_options_init", + "git_diff_patchid_options_init", "git_diff_patchid" ], "meta": {}, - "lines": 1452 + "lines": 1502 }, { - "file": "errors.h", + "file": "git2/errors.h", "functions": [ - "giterr_last", - "giterr_clear", - "giterr_set_str", - "giterr_set_oom" + "git_error_last", + "git_error_clear", + "git_error_set_str", + "git_error_set_oom" ], "meta": {}, - "lines": 149 + "lines": 157 }, { - "file": "filter.h", + "file": "git2/filter.h", "functions": [ "git_filter_list_load", "git_filter_list_contains", @@ -319,7 +356,7 @@ "lines": 210 }, { - "file": "global.h", + "file": "git2/global.h", "functions": [ "git_libgit2_init", "git_libgit2_shutdown" @@ -328,7 +365,7 @@ "lines": 39 }, { - "file": "graph.h", + "file": "git2/graph.h", "functions": [ "git_graph_ahead_behind", "git_graph_descendant_of" @@ -337,7 +374,7 @@ "lines": 54 }, { - "file": "ignore.h", + "file": "git2/ignore.h", "functions": [ "git_ignore_add_rule", "git_ignore_clear_internal_rules", @@ -347,7 +384,7 @@ "lines": 74 }, { - "file": "index.h", + "file": "git2/index.h", "functions": [ "git_index_matched_path_cb", "git_index_open", @@ -374,8 +411,11 @@ "git_index_add", "git_index_entry_stage", "git_index_entry_is_conflict", + "git_index_iterator_new", + "git_index_iterator_next", + "git_index_iterator_free", "git_index_add_bypath", - "git_index_add_frombuffer", + "git_index_add_from_buffer", "git_index_remove_bypath", "git_index_add_all", "git_index_remove_all", @@ -392,11 +432,13 @@ "git_index_conflict_iterator_free" ], "meta": {}, - "lines": 806 + "lines": 830 }, { - "file": "indexer.h", + "file": "git2/indexer.h", "functions": [ + "git_indexer_progress_cb", + "git_indexer_options_init", "git_indexer_new", "git_indexer_append", "git_indexer_commit", @@ -404,15 +446,30 @@ "git_indexer_free" ], "meta": {}, - "lines": 72 + "lines": 142 + }, + { + "file": "git2/mailmap.h", + "functions": [ + "git_mailmap_new", + "git_mailmap_free", + "git_mailmap_add_entry", + "git_mailmap_from_buffer", + "git_mailmap_from_repository", + "git_mailmap_resolve", + "git_mailmap_resolve_signature" + ], + "meta": {}, + "lines": 111 }, { - "file": "merge.h", + "file": "git2/merge.h", "functions": [ - "git_merge_file_init_input", - "git_merge_file_init_options", - "git_merge_init_options", + "git_merge_file_input_init", + "git_merge_file_options_init", + "git_merge_options_init", "git_merge_analysis", + "git_merge_analysis_for_ref", "git_merge_base", "git_merge_bases", "git_merge_base_many", @@ -426,10 +483,10 @@ "git_merge" ], "meta": {}, - "lines": 585 + "lines": 602 }, { - "file": "message.h", + "file": "git2/message.h", "functions": [ "git_message_prettify", "git_message_trailers", @@ -439,15 +496,13 @@ "lines": 79 }, { - "file": "net.h", - "functions": [ - "git_headlist_cb" - ], + "file": "git2/net.h", + "functions": [], "meta": {}, - "lines": 55 + "lines": 50 }, { - "file": "notes.h", + "file": "git2/notes.h", "functions": [ "git_note_foreach_cb", "git_note_iterator_new", @@ -465,13 +520,14 @@ "git_note_remove", "git_note_commit_remove", "git_note_free", + "git_note_default_ref", "git_note_foreach" ], "meta": {}, "lines": 302 }, { - "file": "object.h", + "file": "git2/object.h", "functions": [ "git_object_lookup", "git_object_lookup_prefix", @@ -484,7 +540,7 @@ "git_object_type2string", "git_object_string2type", "git_object_typeisloose", - "git_object__size", + "git_object_size", "git_object_peel", "git_object_dup" ], @@ -492,7 +548,7 @@ "lines": 237 }, { - "file": "odb.h", + "file": "git2/odb.h", "functions": [ "git_odb_foreach_cb", "git_odb_new", @@ -529,20 +585,20 @@ "git_odb_get_backend" ], "meta": {}, - "lines": 544 + "lines": 545 }, { - "file": "odb_backend.h", + "file": "git2/odb_backend.h", "functions": [ "git_odb_backend_pack", "git_odb_backend_loose", "git_odb_backend_one_pack" ], "meta": {}, - "lines": 130 + "lines": 131 }, { - "file": "oid.h", + "file": "git2/oid.h", "functions": [ "git_oid_fromstr", "git_oid_fromstrp", @@ -559,7 +615,7 @@ "git_oid_ncmp", "git_oid_streq", "git_oid_strcmp", - "git_oid_iszero", + "git_oid_is_zero", "git_oid_shorten_new", "git_oid_shorten_add", "git_oid_shorten_free" @@ -568,7 +624,7 @@ "lines": 264 }, { - "file": "oidarray.h", + "file": "git2/oidarray.h", "functions": [ "git_oidarray_free" ], @@ -576,7 +632,7 @@ "lines": 34 }, { - "file": "pack.h", + "file": "git2/pack.h", "functions": [ "git_packbuilder_new", "git_packbuilder_set_threads", @@ -585,8 +641,10 @@ "git_packbuilder_insert_commit", "git_packbuilder_insert_walk", "git_packbuilder_insert_recur", + "git_packbuilder_write_buf", "git_packbuilder_write", "git_packbuilder_hash", + "git_packbuilder_foreach_cb", "git_packbuilder_foreach", "git_packbuilder_object_count", "git_packbuilder_written", @@ -595,10 +653,10 @@ "git_packbuilder_free" ], "meta": {}, - "lines": 236 + "lines": 247 }, { - "file": "patch.h", + "file": "git2/patch.h", "functions": [ "git_patch_from_diff", "git_patch_from_blobs", @@ -619,7 +677,7 @@ "lines": 268 }, { - "file": "pathspec.h", + "file": "git2/pathspec.h", "functions": [ "git_pathspec_new", "git_pathspec_free", @@ -639,19 +697,23 @@ "lines": 277 }, { - "file": "proxy.h", + "file": "git2/proxy.h", "functions": [ - "git_proxy_init_options" + "git_proxy_options_init" ], "meta": {}, - "lines": 88 + "lines": 92 }, { - "file": "rebase.h", + "file": "git2/rebase.h", "functions": [ - "git_rebase_init_options", + "git_rebase_options_init", "git_rebase_init", "git_rebase_open", + "git_rebase_orig_head_name", + "git_rebase_orig_head_id", + "git_rebase_onto_name", + "git_rebase_onto_id", "git_rebase_operation_entrycount", "git_rebase_operation_current", "git_rebase_operation_byindex", @@ -663,10 +725,10 @@ "git_rebase_free" ], "meta": {}, - "lines": 316 + "lines": 347 }, { - "file": "refdb.h", + "file": "git2/refdb.h", "functions": [ "git_refdb_new", "git_refdb_open", @@ -677,7 +739,7 @@ "lines": 63 }, { - "file": "reflog.h", + "file": "git2/reflog.h", "functions": [ "git_reflog_read", "git_reflog_write", @@ -697,7 +759,7 @@ "lines": 166 }, { - "file": "refs.h", + "file": "git2/refs.h", "functions": [ "git_reference_lookup", "git_reference_name_to_id", @@ -719,6 +781,8 @@ "git_reference_delete", "git_reference_remove", "git_reference_list", + "git_reference_foreach_cb", + "git_reference_foreach_name_cb", "git_reference_foreach", "git_reference_foreach_name", "git_reference_dup", @@ -742,11 +806,13 @@ "git_reference_shorthand" ], "meta": {}, - "lines": 744 + "lines": 763 }, { - "file": "refspec.h", + "file": "git2/refspec.h", "functions": [ + "git_refspec_parse", + "git_refspec_free", "git_refspec_src", "git_refspec_dst", "git_refspec_string", @@ -758,12 +824,14 @@ "git_refspec_rtransform" ], "meta": {}, - "lines": 100 + "lines": 117 }, { - "file": "remote.h", + "file": "git2/remote.h", "functions": [ "git_remote_create", + "git_remote_create_options_init", + "git_remote_create_with_opts", "git_remote_create_with_fetchspec", "git_remote_create_anonymous", "git_remote_create_detached", @@ -788,12 +856,13 @@ "git_remote_disconnect", "git_remote_free", "git_remote_list", - "git_push_transfer_progress", + "git_push_transfer_progress_cb", "git_push_negotiation", "git_push_update_reference_cb", + "git_url_resolve_cb", "git_remote_init_callbacks", - "git_fetch_init_options", - "git_push_init_options", + "git_fetch_options_init", + "git_push_options_init", "git_remote_download", "git_remote_upload", "git_remote_update_tips", @@ -810,10 +879,10 @@ "git_remote_default_branch" ], "meta": {}, - "lines": 850 + "lines": 949 }, { - "file": "repository.h", + "file": "git2/repository.h", "functions": [ "git_repository_open", "git_repository_open_from_worktree", @@ -823,11 +892,12 @@ "git_repository_open_bare", "git_repository_free", "git_repository_init", - "git_repository_init_init_options", + "git_repository_init_options_init", "git_repository_init_ext", "git_repository_head", "git_repository_head_for_worktree", "git_repository_head_detached", + "git_repository_head_detached_for_worktree", "git_repository_head_unborn", "git_repository_is_empty", "git_repository_item_path", @@ -845,7 +915,9 @@ "git_repository_message", "git_repository_message_remove", "git_repository_state_cleanup", + "git_repository_fetchhead_foreach_cb", "git_repository_fetchhead_foreach", + "git_repository_mergehead_foreach_cb", "git_repository_mergehead_foreach", "git_repository_hashfile", "git_repository_set_head", @@ -860,10 +932,10 @@ "git_repository_set_ident" ], "meta": {}, - "lines": 862 + "lines": 899 }, { - "file": "reset.h", + "file": "git2/reset.h", "functions": [ "git_reset", "git_reset_from_annotated", @@ -873,17 +945,17 @@ "lines": 107 }, { - "file": "revert.h", + "file": "git2/revert.h", "functions": [ - "git_revert_init_options", + "git_revert_options_init", "git_revert_commit", "git_revert" ], "meta": {}, - "lines": 84 + "lines": 86 }, { - "file": "revparse.h", + "file": "git2/revparse.h", "functions": [ "git_revparse_single", "git_revparse_ext", @@ -893,7 +965,7 @@ "lines": 108 }, { - "file": "revwalk.h", + "file": "git2/revwalk.h", "functions": [ "git_revwalk_new", "git_revwalk_reset", @@ -918,7 +990,7 @@ "lines": 291 }, { - "file": "signature.h", + "file": "git2/signature.h", "functions": [ "git_signature_new", "git_signature_now", @@ -931,10 +1003,11 @@ "lines": 99 }, { - "file": "stash.h", + "file": "git2/stash.h", "functions": [ + "git_stash_save", "git_stash_apply_progress_cb", - "git_stash_apply_init_options", + "git_stash_apply_options_init", "git_stash_apply", "git_stash_cb", "git_stash_foreach", @@ -942,13 +1015,13 @@ "git_stash_pop" ], "meta": {}, - "lines": 253 + "lines": 256 }, { - "file": "status.h", + "file": "git2/status.h", "functions": [ "git_status_cb", - "git_status_init_options", + "git_status_options_init", "git_status_foreach", "git_status_foreach_ext", "git_status_file", @@ -959,10 +1032,10 @@ "git_status_should_ignore" ], "meta": {}, - "lines": 370 + "lines": 383 }, { - "file": "strarray.h", + "file": "git2/strarray.h", "functions": [ "git_strarray_free", "git_strarray_copy" @@ -971,10 +1044,10 @@ "lines": 53 }, { - "file": "submodule.h", + "file": "git2/submodule.h", "functions": [ "git_submodule_cb", - "git_submodule_update_init_options", + "git_submodule_update_options_init", "git_submodule_update", "git_submodule_lookup", "git_submodule_free", @@ -1008,184 +1081,46 @@ "git_submodule_location" ], "meta": {}, - "lines": 632 - }, - { - "file": "sys/commit.h", - "functions": [ - "git_commit_create_from_ids", - "git_commit_create_from_callback" - ], - "meta": {}, - "lines": 76 - }, - { - "file": "sys/config.h", - "functions": [ - "git_config_init_backend", - "git_config_add_backend" - ], - "meta": {}, - "lines": 126 - }, - { - "file": "sys/diff.h", - "functions": [ - "git_diff_print_callback__to_buf", - "git_diff_print_callback__to_file_handle", - "git_diff_get_perfdata", - "git_status_list_get_perfdata" - ], - "meta": {}, - "lines": 90 - }, - { - "file": "sys/filter.h", - "functions": [ - "git_filter_lookup", - "git_filter_list_new", - "git_filter_list_push", - "git_filter_list_length", - "git_filter_source_repo", - "git_filter_source_path", - "git_filter_source_filemode", - "git_filter_source_id", - "git_filter_source_mode", - "git_filter_source_flags", - "git_filter_init_fn", - "git_filter_shutdown_fn", - "git_filter_check_fn", - "git_filter_apply_fn", - "git_filter_cleanup_fn", - "git_filter_init", - "git_filter_register", - "git_filter_unregister" - ], - "meta": {}, - "lines": 328 + "lines": 633 }, { - "file": "sys/hashsig.h", - "functions": [ - "git_hashsig_create", - "git_hashsig_create_fromfile", - "git_hashsig_free", - "git_hashsig_compare" - ], + "file": "git2/sys/filter.h", + "functions": [], "meta": {}, - "lines": 102 + "lines": 95 }, { - "file": "sys/mempack.h", - "functions": [ - "git_mempack_new", - "git_mempack_dump", - "git_mempack_reset" - ], - "meta": {}, - "lines": 82 - }, - { - "file": "sys/merge.h", - "functions": [ - "git_merge_driver_init_fn", - "git_merge_driver_shutdown_fn", - "git_merge_driver_apply_fn" - ], - "meta": {}, - "lines": 135 - }, - { - "file": "sys/odb_backend.h", - "functions": [ - "git_odb_init_backend" - ], - "meta": {}, - "lines": 118 - }, - { - "file": "sys/openssl.h", - "functions": [ - "git_openssl_set_locking" - ], - "meta": {}, - "lines": 34 - }, - { - "file": "sys/refdb_backend.h", - "functions": [ - "git_refdb_init_backend", - "git_refdb_backend_fs", - "git_refdb_set_backend" - ], - "meta": {}, - "lines": 214 - }, - { - "file": "sys/refs.h", - "functions": [ - "git_reference__alloc", - "git_reference__alloc_symbolic" - ], + "file": "git2/sys/hashsig.h", + "functions": [], "meta": {}, "lines": 45 }, { - "file": "sys/repository.h", - "functions": [ - "git_repository_new", - "git_repository__cleanup", - "git_repository_reinit_filesystem", - "git_repository_set_config", - "git_repository_set_odb", - "git_repository_set_refdb", - "git_repository_set_index", - "git_repository_set_bare", - "git_repository_submodule_cache_all", - "git_repository_submodule_cache_clear" - ], + "file": "git2/sys/merge.h", + "functions": [], "meta": {}, - "lines": 165 + "lines": 41 }, { - "file": "sys/stream.h", - "functions": [ - "git_stream_register_tls" - ], + "file": "git2/sys/path.h", + "functions": [], "meta": {}, - "lines": 54 + "lines": 41 }, { - "file": "sys/time.h", - "functions": [ - "git_time_monotonic" - ], + "file": "git2/sys/stream.h", + "functions": [], "meta": {}, - "lines": 27 + "lines": 83 }, { - "file": "sys/transport.h", - "functions": [ - "git_transport_init", - "git_transport_new", - "git_transport_ssh_with_paths", - "git_transport_register", - "git_transport_unregister", - "git_transport_dummy", - "git_transport_local", - "git_transport_smart", - "git_transport_smart_certificate_check", - "git_transport_smart_credentials", - "git_transport_smart_proxy_options", - "git_smart_subtransport_http", - "git_smart_subtransport_git", - "git_smart_subtransport_ssh" - ], + "file": "git2/sys/transport.h", + "functions": [], "meta": {}, - "lines": 389 + "lines": 292 }, { - "file": "tag.h", + "file": "git2/tag.h", "functions": [ "git_tag_lookup", "git_tag_lookup_prefix", @@ -1200,29 +1135,45 @@ "git_tag_message", "git_tag_create", "git_tag_annotation_create", - "git_tag_create_frombuffer", + "git_tag_create_from_buffer", "git_tag_create_lightweight", "git_tag_delete", "git_tag_list", "git_tag_list_match", + "git_tag_foreach_cb", "git_tag_foreach", "git_tag_peel", "git_tag_dup" ], "meta": {}, - "lines": 357 + "lines": 366 }, { - "file": "trace.h", + "file": "git2/trace.h", "functions": [ - "git_trace_callback", + "git_trace_cb", "git_trace_set" ], "meta": {}, "lines": 63 }, { - "file": "transport.h", + "file": "git2/transaction.h", + "functions": [ + "git_transaction_new", + "git_transaction_lock_ref", + "git_transaction_set_target", + "git_transaction_set_symbolic_target", + "git_transaction_set_reflog", + "git_transaction_remove", + "git_transaction_commit", + "git_transaction_free" + ], + "meta": {}, + "lines": 117 + }, + { + "file": "git2/transport.h", "functions": [ "git_transport_cb", "git_cred_has_username", @@ -1238,10 +1189,10 @@ "git_cred_acquire_cb" ], "meta": {}, - "lines": 338 + "lines": 381 }, { - "file": "tree.h", + "file": "git2/tree.h", "functions": [ "git_tree_lookup", "git_tree_lookup_prefix", @@ -1282,40 +1233,41 @@ "lines": 479 }, { - "file": "types.h", + "file": "git2/types.h", "functions": [ - "git_transfer_progress_cb", "git_transport_message_cb", "git_transport_certificate_check_cb" ], "meta": {}, - "lines": 429 + "lines": 412 }, { - "file": "worktree.h", + "file": "git2/worktree.h", "functions": [ "git_worktree_list", "git_worktree_lookup", "git_worktree_open_from_repository", "git_worktree_free", "git_worktree_validate", - "git_worktree_add_init_options", + "git_worktree_add_options_init", "git_worktree_add", "git_worktree_lock", "git_worktree_unlock", "git_worktree_is_locked", - "git_worktree_prune_init_options", + "git_worktree_name", + "git_worktree_path", + "git_worktree_prune_options_init", "git_worktree_is_prunable", "git_worktree_prune" ], "meta": {}, - "lines": 216 + "lines": 251 } ], "functions": { "git_annotated_commit_from_ref": { "type": "function", - "file": "annotated_commit.h", + "file": "git2/annotated_commit.h", "line": 33, "lineto": 36, "args": [ @@ -1343,16 +1295,11 @@ }, "description": "

Creates a git_annotated_commit from the given reference.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n", "comments": "", - "group": "annotated", - "examples": { - "merge.c": [ - "ex/HEAD/merge.html#git_annotated_commit_from_ref-1" - ] - } + "group": "annotated" }, "git_annotated_commit_from_fetchhead": { "type": "function", - "file": "annotated_commit.h", + "file": "git2/annotated_commit.h", "line": 50, "lineto": 55, "args": [ @@ -1394,7 +1341,7 @@ }, "git_annotated_commit_lookup": { "type": "function", - "file": "annotated_commit.h", + "file": "git2/annotated_commit.h", "line": 75, "lineto": 78, "args": [ @@ -1422,16 +1369,11 @@ }, "description": "

Creates a git_annotated_commit from the given commit id.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n", "comments": "

An annotated commit contains information about how it was looked up, which may be useful for functions like merge or rebase to provide context to the operation. For example, conflict files will include the name of the source or target branches being merged. It is therefore preferable to use the most specific function (eg git_annotated_commit_from_ref) instead of this one when that data is known.

\n", - "group": "annotated", - "examples": { - "merge.c": [ - "ex/HEAD/merge.html#git_annotated_commit_lookup-2" - ] - } + "group": "annotated" }, "git_annotated_commit_from_revspec": { "type": "function", - "file": "annotated_commit.h", + "file": "git2/annotated_commit.h", "line": 92, "lineto": 95, "args": [ @@ -1463,7 +1405,7 @@ }, "git_annotated_commit_id": { "type": "function", - "file": "annotated_commit.h", + "file": "git2/annotated_commit.h", "line": 103, "lineto": 104, "args": [ @@ -1483,18 +1425,49 @@ "comments": "", "group": "annotated", "examples": { + "checkout.c": [ + "ex/HEAD/checkout.html#git_annotated_commit_id-1" + ], "merge.c": [ - "ex/HEAD/merge.html#git_annotated_commit_id-3", - "ex/HEAD/merge.html#git_annotated_commit_id-4", - "ex/HEAD/merge.html#git_annotated_commit_id-5" + "ex/HEAD/merge.html#git_annotated_commit_id-1", + "ex/HEAD/merge.html#git_annotated_commit_id-2", + "ex/HEAD/merge.html#git_annotated_commit_id-3" + ] + } + }, + "git_annotated_commit_ref": { + "type": "function", + "file": "git2/annotated_commit.h", + "line": 112, + "lineto": 113, + "args": [ + { + "name": "commit", + "type": "const git_annotated_commit *", + "comment": "the given annotated commit" + } + ], + "argline": "const git_annotated_commit *commit", + "sig": "const git_annotated_commit *", + "return": { + "type": "const char *", + "comment": " ref name." + }, + "description": "

Get the refname that the given git_annotated_commit refers to.

\n", + "comments": "", + "group": "annotated", + "examples": { + "checkout.c": [ + "ex/HEAD/checkout.html#git_annotated_commit_ref-2", + "ex/HEAD/checkout.html#git_annotated_commit_ref-3" ] } }, "git_annotated_commit_free": { "type": "function", - "file": "annotated_commit.h", - "line": 111, - "lineto": 112, + "file": "git2/annotated_commit.h", + "line": 120, + "lineto": 121, "args": [ { "name": "commit", @@ -1510,11 +1483,95 @@ }, "description": "

Frees a git_annotated_commit.

\n", "comments": "", - "group": "annotated" + "group": "annotated", + "examples": { + "checkout.c": [ + "ex/HEAD/checkout.html#git_annotated_commit_free-4" + ] + } + }, + "git_apply_to_tree": { + "type": "function", + "file": "git2/apply.h", + "line": 92, + "lineto": 97, + "args": [ + { + "name": "out", + "type": "git_index **", + "comment": "the postimage of the application" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to apply" + }, + { + "name": "preimage", + "type": "git_tree *", + "comment": "the tree to apply the diff to" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "the diff to apply" + }, + { + "name": "options", + "type": "const git_apply_options *", + "comment": "the options for the apply (or null for defaults)" + } + ], + "argline": "git_index **out, git_repository *repo, git_tree *preimage, git_diff *diff, const git_apply_options *options", + "sig": "git_index **::git_repository *::git_tree *::git_diff *::const git_apply_options *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Apply a git_diff to a git_tree, and return the resulting image\n as an index.

\n", + "comments": "", + "group": "apply" + }, + "git_apply": { + "type": "function", + "file": "git2/apply.h", + "line": 129, + "lineto": 133, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to apply to" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "the diff to apply" + }, + { + "name": "location", + "type": "git_apply_location_t", + "comment": "the location to apply (workdir, index or both)" + }, + { + "name": "options", + "type": "const git_apply_options *", + "comment": "the options for the apply (or null for defaults)" + } + ], + "argline": "git_repository *repo, git_diff *diff, git_apply_location_t location, const git_apply_options *options", + "sig": "git_repository *::git_diff *::git_apply_location_t::const git_apply_options *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Apply a git_diff to the given repository, making changes directly\n in the working directory, the index, or both.

\n", + "comments": "", + "group": "apply" }, "git_attr_value": { "type": "function", - "file": "attr.h", + "file": "git2/attr.h", "line": 102, "lineto": 102, "args": [ @@ -1527,7 +1584,7 @@ "argline": "const char *attr", "sig": "const char *", "return": { - "type": "git_attr_t", + "type": "git_attr_value_t", "comment": " the value type for the attribute" }, "description": "

Return the value type for a given attribute.

\n", @@ -1536,7 +1593,7 @@ }, "git_attr_get": { "type": "function", - "file": "attr.h", + "file": "git2/attr.h", "line": 145, "lineto": 150, "args": [ @@ -1578,7 +1635,7 @@ }, "git_attr_get_many": { "type": "function", - "file": "attr.h", + "file": "git2/attr.h", "line": 181, "lineto": 187, "args": [ @@ -1625,9 +1682,9 @@ }, "git_attr_foreach": { "type": "function", - "file": "attr.h", - "line": 209, - "lineto": 214, + "file": "git2/attr.h", + "line": 220, + "lineto": 225, "args": [ { "name": "repo", @@ -1647,7 +1704,7 @@ { "name": "callback", "type": "git_attr_foreach_cb", - "comment": "Function to invoke on each attribute name and value. The\n value may be NULL is the attribute is explicitly set to\n UNSPECIFIED using the '!' sign. Callback will be invoked\n only once per attribute name, even if there are multiple\n rules for a given file. The highest priority rule will be\n used. Return a non-zero value from this to stop looping.\n The value will be returned from `git_attr_foreach`." + "comment": "Function to invoke on each attribute name and value.\n See git_attr_foreach_cb." }, { "name": "payload", @@ -1667,9 +1724,9 @@ }, "git_attr_cache_flush": { "type": "function", - "file": "attr.h", - "line": 224, - "lineto": 225, + "file": "git2/attr.h", + "line": 235, + "lineto": 236, "args": [ { "name": "repo", @@ -1689,9 +1746,9 @@ }, "git_attr_add_macro": { "type": "function", - "file": "attr.h", - "line": 237, - "lineto": 240, + "file": "git2/attr.h", + "line": 248, + "lineto": 251, "args": [ { "name": "repo", @@ -1719,21 +1776,21 @@ "comments": "

Macros will automatically be loaded from the top level .gitattributes file of the repository (plus the build-in "binary" macro). This function allows you to add others. For example, to add the default macro, you would call:

\n\n
 git_attr_add_macro(repo, "binary", "-diff -crlf");\n
\n", "group": "attr" }, - "git_blame_init_options": { + "git_blame_options_init": { "type": "function", - "file": "blame.h", - "line": 92, - "lineto": 94, + "file": "git2/blame.h", + "line": 103, + "lineto": 105, "args": [ { "name": "opts", "type": "git_blame_options *", - "comment": "The `git_blame_options` struct to initialize" + "comment": "The `git_blame_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_BLAME_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_BLAME_OPTIONS_VERSION`." } ], "argline": "git_blame_options *opts, unsigned int version", @@ -1742,15 +1799,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_blame_options with default values. Equivalent to\n creating an instance with GIT_BLAME_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_blame_options structure

\n", + "comments": "

Initializes a git_blame_options with default values. Equivalent to creating an instance with GIT_BLAME_OPTIONS_INIT.

\n", "group": "blame" }, "git_blame_get_hunk_count": { "type": "function", - "file": "blame.h", - "line": 137, - "lineto": 137, + "file": "git2/blame.h", + "line": 154, + "lineto": 154, "args": [ { "name": "blame", @@ -1770,9 +1827,9 @@ }, "git_blame_get_hunk_byindex": { "type": "function", - "file": "blame.h", - "line": 146, - "lineto": 148, + "file": "git2/blame.h", + "line": 163, + "lineto": 165, "args": [ { "name": "blame", @@ -1797,9 +1854,9 @@ }, "git_blame_get_hunk_byline": { "type": "function", - "file": "blame.h", - "line": 157, - "lineto": 159, + "file": "git2/blame.h", + "line": 174, + "lineto": 176, "args": [ { "name": "blame", @@ -1829,9 +1886,9 @@ }, "git_blame_file": { "type": "function", - "file": "blame.h", - "line": 172, - "lineto": 176, + "file": "git2/blame.h", + "line": 189, + "lineto": 193, "args": [ { "name": "out", @@ -1858,7 +1915,7 @@ "sig": "git_blame **::git_repository *::const char *::git_blame_options *", "return": { "type": "int", - "comment": " 0 on success, or an error code. (use giterr_last for information\n about the error.)" + "comment": " 0 on success, or an error code. (use git_error_last for information\n about the error.)" }, "description": "

Get the blame for a single file.

\n", "comments": "", @@ -1871,9 +1928,9 @@ }, "git_blame_buffer": { "type": "function", - "file": "blame.h", - "line": 196, - "lineto": 200, + "file": "git2/blame.h", + "line": 213, + "lineto": 217, "args": [ { "name": "out", @@ -1900,7 +1957,7 @@ "sig": "git_blame **::git_blame *::const char *::size_t", "return": { "type": "int", - "comment": " 0 on success, or an error code. (use giterr_last for information\n about the error)" + "comment": " 0 on success, or an error code. (use git_error_last for information\n about the error)" }, "description": "

Get blame data for a file that has been modified in memory. The reference\n parameter is a pre-calculated blame for the in-odb history of the file. This\n means that once a file blame is completed (which can be expensive), updating\n the buffer blame is very fast.

\n", "comments": "

Lines that differ between the buffer and the committed version are marked as having a zero OID for their final_commit_id.

\n", @@ -1908,9 +1965,9 @@ }, "git_blame_free": { "type": "function", - "file": "blame.h", - "line": 207, - "lineto": 207, + "file": "git2/blame.h", + "line": 224, + "lineto": 224, "args": [ { "name": "blame", @@ -1935,7 +1992,7 @@ }, "git_blob_lookup": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 33, "lineto": 33, "args": [ @@ -1975,7 +2032,7 @@ }, "git_blob_lookup_prefix": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 47, "lineto": 47, "args": [ @@ -2012,7 +2069,7 @@ }, "git_blob_free": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 60, "lineto": 60, "args": [ @@ -2042,7 +2099,7 @@ }, "git_blob_id": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 68, "lineto": 68, "args": [ @@ -2064,7 +2121,7 @@ }, "git_blob_owner": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 76, "lineto": 76, "args": [ @@ -2086,7 +2143,7 @@ }, "git_blob_rawcontent": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 89, "lineto": 89, "args": [ @@ -2119,7 +2176,7 @@ }, "git_blob_rawsize": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 97, "lineto": 97, "args": [ @@ -2153,7 +2210,7 @@ }, "git_blob_filtered_content": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 122, "lineto": 126, "args": [ @@ -2185,12 +2242,12 @@ "comment": " 0 on success or an error code" }, "description": "

Get a buffer with the filtered content of a blob.

\n", - "comments": "

This applies filters as if the blob was being checked out to the working directory under the specified filename. This may apply CRLF filtering or other types of changes depending on the file attributes set for the blob and the content detected in it.

\n\n

The output is written into a git_buf which the caller must free when done (via git_buf_free).

\n\n

If no filters need to be applied, then the out buffer will just be populated with a pointer to the raw content of the blob. In that case, be careful to not free the blob until done with the buffer or copy it into memory you own.

\n", + "comments": "

This applies filters as if the blob was being checked out to the working directory under the specified filename. This may apply CRLF filtering or other types of changes depending on the file attributes set for the blob and the content detected in it.

\n\n

The output is written into a git_buf which the caller must free when done (via git_buf_dispose).

\n\n

If no filters need to be applied, then the out buffer will just be populated with a pointer to the raw content of the blob. In that case, be careful to not free the blob until done with the buffer or copy it into memory you own.

\n", "group": "blob" }, - "git_blob_create_fromworkdir": { + "git_blob_create_from_workdir": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 139, "lineto": 139, "args": [ @@ -2220,9 +2277,9 @@ "comments": "", "group": "blob" }, - "git_blob_create_fromdisk": { + "git_blob_create_from_disk": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 151, "lineto": 151, "args": [ @@ -2252,9 +2309,9 @@ "comments": "", "group": "blob" }, - "git_blob_create_fromstream": { + "git_blob_create_from_stream": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 178, "lineto": 181, "args": [ @@ -2281,12 +2338,12 @@ "comment": " 0 or error code" }, "description": "

Create a stream to write a new blob into the object db

\n", - "comments": "

This function may need to buffer the data on disk and will in general not be the right choice if you know the size of the data to write. If you have data in memory, use git_blob_create_frombuffer(). If you do not, but know the size of the contents (and don't want/need to perform filtering), use git_odb_open_wstream().

\n\n

Don't close this stream yourself but pass it to git_blob_create_fromstream_commit() to commit the write to the object db and get the object id.

\n\n

If the hintpath parameter is filled, it will be used to determine what git filters should be applied to the object before it is written to the object database.

\n", + "comments": "

This function may need to buffer the data on disk and will in general not be the right choice if you know the size of the data to write. If you have data in memory, use git_blob_create_from_buffer(). If you do not, but know the size of the contents (and don't want/need to perform filtering), use git_odb_open_wstream().

\n\n

Don't close this stream yourself but pass it to git_blob_create_from_stream_commit() to commit the write to the object db and get the object id.

\n\n

If the hintpath parameter is filled, it will be used to determine what git filters should be applied to the object before it is written to the object database.

\n", "group": "blob" }, - "git_blob_create_fromstream_commit": { + "git_blob_create_from_stream_commit": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 192, "lineto": 194, "args": [ @@ -2311,9 +2368,9 @@ "comments": "

The stream will be closed and freed.

\n", "group": "blob" }, - "git_blob_create_frombuffer": { + "git_blob_create_from_buffer": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 205, "lineto": 206, "args": [ @@ -2350,7 +2407,7 @@ }, "git_blob_is_binary": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 219, "lineto": 219, "args": [ @@ -2372,7 +2429,7 @@ }, "git_blob_dup": { "type": "function", - "file": "blob.h", + "file": "git2/blob.h", "line": 228, "lineto": 228, "args": [ @@ -2399,7 +2456,7 @@ }, "git_branch_create": { "type": "function", - "file": "branch.h", + "file": "git2/branch.h", "line": 50, "lineto": 55, "args": [ @@ -2441,7 +2498,7 @@ }, "git_branch_create_from_annotated": { "type": "function", - "file": "branch.h", + "file": "git2/branch.h", "line": 68, "lineto": 73, "args": [ @@ -2483,7 +2540,7 @@ }, "git_branch_delete": { "type": "function", - "file": "branch.h", + "file": "git2/branch.h", "line": 85, "lineto": 85, "args": [ @@ -2505,7 +2562,7 @@ }, "git_branch_iterator_new": { "type": "function", - "file": "branch.h", + "file": "git2/branch.h", "line": 101, "lineto": 104, "args": [ @@ -2537,7 +2594,7 @@ }, "git_branch_next": { "type": "function", - "file": "branch.h", + "file": "git2/branch.h", "line": 114, "lineto": 114, "args": [ @@ -2569,7 +2626,7 @@ }, "git_branch_iterator_free": { "type": "function", - "file": "branch.h", + "file": "git2/branch.h", "line": 121, "lineto": 121, "args": [ @@ -2591,7 +2648,7 @@ }, "git_branch_move": { "type": "function", - "file": "branch.h", + "file": "git2/branch.h", "line": 138, "lineto": 142, "args": [ @@ -2628,7 +2685,7 @@ }, "git_branch_lookup": { "type": "function", - "file": "branch.h", + "file": "git2/branch.h", "line": 165, "lineto": 169, "args": [ @@ -2665,7 +2722,7 @@ }, "git_branch_name": { "type": "function", - "file": "branch.h", + "file": "git2/branch.h", "line": 186, "lineto": 188, "args": [ @@ -2691,13 +2748,13 @@ "group": "branch", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_branch_name-6" + "ex/HEAD/merge.html#git_branch_name-4" ] } }, "git_branch_upstream": { "type": "function", - "file": "branch.h", + "file": "git2/branch.h", "line": 202, "lineto": 204, "args": [ @@ -2724,7 +2781,7 @@ }, "git_branch_set_upstream": { "type": "function", - "file": "branch.h", + "file": "git2/branch.h", "line": 216, "lineto": 216, "args": [ @@ -2749,9 +2806,41 @@ "comments": "", "group": "branch" }, + "git_branch_upstream_name": { + "type": "function", + "file": "git2/branch.h", + "line": 232, + "lineto": 235, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Pointer to the user-allocated git_buf which will be\n filled with the name of the reference." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the branches live" + }, + { + "name": "refname", + "type": "const char *", + "comment": "reference name of the local branch." + } + ], + "argline": "git_buf *out, git_repository *repo, const char *refname", + "sig": "git_buf *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND when no remote tracking reference exists,\n otherwise an error code." + }, + "description": "

Return the name of the reference supporting the remote tracking branch,\n given the name of a local branch reference.

\n", + "comments": "", + "group": "branch" + }, "git_branch_is_head": { "type": "function", - "file": "branch.h", + "file": "git2/branch.h", "line": 245, "lineto": 246, "args": [ @@ -2773,7 +2862,7 @@ }, "git_branch_is_checked_out": { "type": "function", - "file": "branch.h", + "file": "git2/branch.h", "line": 257, "lineto": 258, "args": [ @@ -2793,11 +2882,75 @@ "comments": "", "group": "branch" }, - "git_buf_free": { + "git_branch_remote_name": { "type": "function", - "file": "buffer.h", - "line": 72, - "lineto": 72, + "file": "git2/branch.h", + "line": 274, + "lineto": 277, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Pointer to the user-allocated git_buf which will be filled with the name of the remote." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository where the branch lives." + }, + { + "name": "canonical_branch_name", + "type": "const char *", + "comment": "name of the remote tracking branch." + } + ], + "argline": "git_buf *out, git_repository *repo, const char *canonical_branch_name", + "sig": "git_buf *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND\n when no remote matching remote was found,\n GIT_EAMBIGUOUS when the branch maps to several remotes,\n otherwise an error code." + }, + "description": "

Return the name of remote that the remote tracking branch belongs to.

\n", + "comments": "", + "group": "branch" + }, + "git_branch_upstream_remote": { + "type": "function", + "file": "git2/branch.h", + "line": 288, + "lineto": 288, + "args": [ + { + "name": "buf", + "type": "git_buf *", + "comment": "the buffer into which to write the name" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to look" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the full name of the branch" + } + ], + "argline": "git_buf *buf, git_repository *repo, const char *refname", + "sig": "git_buf *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Retrieve the name of the upstream remote of a local branch

\n", + "comments": "", + "group": "branch" + }, + "git_buf_dispose": { + "type": "function", + "file": "git2/buffer.h", + "line": 78, + "lineto": 78, "args": [ { "name": "buffer", @@ -2816,21 +2969,18 @@ "group": "buf", "examples": { "diff.c": [ - "ex/HEAD/diff.html#git_buf_free-1" - ], - "remote.c": [ - "ex/HEAD/remote.html#git_buf_free-1" + "ex/HEAD/diff.html#git_buf_dispose-1" ], "tag.c": [ - "ex/HEAD/tag.html#git_buf_free-1" + "ex/HEAD/tag.html#git_buf_dispose-1" ] } }, "git_buf_grow": { "type": "function", - "file": "buffer.h", - "line": 95, - "lineto": 95, + "file": "git2/buffer.h", + "line": 101, + "lineto": 101, "args": [ { "name": "buffer", @@ -2855,9 +3005,9 @@ }, "git_buf_set": { "type": "function", - "file": "buffer.h", - "line": 105, - "lineto": 106, + "file": "git2/buffer.h", + "line": 111, + "lineto": 112, "args": [ { "name": "buffer", @@ -2887,9 +3037,9 @@ }, "git_buf_is_binary": { "type": "function", - "file": "buffer.h", - "line": 114, - "lineto": 114, + "file": "git2/buffer.h", + "line": 120, + "lineto": 120, "args": [ { "name": "buf", @@ -2909,9 +3059,9 @@ }, "git_buf_contains_nul": { "type": "function", - "file": "buffer.h", - "line": 122, - "lineto": 122, + "file": "git2/buffer.h", + "line": 128, + "lineto": 128, "args": [ { "name": "buf", @@ -2929,21 +3079,21 @@ "comments": "", "group": "buf" }, - "git_checkout_init_options": { + "git_checkout_options_init": { "type": "function", - "file": "checkout.h", - "line": 308, - "lineto": 310, + "file": "git2/checkout.h", + "line": 341, + "lineto": 343, "args": [ { "name": "opts", "type": "git_checkout_options *", - "comment": "the `git_checkout_options` struct to initialize." + "comment": "The `git_checkout_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_CHECKOUT_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_CHECKOUT_OPTIONS_VERSION`." } ], "argline": "git_checkout_options *opts, unsigned int version", @@ -2952,15 +3102,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_checkout_options with default values. Equivalent to\n creating an instance with GIT_CHECKOUT_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_checkout_options structure

\n", + "comments": "

Initializes a git_checkout_options with default values. Equivalent to creating an instance with GIT_CHECKOUT_OPTIONS_INIT.

\n", "group": "checkout" }, "git_checkout_head": { "type": "function", - "file": "checkout.h", - "line": 329, - "lineto": 331, + "file": "git2/checkout.h", + "line": 362, + "lineto": 364, "args": [ { "name": "repo", @@ -2977,7 +3127,7 @@ "sig": "git_repository *::const git_checkout_options *", "return": { "type": "int", - "comment": " 0 on success, GIT_EUNBORNBRANCH if HEAD points to a non\n existing branch, non-zero value returned by `notify_cb`, or\n other error code \n<\n 0 (use giterr_last for error details)" + "comment": " 0 on success, GIT_EUNBORNBRANCH if HEAD points to a non\n existing branch, non-zero value returned by `notify_cb`, or\n other error code \n<\n 0 (use git_error_last for error details)" }, "description": "

Updates files in the index and the working tree to match the content of\n the commit pointed at by HEAD.

\n", "comments": "

Note that this is not the correct mechanism used to switch branches; do not change your HEAD and then call this method, that would leave you with checkout conflicts since your working directory would then appear to be dirty. Instead, checkout the target of the branch and then update HEAD using git_repository_set_head to point to the branch you checked out.

\n", @@ -2985,9 +3135,9 @@ }, "git_checkout_index": { "type": "function", - "file": "checkout.h", - "line": 342, - "lineto": 345, + "file": "git2/checkout.h", + "line": 375, + "lineto": 378, "args": [ { "name": "repo", @@ -3009,7 +3159,7 @@ "sig": "git_repository *::git_index *::const git_checkout_options *", "return": { "type": "int", - "comment": " 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use giterr_last for error details)" + "comment": " 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use git_error_last for error details)" }, "description": "

Updates files in the working tree to match the content of the index.

\n", "comments": "", @@ -3017,9 +3167,9 @@ }, "git_checkout_tree": { "type": "function", - "file": "checkout.h", - "line": 358, - "lineto": 361, + "file": "git2/checkout.h", + "line": 391, + "lineto": 394, "args": [ { "name": "repo", @@ -3041,32 +3191,35 @@ "sig": "git_repository *::const git_object *::const git_checkout_options *", "return": { "type": "int", - "comment": " 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use giterr_last for error details)" + "comment": " 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use git_error_last for error details)" }, "description": "

Updates files in the index and working tree to match the content of the\n tree pointed at by the treeish.

\n", "comments": "", "group": "checkout", "examples": { + "checkout.c": [ + "ex/HEAD/checkout.html#git_checkout_tree-5" + ], "merge.c": [ - "ex/HEAD/merge.html#git_checkout_tree-7" + "ex/HEAD/merge.html#git_checkout_tree-5" ] } }, - "git_cherrypick_init_options": { + "git_cherrypick_options_init": { "type": "function", - "file": "cherrypick.h", - "line": 47, - "lineto": 49, + "file": "git2/cherrypick.h", + "line": 49, + "lineto": 51, "args": [ { "name": "opts", "type": "git_cherrypick_options *", - "comment": "the `git_cherrypick_options` struct to initialize" + "comment": "The `git_cherrypick_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_CHERRYPICK_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_CHERRYPICK_OPTIONS_VERSION`." } ], "argline": "git_cherrypick_options *opts, unsigned int version", @@ -3075,15 +3228,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_cherrypick_options with default values. Equivalent to\n creating an instance with GIT_CHERRYPICK_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_cherrypick_options structure

\n", + "comments": "

Initializes a git_cherrypick_options with default values. Equivalent to creating an instance with GIT_CHERRYPICK_OPTIONS_INIT.

\n", "group": "cherrypick" }, "git_cherrypick_commit": { "type": "function", - "file": "cherrypick.h", - "line": 65, - "lineto": 71, + "file": "git2/cherrypick.h", + "line": 67, + "lineto": 73, "args": [ { "name": "out", @@ -3128,9 +3281,9 @@ }, "git_cherrypick": { "type": "function", - "file": "cherrypick.h", - "line": 81, - "lineto": 84, + "file": "git2/cherrypick.h", + "line": 83, + "lineto": 86, "args": [ { "name": "repo", @@ -3158,21 +3311,21 @@ "comments": "", "group": "cherrypick" }, - "git_clone_init_options": { + "git_clone_options_init": { "type": "function", - "file": "clone.h", - "line": 179, - "lineto": 181, + "file": "git2/clone.h", + "line": 181, + "lineto": 183, "args": [ { "name": "opts", "type": "git_clone_options *", - "comment": "The `git_clone_options` struct to initialize" + "comment": "The `git_clone_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_CLONE_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_CLONE_OPTIONS_VERSION`." } ], "argline": "git_clone_options *opts, unsigned int version", @@ -3181,15 +3334,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_clone_options with default values. Equivalent to\n creating an instance with GIT_CLONE_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_clone_options structure

\n", + "comments": "

Initializes a git_clone_options with default values. Equivalent to creating an instance with GIT_CLONE_OPTIONS_INIT.

\n", "group": "clone" }, "git_clone": { "type": "function", - "file": "clone.h", - "line": 199, - "lineto": 203, + "file": "git2/clone.h", + "line": 201, + "lineto": 205, "args": [ { "name": "out", @@ -3216,20 +3369,15 @@ "sig": "git_repository **::const char *::const char *::const git_clone_options *", "return": { "type": "int", - "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `giterr_last` for a detailed error message)" + "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `git_error_last` for a detailed error message)" }, "description": "

Clone a remote repository.

\n", "comments": "

By default this creates its repository and initial remote to match git's defaults. You can use the options in the callback to customize how these are created.

\n", - "group": "clone", - "examples": { - "network/clone.c": [ - "ex/HEAD/network/clone.html#git_clone-1" - ] - } + "group": "clone" }, "git_commit_lookup": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 36, "lineto": 37, "args": [ @@ -3259,6 +3407,9 @@ "comments": "

The returned object should be released with git_commit_free when no longer needed.

\n", "group": "commit", "examples": { + "checkout.c": [ + "ex/HEAD/checkout.html#git_commit_lookup-6" + ], "general.c": [ "ex/HEAD/general.html#git_commit_lookup-6", "ex/HEAD/general.html#git_commit_lookup-7", @@ -3268,13 +3419,13 @@ "ex/HEAD/log.html#git_commit_lookup-1" ], "merge.c": [ - "ex/HEAD/merge.html#git_commit_lookup-8" + "ex/HEAD/merge.html#git_commit_lookup-6" ] } }, "git_commit_lookup_prefix": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 55, "lineto": 56, "args": [ @@ -3311,7 +3462,7 @@ }, "git_commit_free": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 70, "lineto": 70, "args": [ @@ -3331,6 +3482,9 @@ "comments": "

This is a wrapper around git_object_free()

\n\n

IMPORTANT: It is necessary to call this method when you stop using a commit. Failure to do so will cause a memory leak.

\n", "group": "commit", "examples": { + "checkout.c": [ + "ex/HEAD/checkout.html#git_commit_free-7" + ], "general.c": [ "ex/HEAD/general.html#git_commit_free-9", "ex/HEAD/general.html#git_commit_free-10", @@ -3348,7 +3502,7 @@ }, "git_commit_id": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 78, "lineto": 78, "args": [ @@ -3378,7 +3532,7 @@ }, "git_commit_owner": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 86, "lineto": 86, "args": [ @@ -3406,7 +3560,7 @@ }, "git_commit_message_encoding": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 98, "lineto": 98, "args": [ @@ -3428,7 +3582,7 @@ }, "git_commit_message": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 109, "lineto": 109, "args": [ @@ -3469,7 +3623,7 @@ }, "git_commit_message_raw": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 117, "lineto": 117, "args": [ @@ -3491,7 +3645,7 @@ }, "git_commit_summary": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 128, "lineto": 128, "args": [ @@ -3513,7 +3667,7 @@ }, "git_commit_body": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 141, "lineto": 141, "args": [ @@ -3535,7 +3689,7 @@ }, "git_commit_time": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 149, "lineto": 149, "args": [ @@ -3563,7 +3717,7 @@ }, "git_commit_time_offset": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 157, "lineto": 157, "args": [ @@ -3585,7 +3739,7 @@ }, "git_commit_committer": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 165, "lineto": 165, "args": [ @@ -3618,7 +3772,7 @@ }, "git_commit_author": { "type": "function", - "file": "commit.h", + "file": "git2/commit.h", "line": 173, "lineto": 173, "args": [ @@ -3651,11 +3805,75 @@ ] } }, + "git_commit_committer_with_mailmap": { + "type": "function", + "file": "git2/commit.h", + "line": 186, + "lineto": 187, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "a pointer to store the resolved signature." + }, + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + }, + { + "name": "mailmap", + "type": "const git_mailmap *", + "comment": "the mailmap to resolve with. (may be NULL)" + } + ], + "argline": "git_signature **out, const git_commit *commit, const git_mailmap *mailmap", + "sig": "git_signature **::const git_commit *::const git_mailmap *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the committer of a commit, using the mailmap to map names and email\n addresses to canonical real names and email addresses.

\n", + "comments": "

Call git_signature_free to free the signature.

\n", + "group": "commit" + }, + "git_commit_author_with_mailmap": { + "type": "function", + "file": "git2/commit.h", + "line": 200, + "lineto": 201, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "a pointer to store the resolved signature." + }, + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + }, + { + "name": "mailmap", + "type": "const git_mailmap *", + "comment": "the mailmap to resolve with. (may be NULL)" + } + ], + "argline": "git_signature **out, const git_commit *commit, const git_mailmap *mailmap", + "sig": "git_signature **::const git_commit *::const git_mailmap *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the author of a commit, using the mailmap to map names and email\n addresses to canonical real names and email addresses.

\n", + "comments": "

Call git_signature_free to free the signature.

\n", + "group": "commit" + }, "git_commit_raw_header": { "type": "function", - "file": "commit.h", - "line": 181, - "lineto": 181, + "file": "git2/commit.h", + "line": 209, + "lineto": 209, "args": [ { "name": "commit", @@ -3675,9 +3893,9 @@ }, "git_commit_tree": { "type": "function", - "file": "commit.h", - "line": 190, - "lineto": 190, + "file": "git2/commit.h", + "line": 218, + "lineto": 218, "args": [ { "name": "tree_out", @@ -3711,9 +3929,9 @@ }, "git_commit_tree_id": { "type": "function", - "file": "commit.h", - "line": 200, - "lineto": 200, + "file": "git2/commit.h", + "line": 228, + "lineto": 228, "args": [ { "name": "commit", @@ -3738,9 +3956,9 @@ }, "git_commit_parentcount": { "type": "function", - "file": "commit.h", - "line": 208, - "lineto": 208, + "file": "git2/commit.h", + "line": 236, + "lineto": 236, "args": [ { "name": "commit", @@ -3772,9 +3990,9 @@ }, "git_commit_parent": { "type": "function", - "file": "commit.h", - "line": 218, - "lineto": 221, + "file": "git2/commit.h", + "line": 246, + "lineto": 249, "args": [ { "name": "out", @@ -3813,9 +4031,9 @@ }, "git_commit_parent_id": { "type": "function", - "file": "commit.h", - "line": 232, - "lineto": 234, + "file": "git2/commit.h", + "line": 260, + "lineto": 262, "args": [ { "name": "commit", @@ -3848,9 +4066,9 @@ }, "git_commit_nth_gen_ancestor": { "type": "function", - "file": "commit.h", - "line": 250, - "lineto": 253, + "file": "git2/commit.h", + "line": 278, + "lineto": 281, "args": [ { "name": "ancestor", @@ -3880,9 +4098,9 @@ }, "git_commit_header_field": { "type": "function", - "file": "commit.h", - "line": 265, - "lineto": 265, + "file": "git2/commit.h", + "line": 293, + "lineto": 293, "args": [ { "name": "out", @@ -3912,9 +4130,9 @@ }, "git_commit_extract_signature": { "type": "function", - "file": "commit.h", - "line": 285, - "lineto": 285, + "file": "git2/commit.h", + "line": 313, + "lineto": 313, "args": [ { "name": "signature", @@ -3949,14 +4167,14 @@ "comment": " 0 on success, GIT_ENOTFOUND if the id is not for a commit\n or the commit does not have a signature." }, "description": "

Extract the signature from a commit

\n", - "comments": "

If the id is not for a commit, the error class will be GITERR_INVALID. If the commit does not have a signature, the error class will be GITERR_OBJECT.

\n", + "comments": "

If the id is not for a commit, the error class will be GIT_ERROR_INVALID. If the commit does not have a signature, the error class will be GIT_ERROR_OBJECT.

\n", "group": "commit" }, "git_commit_create": { "type": "function", - "file": "commit.h", - "line": 331, - "lineto": 341, + "file": "git2/commit.h", + "line": 359, + "lineto": 369, "args": [ { "name": "id", @@ -4020,15 +4238,15 @@ "group": "commit", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_commit_create-9" + "ex/HEAD/merge.html#git_commit_create-7" ] } }, "git_commit_create_v": { "type": "function", - "file": "commit.h", - "line": 357, - "lineto": 367, + "file": "git2/commit.h", + "line": 385, + "lineto": 395, "args": [ { "name": "id", @@ -4096,9 +4314,9 @@ }, "git_commit_amend": { "type": "function", - "file": "commit.h", - "line": 390, - "lineto": 398, + "file": "git2/commit.h", + "line": 418, + "lineto": 426, "args": [ { "name": "id", @@ -4153,9 +4371,9 @@ }, "git_commit_create_buffer": { "type": "function", - "file": "commit.h", - "line": 435, - "lineto": 444, + "file": "git2/commit.h", + "line": 463, + "lineto": 472, "args": [ { "name": "out", @@ -4215,9 +4433,9 @@ }, "git_commit_create_with_signature": { "type": "function", - "file": "commit.h", - "line": 460, - "lineto": 465, + "file": "git2/commit.h", + "line": 488, + "lineto": 493, "args": [ { "name": "out", @@ -4257,9 +4475,9 @@ }, "git_commit_dup": { "type": "function", - "file": "commit.h", - "line": 474, - "lineto": 474, + "file": "git2/commit.h", + "line": 502, + "lineto": 502, "args": [ { "name": "out", @@ -4284,9 +4502,9 @@ }, "git_libgit2_version": { "type": "function", - "file": "common.h", - "line": 105, - "lineto": 105, + "file": "git2/common.h", + "line": 121, + "lineto": 121, "args": [ { "name": "major", @@ -4316,9 +4534,9 @@ }, "git_libgit2_features": { "type": "function", - "file": "common.h", - "line": 154, - "lineto": 154, + "file": "git2/common.h", + "line": 170, + "lineto": 170, "args": [], "argline": "", "sig": "", @@ -4332,9 +4550,9 @@ }, "git_libgit2_opts": { "type": "function", - "file": "common.h", - "line": 352, - "lineto": 352, + "file": "git2/common.h", + "line": 404, + "lineto": 404, "args": [ { "name": "option", @@ -4349,14 +4567,14 @@ "comment": " 0 on success, \n<\n0 on failure" }, "description": "

Set or query a library global option

\n", - "comments": "

Available options:

\n\n
* opts(GIT_OPT_GET_MWINDOW_SIZE, size_t *):\n\n    > Get the maximum mmap window size\n\n* opts(GIT_OPT_SET_MWINDOW_SIZE, size_t):\n\n    > Set the maximum mmap window size\n\n* opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t *):\n\n    > Get the maximum memory that will be mapped in total by the library\n\n* opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):\n\n    >Set the maximum amount of memory that can be mapped at any time        by the library\n\n* opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)\n\n    > Get the search path for a given level of config data.  "level" must       > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`,       > `GIT_CONFIG_LEVEL_XDG`, or `GIT_CONFIG_LEVEL_PROGRAMDATA`.        > The search path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)\n\n    > Set the search path for a level of config data.  The search path      > applied to shared attributes and ignore files, too.       >       > - `path` lists directories delimited by GIT_PATH_LIST_SEPARATOR.      >   Pass NULL to reset to the default (generally based on environment       >   variables).  Use magic path `$PATH` to include the old value        >   of the path (if you want to prepend or append, for instance).       >       > - `level` must be `GIT_CONFIG_LEVEL_SYSTEM`,      >   `GIT_CONFIG_LEVEL_GLOBAL`, `GIT_CONFIG_LEVEL_XDG`, or       >   `GIT_CONFIG_LEVEL_PROGRAMDATA`.\n\n* opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_otype type, size_t size)\n\n    > Set the maximum data size for the given type of object to be      > considered eligible for caching in memory.  Setting to value to       > zero means that that type of object will not be cached.       > Defaults to 0 for GIT_OBJ_BLOB (i.e. won't cache blobs) and 4k        > for GIT_OBJ_COMMIT, GIT_OBJ_TREE, and GIT_OBJ_TAG.\n\n* opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)\n\n    > Set the maximum total data size that will be cached in memory     > across all repositories before libgit2 starts evicting objects        > from the cache.  This is a soft limit, in that the library might      > briefly exceed it, but will start aggressively evicting objects       > from cache when that happens.  The default cache size is 256MB.\n\n* opts(GIT_OPT_ENABLE_CACHING, int enabled)\n\n    > Enable or disable caching completely.     >       > Because caches are repository-specific, disabling the cache       > cannot immediately clear all cached objects, but each cache will      > be cleared on the next attempt to update anything in it.\n\n* opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t *current, ssize_t *allowed)\n\n    > Get the current bytes in cache and the maximum that would be      > allowed in the cache.\n\n* opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf *out)\n\n    > Get the default template path.        > The path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)\n\n    > Set the default template path.        >       > - `path` directory of template.\n\n* opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char *file, const char *path)\n\n    > Set the SSL certificate-authority locations.      >       > - `file` is the location of a file containing several     >   certificates concatenated together.     > - `path` is the location of a directory holding several       >   certificates, one per file.     >       > Either parameter may be `NULL`, but not both.\n\n* opts(GIT_OPT_SET_USER_AGENT, const char *user_agent)\n\n    > Set the value of the User-Agent header.  This value will be       > appended to "git/1.0", for compatibility with other git clients.      >       > - `user_agent` is the value that will be delivered as the     >   User-Agent header on HTTP requests.\n\n* opts(GIT_OPT_SET_WINDOWS_SHAREMODE, unsigned long value)\n\n    > Set the share mode used when opening files on Windows.        > For more information, see the documentation for CreateFile.       > The default is: FILE_SHARE_READ | FILE_SHARE_WRITE.  This is      > ignored and unused on non-Windows platforms.\n\n* opts(GIT_OPT_GET_WINDOWS_SHAREMODE, unsigned long *value)\n\n    > Get the share mode used when opening files on Windows.\n\n* opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, int enabled)\n\n    > Enable strict input validation when creating new objects      > to ensure that all inputs to the new objects are valid.  For      > example, when this is enabled, the parent(s) and tree inputs      > will be validated when creating a new commit.  This defaults      > to enabled.\n\n* opts(GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION, int enabled)\n\n    > Validate the target of a symbolic ref when creating it.  For      > example, `foobar` is not a valid ref, therefore `foobar` is       > not a valid target for a symbolic ref by default, whereas     > `refs/heads/foobar` is.  Disabling this bypasses validation       > so that an arbitrary strings such as `foobar` can be used     > for a symbolic ref target.  This defaults to enabled.\n\n* opts(GIT_OPT_SET_SSL_CIPHERS, const char *ciphers)\n\n    > Set the SSL ciphers use for HTTPS connections.        >       > - `ciphers` is the list of ciphers that are eanbled.\n\n* opts(GIT_OPT_ENABLE_OFS_DELTA, int enabled)\n\n    > Enable or disable the use of "offset deltas" when creating packfiles,     > and the negotiation of them when talking to a remote server.      > Offset deltas store a delta base location as an offset into the       > packfile from the current location, which provides a shorter encoding     > and thus smaller resultant packfiles.     > Packfiles containing offset deltas can still be read.     > This defaults to enabled.\n\n* opts(GIT_OPT_ENABLE_FSYNC_GITDIR, int enabled)\n\n    > Enable synchronized writes of files in the gitdir using `fsync`       > (or the platform equivalent) to ensure that new object data       > is written to permanent storage, not simply cached.  This     > defaults to disabled.\n\n opts(GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, int enabled)\n\n    > Enable strict verification of object hashsums when reading        > objects from disk. This may impact performance due to an      > additional checksum calculation on each object. This defaults     > to enabled.\n
\n", + "comments": "

Available options:

\n\n
* opts(GIT_OPT_GET_MWINDOW_SIZE, size_t *):\n\n    > Get the maximum mmap window size\n\n* opts(GIT_OPT_SET_MWINDOW_SIZE, size_t):\n\n    > Set the maximum mmap window size\n\n* opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t *):\n\n    > Get the maximum memory that will be mapped in total by the library\n\n* opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):\n\n    >Set the maximum amount of memory that can be mapped at any time        by the library\n\n* opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)\n\n    > Get the search path for a given level of config data.  "level" must       > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`,       > `GIT_CONFIG_LEVEL_XDG`, or `GIT_CONFIG_LEVEL_PROGRAMDATA`.        > The search path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)\n\n    > Set the search path for a level of config data.  The search path      > applied to shared attributes and ignore files, too.       >       > - `path` lists directories delimited by GIT_PATH_LIST_SEPARATOR.      >   Pass NULL to reset to the default (generally based on environment       >   variables).  Use magic path `$PATH` to include the old value        >   of the path (if you want to prepend or append, for instance).       >       > - `level` must be `GIT_CONFIG_LEVEL_SYSTEM`,      >   `GIT_CONFIG_LEVEL_GLOBAL`, `GIT_CONFIG_LEVEL_XDG`, or       >   `GIT_CONFIG_LEVEL_PROGRAMDATA`.\n\n* opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_object_t type, size_t size)\n\n    > Set the maximum data size for the given type of object to be      > considered eligible for caching in memory.  Setting to value to       > zero means that that type of object will not be cached.       > Defaults to 0 for GIT_OBJECT_BLOB (i.e. won't cache blobs) and 4k     > for GIT_OBJECT_COMMIT, GIT_OBJECT_TREE, and GIT_OBJECT_TAG.\n\n* opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)\n\n    > Set the maximum total data size that will be cached in memory     > across all repositories before libgit2 starts evicting objects        > from the cache.  This is a soft limit, in that the library might      > briefly exceed it, but will start aggressively evicting objects       > from cache when that happens.  The default cache size is 256MB.\n\n* opts(GIT_OPT_ENABLE_CACHING, int enabled)\n\n    > Enable or disable caching completely.     >       > Because caches are repository-specific, disabling the cache       > cannot immediately clear all cached objects, but each cache will      > be cleared on the next attempt to update anything in it.\n\n* opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t *current, ssize_t *allowed)\n\n    > Get the current bytes in cache and the maximum that would be      > allowed in the cache.\n\n* opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf *out)\n\n    > Get the default template path.        > The path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)\n\n    > Set the default template path.        >       > - `path` directory of template.\n\n* opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char *file, const char *path)\n\n    > Set the SSL certificate-authority locations.      >       > - `file` is the location of a file containing several     >   certificates concatenated together.     > - `path` is the location of a directory holding several       >   certificates, one per file.     >       > Either parameter may be `NULL`, but not both.\n\n* opts(GIT_OPT_SET_USER_AGENT, const char *user_agent)\n\n    > Set the value of the User-Agent header.  This value will be       > appended to "git/1.0", for compatibility with other git clients.      >       > - `user_agent` is the value that will be delivered as the     >   User-Agent header on HTTP requests.\n\n* opts(GIT_OPT_SET_WINDOWS_SHAREMODE, unsigned long value)\n\n    > Set the share mode used when opening files on Windows.        > For more information, see the documentation for CreateFile.       > The default is: FILE_SHARE_READ | FILE_SHARE_WRITE.  This is      > ignored and unused on non-Windows platforms.\n\n* opts(GIT_OPT_GET_WINDOWS_SHAREMODE, unsigned long *value)\n\n    > Get the share mode used when opening files on Windows.\n\n* opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, int enabled)\n\n    > Enable strict input validation when creating new objects      > to ensure that all inputs to the new objects are valid.  For      > example, when this is enabled, the parent(s) and tree inputs      > will be validated when creating a new commit.  This defaults      > to enabled.\n\n* opts(GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION, int enabled)\n\n    > Validate the target of a symbolic ref when creating it.  For      > example, `foobar` is not a valid ref, therefore `foobar` is       > not a valid target for a symbolic ref by default, whereas     > `refs/heads/foobar` is.  Disabling this bypasses validation       > so that an arbitrary strings such as `foobar` can be used     > for a symbolic ref target.  This defaults to enabled.\n\n* opts(GIT_OPT_SET_SSL_CIPHERS, const char *ciphers)\n\n    > Set the SSL ciphers use for HTTPS connections.        >       > - `ciphers` is the list of ciphers that are eanbled.\n\n* opts(GIT_OPT_ENABLE_OFS_DELTA, int enabled)\n\n    > Enable or disable the use of "offset deltas" when creating packfiles,     > and the negotiation of them when talking to a remote server.      > Offset deltas store a delta base location as an offset into the       > packfile from the current location, which provides a shorter encoding     > and thus smaller resultant packfiles.     > Packfiles containing offset deltas can still be read.     > This defaults to enabled.\n\n* opts(GIT_OPT_ENABLE_FSYNC_GITDIR, int enabled)\n\n    > Enable synchronized writes of files in the gitdir using `fsync`       > (or the platform equivalent) to ensure that new object data       > is written to permanent storage, not simply cached.  This     > defaults to disabled.\n\n opts(GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, int enabled)\n\n    > Enable strict verification of object hashsums when reading        > objects from disk. This may impact performance due to an      > additional checksum calculation on each object. This defaults     > to enabled.\n\n opts(GIT_OPT_SET_ALLOCATOR, git_allocator *allocator)\n\n    > Set the memory allocator to a different memory allocator. This        > allocator will then be used to make all memory allocations for        > libgit2 operations.  If the given `allocator` is NULL, then the       > system default will be restored.\n\n opts(GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY, int enabled)\n\n    > Ensure that there are no unsaved changes in the index before      > beginning any operation that reloads the index from disk (eg,     > checkout).  If there are unsaved changes, the instruction will        > fail.  (Using the FORCE flag to checkout will still overwrite     > these changes.)\n\n opts(GIT_OPT_GET_PACK_MAX_OBJECTS, size_t *out)\n\n    > Get the maximum number of objects libgit2 will allow in a pack        > file when downloading a pack file from a remote. This can be      > used to limit maximum memory usage when fetching from an untrusted        > remote.\n\n opts(GIT_OPT_SET_PACK_MAX_OBJECTS, size_t objects)\n\n    > Set the maximum number of objects libgit2 will allow in a pack        > file when downloading a pack file from a remote.\n\n opts(GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS, int enabled)       > This will cause .keep file existence checks to be skipped when        > accessing packfiles, which can help performance with remote filesystems.\n
\n", "group": "libgit2" }, "git_config_entry_free": { "type": "function", - "file": "config.h", - "line": 75, - "lineto": 75, + "file": "git2/config.h", + "line": 76, + "lineto": 76, "args": [ { "name": "", @@ -4376,9 +4594,9 @@ }, "git_config_find_global": { "type": "function", - "file": "config.h", - "line": 116, - "lineto": 116, + "file": "git2/config.h", + "line": 127, + "lineto": 127, "args": [ { "name": "out", @@ -4398,9 +4616,9 @@ }, "git_config_find_xdg": { "type": "function", - "file": "config.h", - "line": 133, - "lineto": 133, + "file": "git2/config.h", + "line": 144, + "lineto": 144, "args": [ { "name": "out", @@ -4420,9 +4638,9 @@ }, "git_config_find_system": { "type": "function", - "file": "config.h", - "line": 145, - "lineto": 145, + "file": "git2/config.h", + "line": 156, + "lineto": 156, "args": [ { "name": "out", @@ -4442,9 +4660,9 @@ }, "git_config_find_programdata": { "type": "function", - "file": "config.h", - "line": 156, - "lineto": 156, + "file": "git2/config.h", + "line": 167, + "lineto": 167, "args": [ { "name": "out", @@ -4464,9 +4682,9 @@ }, "git_config_open_default": { "type": "function", - "file": "config.h", - "line": 168, - "lineto": 168, + "file": "git2/config.h", + "line": 179, + "lineto": 179, "args": [ { "name": "out", @@ -4486,9 +4704,9 @@ }, "git_config_new": { "type": "function", - "file": "config.h", - "line": 179, - "lineto": 179, + "file": "git2/config.h", + "line": 190, + "lineto": 190, "args": [ { "name": "out", @@ -4508,9 +4726,9 @@ }, "git_config_add_file_ondisk": { "type": "function", - "file": "config.h", - "line": 208, - "lineto": 213, + "file": "git2/config.h", + "line": 219, + "lineto": 224, "args": [ { "name": "cfg", @@ -4550,9 +4768,9 @@ }, "git_config_open_ondisk": { "type": "function", - "file": "config.h", - "line": 227, - "lineto": 227, + "file": "git2/config.h", + "line": 238, + "lineto": 238, "args": [ { "name": "out", @@ -4582,9 +4800,9 @@ }, "git_config_open_level": { "type": "function", - "file": "config.h", - "line": 245, - "lineto": 248, + "file": "git2/config.h", + "line": 256, + "lineto": 259, "args": [ { "name": "out", @@ -4614,9 +4832,9 @@ }, "git_config_open_global": { "type": "function", - "file": "config.h", - "line": 262, - "lineto": 262, + "file": "git2/config.h", + "line": 273, + "lineto": 273, "args": [ { "name": "out", @@ -4636,14 +4854,14 @@ "comment": null }, "description": "

Open the global/XDG configuration file according to git's rules

\n", - "comments": "

Git allows you to store your global configuration at $HOME/.config or $XDG_CONFIG_HOME/git/config. For backwards compatability, the XDG file shouldn't be used unless the use has created it explicitly. With this function you'll open the correct one to write to.

\n", + "comments": "

Git allows you to store your global configuration at $HOME/.gitconfig or $XDG_CONFIG_HOME/git/config. For backwards compatability, the XDG file shouldn't be used unless the use has created it explicitly. With this function you'll open the correct one to write to.

\n", "group": "config" }, "git_config_snapshot": { "type": "function", - "file": "config.h", - "line": 278, - "lineto": 278, + "file": "git2/config.h", + "line": 289, + "lineto": 289, "args": [ { "name": "out", @@ -4668,9 +4886,9 @@ }, "git_config_free": { "type": "function", - "file": "config.h", - "line": 285, - "lineto": 285, + "file": "git2/config.h", + "line": 296, + "lineto": 296, "args": [ { "name": "cfg", @@ -4696,9 +4914,9 @@ }, "git_config_get_entry": { "type": "function", - "file": "config.h", - "line": 297, - "lineto": 300, + "file": "git2/config.h", + "line": 308, + "lineto": 311, "args": [ { "name": "out", @@ -4728,9 +4946,9 @@ }, "git_config_get_int32": { "type": "function", - "file": "config.h", - "line": 314, - "lineto": 314, + "file": "git2/config.h", + "line": 325, + "lineto": 325, "args": [ { "name": "out", @@ -4766,9 +4984,9 @@ }, "git_config_get_int64": { "type": "function", - "file": "config.h", - "line": 328, - "lineto": 328, + "file": "git2/config.h", + "line": 339, + "lineto": 339, "args": [ { "name": "out", @@ -4798,9 +5016,9 @@ }, "git_config_get_bool": { "type": "function", - "file": "config.h", - "line": 345, - "lineto": 345, + "file": "git2/config.h", + "line": 356, + "lineto": 356, "args": [ { "name": "out", @@ -4830,9 +5048,9 @@ }, "git_config_get_path": { "type": "function", - "file": "config.h", - "line": 363, - "lineto": 363, + "file": "git2/config.h", + "line": 374, + "lineto": 374, "args": [ { "name": "out", @@ -4862,9 +5080,9 @@ }, "git_config_get_string": { "type": "function", - "file": "config.h", - "line": 381, - "lineto": 381, + "file": "git2/config.h", + "line": 392, + "lineto": 392, "args": [ { "name": "out", @@ -4900,9 +5118,9 @@ }, "git_config_get_string_buf": { "type": "function", - "file": "config.h", - "line": 397, - "lineto": 397, + "file": "git2/config.h", + "line": 408, + "lineto": 408, "args": [ { "name": "out", @@ -4932,9 +5150,9 @@ }, "git_config_get_multivar_foreach": { "type": "function", - "file": "config.h", - "line": 415, - "lineto": 415, + "file": "git2/config.h", + "line": 426, + "lineto": 426, "args": [ { "name": "cfg", @@ -4974,9 +5192,9 @@ }, "git_config_multivar_iterator_new": { "type": "function", - "file": "config.h", - "line": 430, - "lineto": 430, + "file": "git2/config.h", + "line": 441, + "lineto": 441, "args": [ { "name": "out", @@ -5011,9 +5229,9 @@ }, "git_config_next": { "type": "function", - "file": "config.h", - "line": 442, - "lineto": 442, + "file": "git2/config.h", + "line": 453, + "lineto": 453, "args": [ { "name": "entry", @@ -5038,9 +5256,9 @@ }, "git_config_iterator_free": { "type": "function", - "file": "config.h", - "line": 449, - "lineto": 449, + "file": "git2/config.h", + "line": 460, + "lineto": 460, "args": [ { "name": "iter", @@ -5060,9 +5278,9 @@ }, "git_config_set_int32": { "type": "function", - "file": "config.h", - "line": 460, - "lineto": 460, + "file": "git2/config.h", + "line": 471, + "lineto": 471, "args": [ { "name": "cfg", @@ -5092,9 +5310,9 @@ }, "git_config_set_int64": { "type": "function", - "file": "config.h", - "line": 471, - "lineto": 471, + "file": "git2/config.h", + "line": 482, + "lineto": 482, "args": [ { "name": "cfg", @@ -5124,9 +5342,9 @@ }, "git_config_set_bool": { "type": "function", - "file": "config.h", - "line": 482, - "lineto": 482, + "file": "git2/config.h", + "line": 493, + "lineto": 493, "args": [ { "name": "cfg", @@ -5156,9 +5374,9 @@ }, "git_config_set_string": { "type": "function", - "file": "config.h", - "line": 496, - "lineto": 496, + "file": "git2/config.h", + "line": 507, + "lineto": 507, "args": [ { "name": "cfg", @@ -5188,9 +5406,9 @@ }, "git_config_set_multivar": { "type": "function", - "file": "config.h", - "line": 508, - "lineto": 508, + "file": "git2/config.h", + "line": 519, + "lineto": 519, "args": [ { "name": "cfg", @@ -5225,9 +5443,9 @@ }, "git_config_delete_entry": { "type": "function", - "file": "config.h", - "line": 517, - "lineto": 517, + "file": "git2/config.h", + "line": 528, + "lineto": 528, "args": [ { "name": "cfg", @@ -5252,9 +5470,9 @@ }, "git_config_delete_multivar": { "type": "function", - "file": "config.h", - "line": 530, - "lineto": 530, + "file": "git2/config.h", + "line": 541, + "lineto": 541, "args": [ { "name": "cfg", @@ -5284,9 +5502,9 @@ }, "git_config_foreach": { "type": "function", - "file": "config.h", - "line": 548, - "lineto": 551, + "file": "git2/config.h", + "line": 559, + "lineto": 562, "args": [ { "name": "cfg", @@ -5316,9 +5534,9 @@ }, "git_config_iterator_new": { "type": "function", - "file": "config.h", - "line": 562, - "lineto": 562, + "file": "git2/config.h", + "line": 573, + "lineto": 573, "args": [ { "name": "out", @@ -5343,9 +5561,9 @@ }, "git_config_iterator_glob_new": { "type": "function", - "file": "config.h", - "line": 578, - "lineto": 578, + "file": "git2/config.h", + "line": 589, + "lineto": 589, "args": [ { "name": "out", @@ -5375,9 +5593,9 @@ }, "git_config_foreach_match": { "type": "function", - "file": "config.h", - "line": 600, - "lineto": 604, + "file": "git2/config.h", + "line": 611, + "lineto": 615, "args": [ { "name": "cfg", @@ -5407,14 +5625,14 @@ "comment": " 0 or the return value of the callback which didn't return 0" }, "description": "

Perform an operation on each config variable matching a regular expression.

\n", - "comments": "

This behaviors like git_config_foreach with an additional filter of a regular expression that filters which config keys are passed to the callback.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the case-insensitive parts are lower-case.

\n", + "comments": "

This behaves like git_config_foreach with an additional filter of a regular expression that filters which config keys are passed to the callback.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the case-insensitive parts are lower-case.

\n", "group": "config" }, "git_config_get_mapped": { "type": "function", - "file": "config.h", - "line": 640, - "lineto": 645, + "file": "git2/config.h", + "line": 651, + "lineto": 656, "args": [ { "name": "out", @@ -5433,8 +5651,8 @@ }, { "name": "maps", - "type": "const git_cvar_map *", - "comment": "array of `git_cvar_map` objects specifying the possible mappings" + "type": "const git_configmap *", + "comment": "array of `git_configmap` objects specifying the possible mappings" }, { "name": "map_n", @@ -5442,21 +5660,21 @@ "comment": "number of mapping objects in `maps`" } ], - "argline": "int *out, const git_config *cfg, const char *name, const git_cvar_map *maps, size_t map_n", - "sig": "int *::const git_config *::const char *::const git_cvar_map *::size_t", + "argline": "int *out, const git_config *cfg, const char *name, const git_configmap *maps, size_t map_n", + "sig": "int *::const git_config *::const char *::const git_configmap *::size_t", "return": { "type": "int", "comment": " 0 on success, error code otherwise" }, "description": "

Query the value of a config variable and return it mapped to\n an integer constant.

\n", - "comments": "

This is a helper method to easily map different possible values to a variable to integer constants that easily identify them.

\n\n

A mapping array looks as follows:

\n\n
git_cvar_map autocrlf_mapping[] = {     {GIT_CVAR_FALSE, NULL, GIT_AUTO_CRLF_FALSE},        {GIT_CVAR_TRUE, NULL, GIT_AUTO_CRLF_TRUE},      {GIT_CVAR_STRING, "input", GIT_AUTO_CRLF_INPUT},        {GIT_CVAR_STRING, "default", GIT_AUTO_CRLF_DEFAULT}};\n
\n\n

On any "false" value for the variable (e.g. "false", "FALSE", "no"), the mapping will store GIT_AUTO_CRLF_FALSE in the out parameter.

\n\n

The same thing applies for any "true" value such as "true", "yes" or "1", storing the GIT_AUTO_CRLF_TRUE variable.

\n\n

Otherwise, if the value matches the string "input" (with case insensitive comparison), the given constant will be stored in out, and likewise for "default".

\n\n

If not a single match can be made to store in out, an error code will be returned.

\n", + "comments": "

This is a helper method to easily map different possible values to a variable to integer constants that easily identify them.

\n\n

A mapping array looks as follows:

\n\n
git_configmap autocrlf_mapping[] = {        {GIT_CVAR_FALSE, NULL, GIT_AUTO_CRLF_FALSE},        {GIT_CVAR_TRUE, NULL, GIT_AUTO_CRLF_TRUE},      {GIT_CVAR_STRING, "input", GIT_AUTO_CRLF_INPUT},        {GIT_CVAR_STRING, "default", GIT_AUTO_CRLF_DEFAULT}};\n
\n\n

On any "false" value for the variable (e.g. "false", "FALSE", "no"), the mapping will store GIT_AUTO_CRLF_FALSE in the out parameter.

\n\n

The same thing applies for any "true" value such as "true", "yes" or "1", storing the GIT_AUTO_CRLF_TRUE variable.

\n\n

Otherwise, if the value matches the string "input" (with case insensitive comparison), the given constant will be stored in out, and likewise for "default".

\n\n

If not a single match can be made to store in out, an error code will be returned.

\n", "group": "config" }, "git_config_lookup_map_value": { "type": "function", - "file": "config.h", - "line": 655, - "lineto": 659, + "file": "git2/config.h", + "line": 666, + "lineto": 670, "args": [ { "name": "out", @@ -5465,8 +5683,8 @@ }, { "name": "maps", - "type": "const git_cvar_map *", - "comment": "array of `git_cvar_map` objects specifying the possible mappings" + "type": "const git_configmap *", + "comment": "array of `git_configmap` objects specifying the possible mappings" }, { "name": "map_n", @@ -5479,8 +5697,8 @@ "comment": "value to parse" } ], - "argline": "int *out, const git_cvar_map *maps, size_t map_n, const char *value", - "sig": "int *::const git_cvar_map *::size_t::const char *", + "argline": "int *out, const git_configmap *maps, size_t map_n, const char *value", + "sig": "int *::const git_configmap *::size_t::const char *", "return": { "type": "int", "comment": null @@ -5491,9 +5709,9 @@ }, "git_config_parse_bool": { "type": "function", - "file": "config.h", - "line": 671, - "lineto": 671, + "file": "git2/config.h", + "line": 682, + "lineto": 682, "args": [ { "name": "out", @@ -5518,9 +5736,9 @@ }, "git_config_parse_int32": { "type": "function", - "file": "config.h", - "line": 683, - "lineto": 683, + "file": "git2/config.h", + "line": 694, + "lineto": 694, "args": [ { "name": "out", @@ -5545,9 +5763,9 @@ }, "git_config_parse_int64": { "type": "function", - "file": "config.h", - "line": 695, - "lineto": 695, + "file": "git2/config.h", + "line": 706, + "lineto": 706, "args": [ { "name": "out", @@ -5572,9 +5790,9 @@ }, "git_config_parse_path": { "type": "function", - "file": "config.h", - "line": 710, - "lineto": 710, + "file": "git2/config.h", + "line": 721, + "lineto": 721, "args": [ { "name": "out", @@ -5599,9 +5817,9 @@ }, "git_config_backend_foreach_match": { "type": "function", - "file": "config.h", - "line": 728, - "lineto": 732, + "file": "git2/config.h", + "line": 739, + "lineto": 743, "args": [ { "name": "backend", @@ -5630,15 +5848,15 @@ "type": "int", "comment": null }, - "description": "

Perform an operation on each config variable in given config backend\n matching a regular expression.

\n", - "comments": "

This behaviors like git_config_foreach_match except instead of all config entries it just enumerates through the given backend entry.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n", + "description": "

Perform an operation on each config variable in a given config backend,\n matching a regular expression.

\n", + "comments": "

This behaves like git_config_foreach_match except that only config entries from the given backend entry are enumerated.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n", "group": "config" }, "git_config_lock": { "type": "function", - "file": "config.h", - "line": 751, - "lineto": 751, + "file": "git2/config.h", + "line": 762, + "lineto": 762, "args": [ { "name": "tx", @@ -5663,7 +5881,7 @@ }, "git_cred_userpass": { "type": "function", - "file": "cred_helpers.h", + "file": "git2/cred_helpers.h", "line": 43, "lineto": 48, "args": [ @@ -5703,11 +5921,253 @@ "comments": "", "group": "cred" }, + "git_blob_create_fromworkdir": { + "type": "function", + "file": "git2/deprecated.h", + "line": 81, + "lineto": 81, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": null + }, + { + "name": "repo", + "type": "git_repository *", + "comment": null + }, + { + "name": "relative_path", + "type": "const char *", + "comment": null + } + ], + "argline": "git_oid *id, git_repository *repo, const char *relative_path", + "sig": "git_oid *::git_repository *::const char *", + "return": { + "type": "int", + "comment": null + }, + "description": "", + "comments": "

These functions are retained for backward compatibility. The newer versions of these functions should be preferred in all new code.

\n\n

There is no plan to remove these backward compatibility values at this time.

\n\n

@{

\n", + "group": "blob" + }, + "git_buf_free": { + "type": "function", + "file": "git2/deprecated.h", + "line": 116, + "lineto": 116, + "args": [ + { + "name": "buffer", + "type": "git_buf *", + "comment": null + } + ], + "argline": "git_buf *buffer", + "sig": "git_buf *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the memory referred to by the git_buf. This is an alias of\n git_buf_dispose and is preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "buf" + }, + "giterr_last": { + "type": "function", + "file": "git2/deprecated.h", + "line": 190, + "lineto": 190, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "const git_error *", + "comment": null + }, + "description": "

Return the last git_error object that was generated for the\n current thread. This is an alias of git_error_last and is\n preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "giterr" + }, + "giterr_clear": { + "type": "function", + "file": "git2/deprecated.h", + "line": 202, + "lineto": 202, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "void", + "comment": null + }, + "description": "

Clear the last error. This is an alias of git_error_last and is\n preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "giterr" + }, + "giterr_set_str": { + "type": "function", + "file": "git2/deprecated.h", + "line": 214, + "lineto": 214, + "args": [ + { + "name": "error_class", + "type": "int", + "comment": null + }, + { + "name": "string", + "type": "const char *", + "comment": null + } + ], + "argline": "int error_class, const char *string", + "sig": "int::const char *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Sets the error message to the given string. This is an alias of\n git_error_set_str and is preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "giterr" + }, + "giterr_set_oom": { + "type": "function", + "file": "git2/deprecated.h", + "line": 226, + "lineto": 226, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "void", + "comment": null + }, + "description": "

Indicates that an out-of-memory situation occured. This is an alias\n of git_error_set_oom and is preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "giterr" + }, + "git_oid_iszero": { + "type": "function", + "file": "git2/deprecated.h", + "line": 378, + "lineto": 378, + "args": [ + { + "name": "id", + "type": "const git_oid *", + "comment": null + } + ], + "argline": "const git_oid *id", + "sig": "const git_oid *", + "return": { + "type": "int", + "comment": null + }, + "description": "", + "comments": "

These types are retained for backward compatibility. The newer versions of these values should be preferred in all new code.

\n\n

There is no plan to remove these backward compatibility values at this time.

\n\n

@{

\n", + "group": "oid" + }, + "git_blame_init_options": { + "type": "function", + "file": "git2/deprecated.h", + "line": 437, + "lineto": 437, + "args": [ + { + "name": "opts", + "type": "git_blame_options *", + "comment": null + }, + { + "name": "version", + "type": "unsigned int", + "comment": null + } + ], + "argline": "git_blame_options *opts, unsigned int version", + "sig": "git_blame_options *::unsigned int", + "return": { + "type": "int", + "comment": null + }, + "description": "", + "comments": "

These functions are retained for backward compatibility. The newer versions of these functions should be preferred in all new code.

\n\n

There is no plan to remove these backward compatibility functions at this time.

\n\n

@{

\n", + "group": "blame" + }, + "git_describe_options_init": { + "type": "function", + "file": "git2/describe.h", + "line": 82, + "lineto": 82, + "args": [ + { + "name": "opts", + "type": "git_describe_options *", + "comment": "The `git_describe_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DESCRIBE_OPTIONS_VERSION`." + } + ], + "argline": "git_describe_options *opts, unsigned int version", + "sig": "git_describe_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_describe_options structure

\n", + "comments": "

Initializes a git_describe_options with default values. Equivalent to creating an instance with GIT_DESCRIBE_OPTIONS_INIT.

\n", + "group": "describe", + "examples": { + "describe.c": [ + "ex/HEAD/describe.html#git_describe_options_init-1" + ] + } + }, + "git_describe_format_options_init": { + "type": "function", + "file": "git2/describe.h", + "line": 129, + "lineto": 129, + "args": [ + { + "name": "opts", + "type": "git_describe_format_options *", + "comment": "The `git_describe_format_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DESCRIBE_FORMAT_OPTIONS_VERSION`." + } + ], + "argline": "git_describe_format_options *opts, unsigned int version", + "sig": "git_describe_format_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_describe_format_options structure

\n", + "comments": "

Initializes a git_describe_format_options with default values. Equivalent to creating an instance with GIT_DESCRIBE_FORMAT_OPTIONS_INIT.

\n", + "group": "describe", + "examples": { + "describe.c": [ + "ex/HEAD/describe.html#git_describe_format_options_init-2" + ] + } + }, "git_describe_commit": { "type": "function", - "file": "describe.h", - "line": 123, - "lineto": 126, + "file": "git2/describe.h", + "line": 146, + "lineto": 149, "args": [ { "name": "result", @@ -5722,7 +6182,7 @@ { "name": "opts", "type": "git_describe_options *", - "comment": "the lookup options" + "comment": "the lookup options (or NULL for defaults)" } ], "argline": "git_describe_result **result, git_object *committish, git_describe_options *opts", @@ -5736,15 +6196,15 @@ "group": "describe", "examples": { "describe.c": [ - "ex/HEAD/describe.html#git_describe_commit-1" + "ex/HEAD/describe.html#git_describe_commit-3" ] } }, "git_describe_workdir": { "type": "function", - "file": "describe.h", - "line": 140, - "lineto": 143, + "file": "git2/describe.h", + "line": 163, + "lineto": 166, "args": [ { "name": "out", @@ -5759,7 +6219,7 @@ { "name": "opts", "type": "git_describe_options *", - "comment": "the lookup options" + "comment": "the lookup options (or NULL for defaults)" } ], "argline": "git_describe_result **out, git_repository *repo, git_describe_options *opts", @@ -5773,15 +6233,15 @@ "group": "describe", "examples": { "describe.c": [ - "ex/HEAD/describe.html#git_describe_workdir-2" + "ex/HEAD/describe.html#git_describe_workdir-4" ] } }, "git_describe_format": { "type": "function", - "file": "describe.h", - "line": 153, - "lineto": 156, + "file": "git2/describe.h", + "line": 176, + "lineto": 179, "args": [ { "name": "out", @@ -5796,7 +6256,7 @@ { "name": "opts", "type": "const git_describe_format_options *", - "comment": "the formatting options" + "comment": "the formatting options (or NULL for defaults)" } ], "argline": "git_buf *out, const git_describe_result *result, const git_describe_format_options *opts", @@ -5810,15 +6270,15 @@ "group": "describe", "examples": { "describe.c": [ - "ex/HEAD/describe.html#git_describe_format-3" + "ex/HEAD/describe.html#git_describe_format-5" ] } }, "git_describe_result_free": { "type": "function", - "file": "describe.h", - "line": 161, - "lineto": 161, + "file": "git2/describe.h", + "line": 184, + "lineto": 184, "args": [ { "name": "result", @@ -5836,21 +6296,21 @@ "comments": "", "group": "describe" }, - "git_diff_init_options": { + "git_diff_options_init": { "type": "function", - "file": "diff.h", - "line": 447, - "lineto": 449, + "file": "git2/diff.h", + "line": 454, + "lineto": 456, "args": [ { "name": "opts", "type": "git_diff_options *", - "comment": "The `git_diff_options` struct to initialize" + "comment": "The `git_diff_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_DIFF_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_DIFF_OPTIONS_VERSION`." } ], "argline": "git_diff_options *opts, unsigned int version", @@ -5859,25 +6319,25 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_diff_options with default values. Equivalent to\n creating an instance with GIT_DIFF_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_diff_options structure

\n", + "comments": "

Initializes a git_diff_options with default values. Equivalent to creating an instance with GIT_DIFF_OPTIONS_INIT.

\n", "group": "diff" }, - "git_diff_find_init_options": { + "git_diff_find_options_init": { "type": "function", - "file": "diff.h", - "line": 742, - "lineto": 744, + "file": "git2/diff.h", + "line": 787, + "lineto": 789, "args": [ { "name": "opts", "type": "git_diff_find_options *", - "comment": "The `git_diff_find_options` struct to initialize" + "comment": "The `git_diff_find_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_DIFF_FIND_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_DIFF_FIND_OPTIONS_VERSION`." } ], "argline": "git_diff_find_options *opts, unsigned int version", @@ -5886,15 +6346,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_diff_find_options with default values. Equivalent to\n creating an instance with GIT_DIFF_FIND_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_diff_find_options structure

\n", + "comments": "

Initializes a git_diff_find_options with default values. Equivalent to creating an instance with GIT_DIFF_FIND_OPTIONS_INIT.

\n", "group": "diff" }, "git_diff_free": { "type": "function", - "file": "diff.h", - "line": 758, - "lineto": 758, + "file": "git2/diff.h", + "line": 803, + "lineto": 803, "args": [ { "name": "diff", @@ -5923,9 +6383,9 @@ }, "git_diff_tree_to_tree": { "type": "function", - "file": "diff.h", - "line": 776, - "lineto": 781, + "file": "git2/diff.h", + "line": 821, + "lineto": 826, "args": [ { "name": "diff", @@ -5974,9 +6434,9 @@ }, "git_diff_tree_to_index": { "type": "function", - "file": "diff.h", - "line": 802, - "lineto": 807, + "file": "git2/diff.h", + "line": 847, + "lineto": 852, "args": [ { "name": "diff", @@ -6021,9 +6481,9 @@ }, "git_diff_index_to_workdir": { "type": "function", - "file": "diff.h", - "line": 829, - "lineto": 833, + "file": "git2/diff.h", + "line": 874, + "lineto": 878, "args": [ { "name": "diff", @@ -6063,9 +6523,9 @@ }, "git_diff_tree_to_workdir": { "type": "function", - "file": "diff.h", - "line": 858, - "lineto": 862, + "file": "git2/diff.h", + "line": 903, + "lineto": 907, "args": [ { "name": "diff", @@ -6105,9 +6565,9 @@ }, "git_diff_tree_to_workdir_with_index": { "type": "function", - "file": "diff.h", - "line": 877, - "lineto": 881, + "file": "git2/diff.h", + "line": 922, + "lineto": 926, "args": [ { "name": "diff", @@ -6147,9 +6607,9 @@ }, "git_diff_index_to_index": { "type": "function", - "file": "diff.h", - "line": 895, - "lineto": 900, + "file": "git2/diff.h", + "line": 940, + "lineto": 945, "args": [ { "name": "diff", @@ -6189,9 +6649,9 @@ }, "git_diff_merge": { "type": "function", - "file": "diff.h", - "line": 915, - "lineto": 917, + "file": "git2/diff.h", + "line": 960, + "lineto": 962, "args": [ { "name": "onto", @@ -6216,9 +6676,9 @@ }, "git_diff_find_similar": { "type": "function", - "file": "diff.h", - "line": 931, - "lineto": 933, + "file": "git2/diff.h", + "line": 976, + "lineto": 978, "args": [ { "name": "diff", @@ -6248,9 +6708,9 @@ }, "git_diff_num_deltas": { "type": "function", - "file": "diff.h", - "line": 951, - "lineto": 951, + "file": "git2/diff.h", + "line": 996, + "lineto": 996, "args": [ { "name": "diff", @@ -6275,9 +6735,9 @@ }, "git_diff_num_deltas_of_type": { "type": "function", - "file": "diff.h", - "line": 964, - "lineto": 965, + "file": "git2/diff.h", + "line": 1009, + "lineto": 1010, "args": [ { "name": "diff", @@ -6302,9 +6762,9 @@ }, "git_diff_get_delta": { "type": "function", - "file": "diff.h", - "line": 984, - "lineto": 985, + "file": "git2/diff.h", + "line": 1029, + "lineto": 1030, "args": [ { "name": "diff", @@ -6329,9 +6789,9 @@ }, "git_diff_is_sorted_icase": { "type": "function", - "file": "diff.h", - "line": 993, - "lineto": 993, + "file": "git2/diff.h", + "line": 1038, + "lineto": 1038, "args": [ { "name": "diff", @@ -6351,9 +6811,9 @@ }, "git_diff_foreach": { "type": "function", - "file": "diff.h", - "line": 1021, - "lineto": 1027, + "file": "git2/diff.h", + "line": 1066, + "lineto": 1072, "args": [ { "name": "diff", @@ -6398,9 +6858,9 @@ }, "git_diff_status_char": { "type": "function", - "file": "diff.h", - "line": 1040, - "lineto": 1040, + "file": "git2/diff.h", + "line": 1085, + "lineto": 1085, "args": [ { "name": "status", @@ -6420,9 +6880,9 @@ }, "git_diff_print": { "type": "function", - "file": "diff.h", - "line": 1065, - "lineto": 1069, + "file": "git2/diff.h", + "line": 1110, + "lineto": 1114, "args": [ { "name": "diff", @@ -6465,9 +6925,9 @@ }, "git_diff_to_buf": { "type": "function", - "file": "diff.h", - "line": 1081, - "lineto": 1084, + "file": "git2/diff.h", + "line": 1126, + "lineto": 1129, "args": [ { "name": "out", @@ -6497,9 +6957,9 @@ }, "git_diff_blobs": { "type": "function", - "file": "diff.h", - "line": 1121, - "lineto": 1131, + "file": "git2/diff.h", + "line": 1166, + "lineto": 1176, "args": [ { "name": "old_blob", @@ -6564,9 +7024,9 @@ }, "git_diff_blob_to_buffer": { "type": "function", - "file": "diff.h", - "line": 1158, - "lineto": 1169, + "file": "git2/diff.h", + "line": 1203, + "lineto": 1214, "args": [ { "name": "old_blob", @@ -6636,9 +7096,9 @@ }, "git_diff_buffers": { "type": "function", - "file": "diff.h", - "line": 1192, - "lineto": 1204, + "file": "git2/diff.h", + "line": 1237, + "lineto": 1249, "args": [ { "name": "old_buffer", @@ -6713,9 +7173,9 @@ }, "git_diff_from_buffer": { "type": "function", - "file": "diff.h", - "line": 1225, - "lineto": 1228, + "file": "git2/diff.h", + "line": 1270, + "lineto": 1273, "args": [ { "name": "out", @@ -6745,9 +7205,9 @@ }, "git_diff_get_stats": { "type": "function", - "file": "diff.h", - "line": 1264, - "lineto": 1266, + "file": "git2/diff.h", + "line": 1309, + "lineto": 1311, "args": [ { "name": "out", @@ -6777,9 +7237,9 @@ }, "git_diff_stats_files_changed": { "type": "function", - "file": "diff.h", - "line": 1274, - "lineto": 1275, + "file": "git2/diff.h", + "line": 1319, + "lineto": 1320, "args": [ { "name": "stats", @@ -6799,9 +7259,9 @@ }, "git_diff_stats_insertions": { "type": "function", - "file": "diff.h", - "line": 1283, - "lineto": 1284, + "file": "git2/diff.h", + "line": 1328, + "lineto": 1329, "args": [ { "name": "stats", @@ -6821,9 +7281,9 @@ }, "git_diff_stats_deletions": { "type": "function", - "file": "diff.h", - "line": 1292, - "lineto": 1293, + "file": "git2/diff.h", + "line": 1337, + "lineto": 1338, "args": [ { "name": "stats", @@ -6843,9 +7303,9 @@ }, "git_diff_stats_to_buf": { "type": "function", - "file": "diff.h", - "line": 1304, - "lineto": 1308, + "file": "git2/diff.h", + "line": 1349, + "lineto": 1353, "args": [ { "name": "out", @@ -6885,9 +7345,9 @@ }, "git_diff_stats_free": { "type": "function", - "file": "diff.h", - "line": 1316, - "lineto": 1316, + "file": "git2/diff.h", + "line": 1361, + "lineto": 1361, "args": [ { "name": "stats", @@ -6912,9 +7372,9 @@ }, "git_diff_format_email": { "type": "function", - "file": "diff.h", - "line": 1368, - "lineto": 1371, + "file": "git2/diff.h", + "line": 1413, + "lineto": 1416, "args": [ { "name": "out", @@ -6944,9 +7404,9 @@ }, "git_diff_commit_as_email": { "type": "function", - "file": "diff.h", - "line": 1387, - "lineto": 1394, + "file": "git2/diff.h", + "line": 1432, + "lineto": 1439, "args": [ { "name": "out", @@ -6994,21 +7454,21 @@ "comments": "

Does not support creating patches for merge commits (yet).

\n", "group": "diff" }, - "git_diff_format_email_init_options": { + "git_diff_format_email_options_init": { "type": "function", - "file": "diff.h", - "line": 1405, - "lineto": 1407, + "file": "git2/diff.h", + "line": 1451, + "lineto": 1453, "args": [ { "name": "opts", "type": "git_diff_format_email_options *", - "comment": "The `git_diff_format_email_options` struct to initialize" + "comment": "The `git_blame_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`." } ], "argline": "git_diff_format_email_options *opts, unsigned int version", @@ -7017,47 +7477,47 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_diff_format_email_options with default values.

\n", - "comments": "

Equivalent to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.

\n", + "description": "

Initialize git_diff_format_email_options structure

\n", + "comments": "

Initializes a git_diff_format_email_options with default values. Equivalent to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.

\n", "group": "diff" }, - "git_diff_patchid_init_options": { + "git_diff_patchid_options_init": { "type": "function", - "file": "diff.h", - "line": 1428, - "lineto": 1430, + "file": "git2/diff.h", + "line": 1479, + "lineto": 1481, "args": [ { "name": "opts", "type": "git_diff_patchid_options *", - "comment": null + "comment": "The `git_diff_patchid_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": null + "comment": "The struct version; pass `GIT_DIFF_PATCHID_OPTIONS_VERSION`." } ], "argline": "git_diff_patchid_options *opts, unsigned int version", "sig": "git_diff_patchid_options *::unsigned int", "return": { "type": "int", - "comment": null + "comment": " Zero on success; -1 on failure." }, - "description": "

Initialize git_diff_patchid_options structure.

\n", - "comments": "

Initializes the structure with default values. Equivalent to creating an instance with GIT_DIFF_PATCHID_OPTIONS_INIT.

\n", + "description": "

Initialize git_diff_patchid_options structure

\n", + "comments": "

Initializes a git_diff_patchid_options with default values. Equivalent to creating an instance with GIT_DIFF_PATCHID_OPTIONS_INIT.

\n", "group": "diff" }, "git_diff_patchid": { "type": "function", - "file": "diff.h", - "line": 1452, - "lineto": 1452, + "file": "git2/diff.h", + "line": 1502, + "lineto": 1502, "args": [ { "name": "out", "type": "git_oid *", - "comment": "Pointer where the calculated patch ID shoul be\n stored" + "comment": "Pointer where the calculated patch ID should be stored" }, { "name": "diff", @@ -7080,11 +7540,11 @@ "comments": "

Calculate a stable patch ID for the given patch by summing the hash of the file diffs, ignoring whitespace and line numbers. This can be used to derive whether two diffs are the same with a high probability.

\n\n

Currently, this function only calculates stable patch IDs, as defined in git-patch-id(1), and should in fact generate the same IDs as the upstream git project does.

\n", "group": "diff" }, - "giterr_last": { + "git_error_last": { "type": "function", - "file": "errors.h", - "line": 115, - "lineto": 115, + "file": "git2/errors.h", + "line": 123, + "lineto": 123, "args": [], "argline": "", "sig": "", @@ -7092,27 +7552,30 @@ "type": "const git_error *", "comment": " A git_error object." }, - "description": "

Return the last git_error object that was generated for the\n current thread or NULL if no error has occurred.

\n", - "comments": "", - "group": "giterr", + "description": "

Return the last git_error object that was generated for the\n current thread.

\n", + "comments": "

The default behaviour of this function is to return NULL if no previous error has occurred. However, libgit2's error strings are not cleared aggressively, so a prior (unrelated) error may be returned. This can be avoided by only calling this function if the prior call to a libgit2 API returned an error.

\n", + "group": "error", "examples": { + "checkout.c": [ + "ex/HEAD/checkout.html#git_error_last-8", + "ex/HEAD/checkout.html#git_error_last-9", + "ex/HEAD/checkout.html#git_error_last-10", + "ex/HEAD/checkout.html#git_error_last-11" + ], "general.c": [ - "ex/HEAD/general.html#giterr_last-33" + "ex/HEAD/general.html#git_error_last-33" ], "merge.c": [ - "ex/HEAD/merge.html#giterr_last-10", - "ex/HEAD/merge.html#giterr_last-11" - ], - "network/clone.c": [ - "ex/HEAD/network/clone.html#giterr_last-2" + "ex/HEAD/merge.html#git_error_last-8", + "ex/HEAD/merge.html#git_error_last-9" ] } }, - "giterr_clear": { + "git_error_clear": { "type": "function", - "file": "errors.h", - "line": 120, - "lineto": 120, + "file": "git2/errors.h", + "line": 128, + "lineto": 128, "args": [], "argline": "", "sig": "", @@ -7122,13 +7585,13 @@ }, "description": "

Clear the last library error that occurred for this thread.

\n", "comments": "", - "group": "giterr" + "group": "error" }, - "giterr_set_str": { + "git_error_set_str": { "type": "function", - "file": "errors.h", - "line": 138, - "lineto": 138, + "file": "git2/errors.h", + "line": 146, + "lineto": 146, "args": [ { "name": "error_class", @@ -7149,13 +7612,13 @@ }, "description": "

Set the error message string for this thread.

\n", "comments": "

This function is public so that custom ODB backends and the like can relay an error message through libgit2. Most regular users of libgit2 will never need to call this function -- actually, calling it in most circumstances (for example, calling from within a callback function) will just end up having the value overwritten by libgit2 internals.

\n\n

This error message is stored in thread-local storage and only applies to the particular thread that this libgit2 call is made from.

\n", - "group": "giterr" + "group": "error" }, - "giterr_set_oom": { + "git_error_set_oom": { "type": "function", - "file": "errors.h", - "line": 149, - "lineto": 149, + "file": "git2/errors.h", + "line": 157, + "lineto": 157, "args": [], "argline": "", "sig": "", @@ -7164,12 +7627,12 @@ "comment": null }, "description": "

Set the error message to a special value for memory allocation failure.

\n", - "comments": "

The normal giterr_set_str() function attempts to strdup() the string that is passed in. This is not a good idea when the error in question is a memory allocation failure. That circumstance has a special setter function that sets the error string to a known and statically allocated internal value.

\n", - "group": "giterr" + "comments": "

The normal git_error_set_str() function attempts to strdup() the string that is passed in. This is not a good idea when the error in question is a memory allocation failure. That circumstance has a special setter function that sets the error string to a known and statically allocated internal value.

\n", + "group": "error" }, "git_filter_list_load": { "type": "function", - "file": "filter.h", + "file": "git2/filter.h", "line": 90, "lineto": 96, "args": [ @@ -7216,7 +7679,7 @@ }, "git_filter_list_contains": { "type": "function", - "file": "filter.h", + "file": "git2/filter.h", "line": 110, "lineto": 112, "args": [ @@ -7243,7 +7706,7 @@ }, "git_filter_list_apply_to_data": { "type": "function", - "file": "filter.h", + "file": "git2/filter.h", "line": 134, "lineto": 137, "args": [ @@ -7275,7 +7738,7 @@ }, "git_filter_list_apply_to_file": { "type": "function", - "file": "filter.h", + "file": "git2/filter.h", "line": 148, "lineto": 152, "args": [ @@ -7312,7 +7775,7 @@ }, "git_filter_list_apply_to_blob": { "type": "function", - "file": "filter.h", + "file": "git2/filter.h", "line": 161, "lineto": 164, "args": [ @@ -7344,7 +7807,7 @@ }, "git_filter_list_stream_data": { "type": "function", - "file": "filter.h", + "file": "git2/filter.h", "line": 173, "lineto": 176, "args": [ @@ -7376,7 +7839,7 @@ }, "git_filter_list_stream_file": { "type": "function", - "file": "filter.h", + "file": "git2/filter.h", "line": 187, "lineto": 191, "args": [ @@ -7413,7 +7876,7 @@ }, "git_filter_list_stream_blob": { "type": "function", - "file": "filter.h", + "file": "git2/filter.h", "line": 200, "lineto": 203, "args": [ @@ -7445,7 +7908,7 @@ }, "git_filter_list_free": { "type": "function", - "file": "filter.h", + "file": "git2/filter.h", "line": 210, "lineto": 210, "args": [ @@ -7467,7 +7930,7 @@ }, "git_libgit2_init": { "type": "function", - "file": "global.h", + "file": "git2/global.h", "line": 26, "lineto": 26, "args": [], @@ -7481,47 +7944,14 @@ "comments": "

This function must be called before any other libgit2 function in order to set up global state and threading.

\n\n

This function may be called multiple times - it will return the number of times the initialization has been called (including this one) that have not subsequently been shutdown.

\n", "group": "libgit2", "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_libgit2_init-8" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_libgit2_init-10" - ], - "describe.c": [ - "ex/HEAD/describe.html#git_libgit2_init-4" - ], - "diff.c": [ - "ex/HEAD/diff.html#git_libgit2_init-13" - ], "general.c": [ "ex/HEAD/general.html#git_libgit2_init-34" - ], - "init.c": [ - "ex/HEAD/init.html#git_libgit2_init-2" - ], - "log.c": [ - "ex/HEAD/log.html#git_libgit2_init-31" - ], - "merge.c": [ - "ex/HEAD/merge.html#git_libgit2_init-12" - ], - "remote.c": [ - "ex/HEAD/remote.html#git_libgit2_init-2" - ], - "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_libgit2_init-1" - ], - "status.c": [ - "ex/HEAD/status.html#git_libgit2_init-1" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_libgit2_init-3" ] } }, "git_libgit2_shutdown": { "type": "function", - "file": "global.h", + "file": "git2/global.h", "line": 39, "lineto": 39, "args": [], @@ -7533,46 +7963,11 @@ }, "description": "

Shutdown the global state

\n", "comments": "

Clean up the global state and threading context after calling it as many times as git_libgit2_init() was called - it will return the number of remainining initializations that have not been shutdown (after this one).

\n", - "group": "libgit2", - "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_libgit2_shutdown-9" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_libgit2_shutdown-11" - ], - "describe.c": [ - "ex/HEAD/describe.html#git_libgit2_shutdown-5" - ], - "diff.c": [ - "ex/HEAD/diff.html#git_libgit2_shutdown-14" - ], - "init.c": [ - "ex/HEAD/init.html#git_libgit2_shutdown-3" - ], - "log.c": [ - "ex/HEAD/log.html#git_libgit2_shutdown-32" - ], - "merge.c": [ - "ex/HEAD/merge.html#git_libgit2_shutdown-13" - ], - "remote.c": [ - "ex/HEAD/remote.html#git_libgit2_shutdown-3" - ], - "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_libgit2_shutdown-2" - ], - "status.c": [ - "ex/HEAD/status.html#git_libgit2_shutdown-2" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_libgit2_shutdown-4" - ] - } + "group": "libgit2" }, "git_graph_ahead_behind": { "type": "function", - "file": "graph.h", + "file": "git2/graph.h", "line": 37, "lineto": 37, "args": [ @@ -7614,7 +8009,7 @@ }, "git_graph_descendant_of": { "type": "function", - "file": "graph.h", + "file": "git2/graph.h", "line": 51, "lineto": 54, "args": [ @@ -7646,7 +8041,7 @@ }, "git_ignore_add_rule": { "type": "function", - "file": "ignore.h", + "file": "git2/ignore.h", "line": 37, "lineto": 39, "args": [ @@ -7673,7 +8068,7 @@ }, "git_ignore_clear_internal_rules": { "type": "function", - "file": "ignore.h", + "file": "git2/ignore.h", "line": 52, "lineto": 53, "args": [ @@ -7695,7 +8090,7 @@ }, "git_ignore_path_is_ignored": { "type": "function", - "file": "ignore.h", + "file": "git2/ignore.h", "line": 71, "lineto": 74, "args": [ @@ -7722,14 +8117,14 @@ "comment": " 0 if ignore rules could be processed for the file (regardless\n of whether it exists or not), or an error \n<\n 0 if they could not." }, "description": "

Test if the ignore rules apply to a given path.

\n", - "comments": "

This function checks the ignore rules to see if they would apply to the given file. This indicates if the file would be ignored regardless of whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the directory containing the file, would it be added or not?

\n", + "comments": "

This function checks the ignore rules to see if they would apply to the given file. This indicates if the file would be ignored regardless of whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git check-ignore --no-index" on the given file, would it be shown or not?

\n", "group": "ignore" }, "git_index_open": { "type": "function", - "file": "index.h", - "line": 203, - "lineto": 203, + "file": "git2/index.h", + "line": 187, + "lineto": 187, "args": [ { "name": "out", @@ -7754,9 +8149,9 @@ }, "git_index_new": { "type": "function", - "file": "index.h", - "line": 216, - "lineto": 216, + "file": "git2/index.h", + "line": 200, + "lineto": 200, "args": [ { "name": "out", @@ -7776,9 +8171,9 @@ }, "git_index_free": { "type": "function", - "file": "index.h", - "line": 223, - "lineto": 223, + "file": "git2/index.h", + "line": 207, + "lineto": 207, "args": [ { "name": "index", @@ -7796,19 +8191,25 @@ "comments": "", "group": "index", "examples": { + "add.c": [ + "ex/HEAD/add.html#git_index_free-1" + ], "general.c": [ "ex/HEAD/general.html#git_index_free-35" ], "init.c": [ - "ex/HEAD/init.html#git_index_free-4" + "ex/HEAD/init.html#git_index_free-2" + ], + "ls-files.c": [ + "ex/HEAD/ls-files.html#git_index_free-1" ] } }, "git_index_owner": { "type": "function", - "file": "index.h", - "line": 231, - "lineto": 231, + "file": "git2/index.h", + "line": 215, + "lineto": 215, "args": [ { "name": "index", @@ -7828,9 +8229,9 @@ }, "git_index_caps": { "type": "function", - "file": "index.h", - "line": 239, - "lineto": 239, + "file": "git2/index.h", + "line": 223, + "lineto": 223, "args": [ { "name": "index", @@ -7842,7 +8243,7 @@ "sig": "const git_index *", "return": { "type": "int", - "comment": " A combination of GIT_INDEXCAP values" + "comment": " A combination of GIT_INDEX_CAPABILITY values" }, "description": "

Read index capabilities flags.

\n", "comments": "", @@ -7850,9 +8251,9 @@ }, "git_index_set_caps": { "type": "function", - "file": "index.h", - "line": 252, - "lineto": 252, + "file": "git2/index.h", + "line": 236, + "lineto": 236, "args": [ { "name": "index", @@ -7862,7 +8263,7 @@ { "name": "caps", "type": "int", - "comment": "A combination of GIT_INDEXCAP values" + "comment": "A combination of GIT_INDEX_CAPABILITY values" } ], "argline": "git_index *index, int caps", @@ -7872,14 +8273,14 @@ "comment": " 0 on success, -1 on failure" }, "description": "

Set index capabilities flags.

\n", - "comments": "

If you pass GIT_INDEXCAP_FROM_OWNER for the caps, then the capabilities will be read from the config of the owner object, looking at core.ignorecase, core.filemode, core.symlinks.

\n", + "comments": "

If you pass GIT_INDEX_CAPABILITY_FROM_OWNER for the caps, then capabilities will be read from the config of the owner object, looking at core.ignorecase, core.filemode, core.symlinks.

\n", "group": "index" }, "git_index_version": { "type": "function", - "file": "index.h", - "line": 264, - "lineto": 264, + "file": "git2/index.h", + "line": 248, + "lineto": 248, "args": [ { "name": "index", @@ -7899,9 +8300,9 @@ }, "git_index_set_version": { "type": "function", - "file": "index.h", - "line": 277, - "lineto": 277, + "file": "git2/index.h", + "line": 261, + "lineto": 261, "args": [ { "name": "index", @@ -7926,9 +8327,9 @@ }, "git_index_read": { "type": "function", - "file": "index.h", - "line": 296, - "lineto": 296, + "file": "git2/index.h", + "line": 280, + "lineto": 280, "args": [ { "name": "index", @@ -7953,9 +8354,9 @@ }, "git_index_write": { "type": "function", - "file": "index.h", - "line": 305, - "lineto": 305, + "file": "git2/index.h", + "line": 289, + "lineto": 289, "args": [ { "name": "index", @@ -7971,13 +8372,18 @@ }, "description": "

Write an existing index object from memory back to disk\n using an atomic file lock.

\n", "comments": "", - "group": "index" + "group": "index", + "examples": { + "add.c": [ + "ex/HEAD/add.html#git_index_write-2" + ] + } }, "git_index_path": { "type": "function", - "file": "index.h", - "line": 313, - "lineto": 313, + "file": "git2/index.h", + "line": 297, + "lineto": 297, "args": [ { "name": "index", @@ -7997,9 +8403,9 @@ }, "git_index_checksum": { "type": "function", - "file": "index.h", - "line": 325, - "lineto": 325, + "file": "git2/index.h", + "line": 309, + "lineto": 309, "args": [ { "name": "index", @@ -8019,9 +8425,9 @@ }, "git_index_read_tree": { "type": "function", - "file": "index.h", - "line": 336, - "lineto": 336, + "file": "git2/index.h", + "line": 320, + "lineto": 320, "args": [ { "name": "index", @@ -8046,9 +8452,9 @@ }, "git_index_write_tree": { "type": "function", - "file": "index.h", - "line": 357, - "lineto": 357, + "file": "git2/index.h", + "line": 341, + "lineto": 341, "args": [ { "name": "out", @@ -8072,18 +8478,18 @@ "group": "index", "examples": { "init.c": [ - "ex/HEAD/init.html#git_index_write_tree-5" + "ex/HEAD/init.html#git_index_write_tree-3" ], "merge.c": [ - "ex/HEAD/merge.html#git_index_write_tree-14" + "ex/HEAD/merge.html#git_index_write_tree-10" ] } }, "git_index_write_tree_to": { "type": "function", - "file": "index.h", - "line": 374, - "lineto": 374, + "file": "git2/index.h", + "line": 358, + "lineto": 358, "args": [ { "name": "out", @@ -8113,9 +8519,9 @@ }, "git_index_entrycount": { "type": "function", - "file": "index.h", - "line": 393, - "lineto": 393, + "file": "git2/index.h", + "line": 377, + "lineto": 377, "args": [ { "name": "index", @@ -8135,14 +8541,17 @@ "examples": { "general.c": [ "ex/HEAD/general.html#git_index_entrycount-36" + ], + "ls-files.c": [ + "ex/HEAD/ls-files.html#git_index_entrycount-2" ] } }, "git_index_clear": { "type": "function", - "file": "index.h", - "line": 404, - "lineto": 404, + "file": "git2/index.h", + "line": 388, + "lineto": 388, "args": [ { "name": "index", @@ -8162,9 +8571,9 @@ }, "git_index_get_byindex": { "type": "function", - "file": "index.h", - "line": 417, - "lineto": 418, + "file": "git2/index.h", + "line": 401, + "lineto": 402, "args": [ { "name": "index", @@ -8189,14 +8598,17 @@ "examples": { "general.c": [ "ex/HEAD/general.html#git_index_get_byindex-37" + ], + "ls-files.c": [ + "ex/HEAD/ls-files.html#git_index_get_byindex-3" ] } }, "git_index_get_bypath": { "type": "function", - "file": "index.h", - "line": 432, - "lineto": 433, + "file": "git2/index.h", + "line": 416, + "lineto": 417, "args": [ { "name": "index", @@ -8222,13 +8634,18 @@ }, "description": "

Get a pointer to one of the entries in the index

\n", "comments": "

The entry is not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

\n", - "group": "index" + "group": "index", + "examples": { + "ls-files.c": [ + "ex/HEAD/ls-files.html#git_index_get_bypath-4" + ] + } }, "git_index_remove": { "type": "function", - "file": "index.h", - "line": 443, - "lineto": 443, + "file": "git2/index.h", + "line": 427, + "lineto": 427, "args": [ { "name": "index", @@ -8258,9 +8675,9 @@ }, "git_index_remove_directory": { "type": "function", - "file": "index.h", - "line": 453, - "lineto": 454, + "file": "git2/index.h", + "line": 437, + "lineto": 438, "args": [ { "name": "index", @@ -8290,9 +8707,9 @@ }, "git_index_add": { "type": "function", - "file": "index.h", - "line": 470, - "lineto": 470, + "file": "git2/index.h", + "line": 454, + "lineto": 454, "args": [ { "name": "index", @@ -8317,9 +8734,9 @@ }, "git_index_entry_stage": { "type": "function", - "file": "index.h", - "line": 482, - "lineto": 482, + "file": "git2/index.h", + "line": 466, + "lineto": 466, "args": [ { "name": "entry", @@ -8334,14 +8751,14 @@ "comment": " the stage number" }, "description": "

Return the stage number from a git index entry

\n", - "comments": "

This entry is calculated from the entry's flag attribute like this:

\n\n
(entry->flags & GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT\n
\n", + "comments": "

This entry is calculated from the entry's flag attribute like this:

\n\n
(entry->flags & GIT_INDEX_ENTRY_STAGEMASK) >> GIT_INDEX_ENTRY_STAGESHIFT\n
\n", "group": "index" }, "git_index_entry_is_conflict": { "type": "function", - "file": "index.h", - "line": 491, - "lineto": 491, + "file": "git2/index.h", + "line": 475, + "lineto": 475, "args": [ { "name": "entry", @@ -8359,11 +8776,87 @@ "comments": "", "group": "index" }, + "git_index_iterator_new": { + "type": "function", + "file": "git2/index.h", + "line": 495, + "lineto": 497, + "args": [ + { + "name": "iterator_out", + "type": "git_index_iterator **", + "comment": "The newly created iterator" + }, + { + "name": "index", + "type": "git_index *", + "comment": "The index to iterate" + } + ], + "argline": "git_index_iterator **iterator_out, git_index *index", + "sig": "git_index_iterator **::git_index *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create an iterator that will return every entry contained in the\n index at the time of creation. Entries are returned in order,\n sorted by path. This iterator is backed by a snapshot that allows\n callers to modify the index while iterating without affecting the\n iterator.

\n", + "comments": "", + "group": "index" + }, + "git_index_iterator_next": { + "type": "function", + "file": "git2/index.h", + "line": 506, + "lineto": 508, + "args": [ + { + "name": "out", + "type": "const git_index_entry **", + "comment": "Pointer to store the index entry in" + }, + { + "name": "iterator", + "type": "git_index_iterator *", + "comment": "The iterator" + } + ], + "argline": "const git_index_entry **out, git_index_iterator *iterator", + "sig": "const git_index_entry **::git_index_iterator *", + "return": { + "type": "int", + "comment": " 0, GIT_ITEROVER on iteration completion or an error code" + }, + "description": "

Return the next index entry in-order from the iterator.

\n", + "comments": "", + "group": "index" + }, + "git_index_iterator_free": { + "type": "function", + "file": "git2/index.h", + "line": 515, + "lineto": 515, + "args": [ + { + "name": "iterator", + "type": "git_index_iterator *", + "comment": "The iterator to free" + } + ], + "argline": "git_index_iterator *iterator", + "sig": "git_index_iterator *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the index iterator

\n", + "comments": "", + "group": "index" + }, "git_index_add_bypath": { "type": "function", - "file": "index.h", - "line": 522, - "lineto": 522, + "file": "git2/index.h", + "line": 546, + "lineto": 546, "args": [ { "name": "index", @@ -8386,11 +8879,11 @@ "comments": "

The file path must be relative to the repository's working folder and must be readable.

\n\n

This method will fail in bare index instances.

\n\n

This forces the file to be added to the index, not looking at gitignore rules. Those rules can be evaluated through the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

\n", "group": "index" }, - "git_index_add_frombuffer": { + "git_index_add_from_buffer": { "type": "function", - "file": "index.h", - "line": 551, - "lineto": 554, + "file": "git2/index.h", + "line": 575, + "lineto": 578, "args": [ { "name": "index", @@ -8425,9 +8918,9 @@ }, "git_index_remove_bypath": { "type": "function", - "file": "index.h", - "line": 570, - "lineto": 570, + "file": "git2/index.h", + "line": 594, + "lineto": 594, "args": [ { "name": "index", @@ -8452,9 +8945,9 @@ }, "git_index_add_all": { "type": "function", - "file": "index.h", - "line": 618, - "lineto": 623, + "file": "git2/index.h", + "line": 642, + "lineto": 647, "args": [ { "name": "index", @@ -8490,13 +8983,18 @@ }, "description": "

Add or update index entries matching files in the working directory.

\n", "comments": "

This method will fail in bare index instances.

\n\n

The pathspec is a list of file names or shell glob patterns that will be matched against files in the repository's working directory. Each file that matches will be added to the index (either updating an existing entry or adding a new entry). You can disable glob expansion and force exact matching with the GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH flag.

\n\n

Files that are ignored will be skipped (unlike git_index_add_bypath). If a file is already tracked in the index, then it will be updated even if it is ignored. Pass the GIT_INDEX_ADD_FORCE flag to skip the checking of ignore rules.

\n\n

To emulate git add -A and generate an error if the pathspec contains the exact path of an ignored file (when not using FORCE), add the GIT_INDEX_ADD_CHECK_PATHSPEC flag. This checks that each entry in the pathspec that is an exact match to a filename on disk is either not ignored or already in the index. If this check fails, the function will return GIT_EINVALIDSPEC.

\n\n

To emulate git add -A with the "dry-run" option, just use a callback function that always returns a positive value. See below for details.

\n\n

If any files are currently the result of a merge conflict, those files will no longer be marked as conflicting. The data about the conflicts will be moved to the "resolve undo" (REUC) section.

\n\n

If you provide a callback function, it will be invoked on each matching item in the working directory immediately before it is added to / updated in the index. Returning zero will add the item to the index, greater than zero will skip the item, and less than zero will abort the scan and return that value to the caller.

\n", - "group": "index" + "group": "index", + "examples": { + "add.c": [ + "ex/HEAD/add.html#git_index_add_all-3" + ] + } }, "git_index_remove_all": { "type": "function", - "file": "index.h", - "line": 640, - "lineto": 644, + "file": "git2/index.h", + "line": 664, + "lineto": 668, "args": [ { "name": "index", @@ -8531,9 +9029,9 @@ }, "git_index_update_all": { "type": "function", - "file": "index.h", - "line": 669, - "lineto": 673, + "file": "git2/index.h", + "line": 693, + "lineto": 697, "args": [ { "name": "index", @@ -8564,13 +9062,18 @@ }, "description": "

Update all index entries to match the working directory

\n", "comments": "

This method will fail in bare index instances.

\n\n

This scans the existing index entries and synchronizes them with the working directory, deleting them if the corresponding working directory file no longer exists otherwise updating the information (including adding the latest version of file to the ODB if needed).

\n\n

If you provide a callback function, it will be invoked on each matching item in the index immediately before it is updated (either refreshed or removed depending on working directory state). Return 0 to proceed with updating the item, > 0 to skip the item, and < 0 to abort the scan.

\n", - "group": "index" + "group": "index", + "examples": { + "add.c": [ + "ex/HEAD/add.html#git_index_update_all-4" + ] + } }, "git_index_find": { "type": "function", - "file": "index.h", - "line": 684, - "lineto": 684, + "file": "git2/index.h", + "line": 708, + "lineto": 708, "args": [ { "name": "at_pos", @@ -8600,9 +9103,9 @@ }, "git_index_find_prefix": { "type": "function", - "file": "index.h", - "line": 695, - "lineto": 695, + "file": "git2/index.h", + "line": 719, + "lineto": 719, "args": [ { "name": "at_pos", @@ -8632,9 +9135,9 @@ }, "git_index_conflict_add": { "type": "function", - "file": "index.h", - "line": 720, - "lineto": 724, + "file": "git2/index.h", + "line": 744, + "lineto": 748, "args": [ { "name": "index", @@ -8669,9 +9172,9 @@ }, "git_index_conflict_get": { "type": "function", - "file": "index.h", - "line": 740, - "lineto": 745, + "file": "git2/index.h", + "line": 764, + "lineto": 769, "args": [ { "name": "ancestor_out", @@ -8711,9 +9214,9 @@ }, "git_index_conflict_remove": { "type": "function", - "file": "index.h", - "line": 754, - "lineto": 754, + "file": "git2/index.h", + "line": 778, + "lineto": 778, "args": [ { "name": "index", @@ -8738,9 +9241,9 @@ }, "git_index_conflict_cleanup": { "type": "function", - "file": "index.h", - "line": 762, - "lineto": 762, + "file": "git2/index.h", + "line": 786, + "lineto": 786, "args": [ { "name": "index", @@ -8760,9 +9263,9 @@ }, "git_index_has_conflicts": { "type": "function", - "file": "index.h", - "line": 769, - "lineto": 769, + "file": "git2/index.h", + "line": 793, + "lineto": 793, "args": [ { "name": "index", @@ -8781,15 +9284,15 @@ "group": "index", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_index_has_conflicts-15" + "ex/HEAD/merge.html#git_index_has_conflicts-11" ] } }, "git_index_conflict_iterator_new": { "type": "function", - "file": "index.h", - "line": 780, - "lineto": 782, + "file": "git2/index.h", + "line": 804, + "lineto": 806, "args": [ { "name": "iterator_out", @@ -8813,15 +9316,15 @@ "group": "index", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_index_conflict_iterator_new-16" + "ex/HEAD/merge.html#git_index_conflict_iterator_new-12" ] } }, "git_index_conflict_next": { "type": "function", - "file": "index.h", - "line": 794, - "lineto": 798, + "file": "git2/index.h", + "line": 818, + "lineto": 822, "args": [ { "name": "ancestor_out", @@ -8855,15 +9358,15 @@ "group": "index", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_index_conflict_next-17" + "ex/HEAD/merge.html#git_index_conflict_next-13" ] } }, "git_index_conflict_iterator_free": { "type": "function", - "file": "index.h", - "line": 805, - "lineto": 806, + "file": "git2/index.h", + "line": 829, + "lineto": 830, "args": [ { "name": "iterator", @@ -8882,15 +9385,42 @@ "group": "index", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_index_conflict_iterator_free-18" + "ex/HEAD/merge.html#git_index_conflict_iterator_free-14" ] } }, + "git_indexer_options_init": { + "type": "function", + "file": "git2/indexer.h", + "line": 85, + "lineto": 87, + "args": [ + { + "name": "opts", + "type": "git_indexer_options *", + "comment": "the `git_indexer_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_INDEXER_OPTIONS_VERSION`" + } + ], + "argline": "git_indexer_options *opts, unsigned int version", + "sig": "git_indexer_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_indexer_options with default values. Equivalent to\n creating an instance with GIT_INDEXER_OPTIONS_INIT.

\n", + "comments": "", + "group": "indexer" + }, "git_indexer_new": { "type": "function", - "file": "indexer.h", - "line": 30, - "lineto": 36, + "file": "git2/indexer.h", + "line": 101, + "lineto": 106, "args": [ { "name": "out", @@ -8913,36 +9443,26 @@ "comment": "object database from which to read base objects when\n fixing thin packs. Pass NULL if no thin pack is expected (an error\n will be returned if there are bases missing)" }, { - "name": "progress_cb", - "type": "git_transfer_progress_cb", - "comment": "function to call with progress information" - }, - { - "name": "progress_cb_payload", - "type": "void *", - "comment": "payload for the progress callback" + "name": "opts", + "type": "git_indexer_options *", + "comment": "Optional structure containing additional options. See\n `git_indexer_options` above." } ], - "argline": "git_indexer **out, const char *path, unsigned int mode, git_odb *odb, git_transfer_progress_cb progress_cb, void *progress_cb_payload", - "sig": "git_indexer **::const char *::unsigned int::git_odb *::git_transfer_progress_cb::void *", + "argline": "git_indexer **out, const char *path, unsigned int mode, git_odb *odb, git_indexer_options *opts", + "sig": "git_indexer **::const char *::unsigned int::git_odb *::git_indexer_options *", "return": { "type": "int", "comment": null }, "description": "

Create a new indexer instance

\n", "comments": "", - "group": "indexer", - "examples": { - "network/index-pack.c": [ - "ex/HEAD/network/index-pack.html#git_indexer_new-1" - ] - } + "group": "indexer" }, "git_indexer_append": { "type": "function", - "file": "indexer.h", - "line": 46, - "lineto": 46, + "file": "git2/indexer.h", + "line": 116, + "lineto": 116, "args": [ { "name": "idx", @@ -8961,30 +9481,25 @@ }, { "name": "stats", - "type": "git_transfer_progress *", + "type": "git_indexer_progress *", "comment": "stat storage" } ], - "argline": "git_indexer *idx, const void *data, size_t size, git_transfer_progress *stats", - "sig": "git_indexer *::const void *::size_t::git_transfer_progress *", + "argline": "git_indexer *idx, const void *data, size_t size, git_indexer_progress *stats", + "sig": "git_indexer *::const void *::size_t::git_indexer_progress *", "return": { "type": "int", "comment": null }, "description": "

Add data to the indexer

\n", "comments": "", - "group": "indexer", - "examples": { - "network/index-pack.c": [ - "ex/HEAD/network/index-pack.html#git_indexer_append-2" - ] - } + "group": "indexer" }, "git_indexer_commit": { "type": "function", - "file": "indexer.h", - "line": 55, - "lineto": 55, + "file": "git2/indexer.h", + "line": 125, + "lineto": 125, "args": [ { "name": "idx", @@ -8993,30 +9508,25 @@ }, { "name": "stats", - "type": "git_transfer_progress *", + "type": "git_indexer_progress *", "comment": null } ], - "argline": "git_indexer *idx, git_transfer_progress *stats", - "sig": "git_indexer *::git_transfer_progress *", + "argline": "git_indexer *idx, git_indexer_progress *stats", + "sig": "git_indexer *::git_indexer_progress *", "return": { "type": "int", "comment": null }, "description": "

Finalize the pack and index

\n", "comments": "

Resolve any pending deltas and write out the index file

\n", - "group": "indexer", - "examples": { - "network/index-pack.c": [ - "ex/HEAD/network/index-pack.html#git_indexer_commit-3" - ] - } + "group": "indexer" }, "git_indexer_hash": { "type": "function", - "file": "indexer.h", - "line": 65, - "lineto": 65, + "file": "git2/indexer.h", + "line": 135, + "lineto": 135, "args": [ { "name": "idx", @@ -9032,18 +9542,13 @@ }, "description": "

Get the packfile's hash

\n", "comments": "

A packfile's name is derived from the sorted hashing of all object names. This is only correct after the index has been finalized.

\n", - "group": "indexer", - "examples": { - "network/index-pack.c": [ - "ex/HEAD/network/index-pack.html#git_indexer_hash-4" - ] - } + "group": "indexer" }, "git_indexer_free": { "type": "function", - "file": "indexer.h", - "line": 72, - "lineto": 72, + "file": "git2/indexer.h", + "line": 142, + "lineto": 142, "args": [ { "name": "idx", @@ -9059,16 +9564,230 @@ }, "description": "

Free the indexer and its resources

\n", "comments": "", - "group": "indexer", - "examples": { - "network/index-pack.c": [ - "ex/HEAD/network/index-pack.html#git_indexer_free-5" - ] - } + "group": "indexer" + }, + "git_mailmap_new": { + "type": "function", + "file": "git2/mailmap.h", + "line": 32, + "lineto": 32, + "args": [ + { + "name": "out", + "type": "git_mailmap **", + "comment": "pointer to store the new mailmap" + } + ], + "argline": "git_mailmap **out", + "sig": "git_mailmap **", + "return": { + "type": "int", + "comment": " 0 on success, or an error code" + }, + "description": "

Allocate a new mailmap object.

\n", + "comments": "

This object is empty, so you'll have to add a mailmap file before you can do anything with it. The mailmap must be freed with 'git_mailmap_free'.

\n", + "group": "mailmap" + }, + "git_mailmap_free": { + "type": "function", + "file": "git2/mailmap.h", + "line": 39, + "lineto": 39, + "args": [ + { + "name": "mm", + "type": "git_mailmap *", + "comment": "the mailmap to free" + } + ], + "argline": "git_mailmap *mm", + "sig": "git_mailmap *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the mailmap and its associated memory.

\n", + "comments": "", + "group": "mailmap" }, - "git_merge_file_init_input": { + "git_mailmap_add_entry": { "type": "function", - "file": "merge.h", + "file": "git2/mailmap.h", + "line": 52, + "lineto": 54, + "args": [ + { + "name": "mm", + "type": "git_mailmap *", + "comment": "mailmap to add the entry to" + }, + { + "name": "real_name", + "type": "const char *", + "comment": "the real name to use, or NULL" + }, + { + "name": "real_email", + "type": "const char *", + "comment": "the real email to use, or NULL" + }, + { + "name": "replace_name", + "type": "const char *", + "comment": "the name to replace, or NULL" + }, + { + "name": "replace_email", + "type": "const char *", + "comment": "the email to replace" + } + ], + "argline": "git_mailmap *mm, const char *real_name, const char *real_email, const char *replace_name, const char *replace_email", + "sig": "git_mailmap *::const char *::const char *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, or an error code" + }, + "description": "

Add a single entry to the given mailmap object. If the entry already exists,\n it will be replaced with the new entry.

\n", + "comments": "", + "group": "mailmap" + }, + "git_mailmap_from_buffer": { + "type": "function", + "file": "git2/mailmap.h", + "line": 64, + "lineto": 65, + "args": [ + { + "name": "out", + "type": "git_mailmap **", + "comment": "pointer to store the new mailmap" + }, + { + "name": "buf", + "type": "const char *", + "comment": "buffer to parse the mailmap from" + }, + { + "name": "len", + "type": "size_t", + "comment": "the length of the input buffer" + } + ], + "argline": "git_mailmap **out, const char *buf, size_t len", + "sig": "git_mailmap **::const char *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, or an error code" + }, + "description": "

Create a new mailmap instance containing a single mailmap file

\n", + "comments": "", + "group": "mailmap" + }, + "git_mailmap_from_repository": { + "type": "function", + "file": "git2/mailmap.h", + "line": 81, + "lineto": 82, + "args": [ + { + "name": "out", + "type": "git_mailmap **", + "comment": "pointer to store the new mailmap" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository to load mailmap information from" + } + ], + "argline": "git_mailmap **out, git_repository *repo", + "sig": "git_mailmap **::git_repository *", + "return": { + "type": "int", + "comment": " 0 on success, or an error code" + }, + "description": "

Create a new mailmap instance from a repository, loading mailmap files based\n on the repository's configuration.

\n", + "comments": "

Mailmaps are loaded in the following order: 1. '.mailmap' in the root of the repository's working directory, if present. 2. The blob object identified by the 'mailmap.blob' config entry, if set. [NOTE: 'mailmap.blob' defaults to 'HEAD:.mailmap' in bare repositories] 3. The path in the 'mailmap.file' config entry, if set.

\n", + "group": "mailmap" + }, + "git_mailmap_resolve": { + "type": "function", + "file": "git2/mailmap.h", + "line": 96, + "lineto": 98, + "args": [ + { + "name": "real_name", + "type": "const char **", + "comment": "pointer to store the real name" + }, + { + "name": "real_email", + "type": "const char **", + "comment": "pointer to store the real email" + }, + { + "name": "mm", + "type": "const git_mailmap *", + "comment": "the mailmap to perform a lookup with (may be NULL)" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name to look up" + }, + { + "name": "email", + "type": "const char *", + "comment": "the email to look up" + } + ], + "argline": "const char **real_name, const char **real_email, const git_mailmap *mm, const char *name, const char *email", + "sig": "const char **::const char **::const git_mailmap *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, or an error code" + }, + "description": "

Resolve a name and email to the corresponding real name and email.

\n", + "comments": "

The lifetime of the strings are tied to mm, name, and email parameters.

\n", + "group": "mailmap" + }, + "git_mailmap_resolve_signature": { + "type": "function", + "file": "git2/mailmap.h", + "line": 110, + "lineto": 111, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "new signature" + }, + { + "name": "mm", + "type": "const git_mailmap *", + "comment": "mailmap to resolve with" + }, + { + "name": "sig", + "type": "const git_signature *", + "comment": "signature to resolve" + } + ], + "argline": "git_signature **out, const git_mailmap *mm, const git_signature *sig", + "sig": "git_signature **::const git_mailmap *::const git_signature *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Resolve a signature to use real names and emails with a mailmap.

\n", + "comments": "

Call git_signature_free() to free the data.

\n", + "group": "mailmap" + }, + "git_merge_file_input_init": { + "type": "function", + "file": "git2/merge.h", "line": 60, "lineto": 62, "args": [ @@ -9093,21 +9812,21 @@ "comments": "", "group": "merge" }, - "git_merge_file_init_options": { + "git_merge_file_options_init": { "type": "function", - "file": "merge.h", - "line": 214, - "lineto": 216, + "file": "git2/merge.h", + "line": 215, + "lineto": 215, "args": [ { "name": "opts", "type": "git_merge_file_options *", - "comment": "the `git_merge_file_options` instance to initialize." + "comment": "The `git_merge_file_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "the version of the struct; you should pass\n `GIT_MERGE_FILE_OPTIONS_VERSION` here." + "comment": "The struct version; pass `GIT_MERGE_FILE_OPTIONS_VERSION`." } ], "argline": "git_merge_file_options *opts, unsigned int version", @@ -9116,25 +9835,25 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_merge_file_options with default values. Equivalent to\n creating an instance with GIT_MERGE_FILE_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_merge_file_options structure

\n", + "comments": "

Initializes a git_merge_file_options with default values. Equivalent to creating an instance with GIT_MERGE_FILE_OPTIONS_INIT.

\n", "group": "merge" }, - "git_merge_init_options": { + "git_merge_options_init": { "type": "function", - "file": "merge.h", + "file": "git2/merge.h", "line": 311, - "lineto": 313, + "lineto": 311, "args": [ { "name": "opts", "type": "git_merge_options *", - "comment": "the `git_merge_options` instance to initialize." + "comment": "The `git_merge_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "the version of the struct; you should pass\n `GIT_MERGE_OPTIONS_VERSION` here." + "comment": "The struct version; pass `GIT_MERGE_OPTIONS_VERSION`." } ], "argline": "git_merge_options *opts, unsigned int version", @@ -9143,15 +9862,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_merge_options with default values. Equivalent to\n creating an instance with GIT_MERGE_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_merge_options structure

\n", + "comments": "

Initializes a git_merge_options with default values. Equivalent to creating an instance with GIT_MERGE_OPTIONS_INIT.

\n", "group": "merge" }, "git_merge_analysis": { "type": "function", - "file": "merge.h", - "line": 382, - "lineto": 387, + "file": "git2/merge.h", + "line": 380, + "lineto": 385, "args": [ { "name": "analysis_out", @@ -9190,15 +9909,62 @@ "group": "merge", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_merge_analysis-19" + "ex/HEAD/merge.html#git_merge_analysis-15" ] } }, - "git_merge_base": { + "git_merge_analysis_for_ref": { "type": "function", - "file": "merge.h", + "file": "git2/merge.h", "line": 398, - "lineto": 402, + "lineto": 404, + "args": [ + { + "name": "analysis_out", + "type": "git_merge_analysis_t *", + "comment": "analysis enumeration that the result is written into" + }, + { + "name": "preference_out", + "type": "git_merge_preference_t *", + "comment": null + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to merge" + }, + { + "name": "our_ref", + "type": "git_reference *", + "comment": "the reference to perform the analysis from" + }, + { + "name": "their_heads", + "type": "const git_annotated_commit **", + "comment": "the heads to merge into" + }, + { + "name": "their_heads_len", + "type": "size_t", + "comment": "the number of heads to merge" + } + ], + "argline": "git_merge_analysis_t *analysis_out, git_merge_preference_t *preference_out, git_repository *repo, git_reference *our_ref, const git_annotated_commit **their_heads, size_t their_heads_len", + "sig": "git_merge_analysis_t *::git_merge_preference_t *::git_repository *::git_reference *::const git_annotated_commit **::size_t", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Analyzes the given branch(es) and determines the opportunities for\n merging them into a reference.

\n", + "comments": "", + "group": "merge" + }, + "git_merge_base": { + "type": "function", + "file": "git2/merge.h", + "line": 415, + "lineto": 419, "args": [ { "name": "out", @@ -9232,18 +9998,18 @@ "group": "merge", "examples": { "log.c": [ - "ex/HEAD/log.html#git_merge_base-33" + "ex/HEAD/log.html#git_merge_base-31" ], "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_merge_base-3" + "ex/HEAD/rev-parse.html#git_merge_base-1" ] } }, "git_merge_bases": { "type": "function", - "file": "merge.h", - "line": 413, - "lineto": 417, + "file": "git2/merge.h", + "line": 430, + "lineto": 434, "args": [ { "name": "out", @@ -9278,9 +10044,9 @@ }, "git_merge_base_many": { "type": "function", - "file": "merge.h", - "line": 428, - "lineto": 432, + "file": "git2/merge.h", + "line": 445, + "lineto": 449, "args": [ { "name": "out", @@ -9315,9 +10081,9 @@ }, "git_merge_bases_many": { "type": "function", - "file": "merge.h", - "line": 443, - "lineto": 447, + "file": "git2/merge.h", + "line": 460, + "lineto": 464, "args": [ { "name": "out", @@ -9352,9 +10118,9 @@ }, "git_merge_base_octopus": { "type": "function", - "file": "merge.h", - "line": 458, - "lineto": 462, + "file": "git2/merge.h", + "line": 475, + "lineto": 479, "args": [ { "name": "out", @@ -9389,9 +10155,9 @@ }, "git_merge_file": { "type": "function", - "file": "merge.h", - "line": 480, - "lineto": 485, + "file": "git2/merge.h", + "line": 497, + "lineto": 502, "args": [ { "name": "out", @@ -9431,9 +10197,9 @@ }, "git_merge_file_from_index": { "type": "function", - "file": "merge.h", - "line": 501, - "lineto": 507, + "file": "git2/merge.h", + "line": 518, + "lineto": 524, "args": [ { "name": "out", @@ -9478,9 +10244,9 @@ }, "git_merge_file_result_free": { "type": "function", - "file": "merge.h", - "line": 514, - "lineto": 514, + "file": "git2/merge.h", + "line": 531, + "lineto": 531, "args": [ { "name": "result", @@ -9500,9 +10266,9 @@ }, "git_merge_trees": { "type": "function", - "file": "merge.h", - "line": 532, - "lineto": 538, + "file": "git2/merge.h", + "line": 549, + "lineto": 555, "args": [ { "name": "out", @@ -9547,9 +10313,9 @@ }, "git_merge_commits": { "type": "function", - "file": "merge.h", - "line": 555, - "lineto": 560, + "file": "git2/merge.h", + "line": 572, + "lineto": 577, "args": [ { "name": "out", @@ -9589,9 +10355,9 @@ }, "git_merge": { "type": "function", - "file": "merge.h", - "line": 580, - "lineto": 585, + "file": "git2/merge.h", + "line": 597, + "lineto": 602, "args": [ { "name": "repo", @@ -9630,13 +10396,13 @@ "group": "merge", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_merge-20" + "ex/HEAD/merge.html#git_merge-16" ] } }, "git_message_prettify": { "type": "function", - "file": "message.h", + "file": "git2/message.h", "line": 38, "lineto": 38, "args": [ @@ -9673,7 +10439,7 @@ }, "git_message_trailers": { "type": "function", - "file": "message.h", + "file": "git2/message.h", "line": 73, "lineto": 73, "args": [ @@ -9700,7 +10466,7 @@ }, "git_message_trailer_array_free": { "type": "function", - "file": "message.h", + "file": "git2/message.h", "line": 79, "lineto": 79, "args": [ @@ -9722,7 +10488,7 @@ }, "git_note_iterator_new": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 49, "lineto": 52, "args": [ @@ -9754,7 +10520,7 @@ }, "git_note_commit_iterator_new": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 64, "lineto": 66, "args": [ @@ -9781,7 +10547,7 @@ }, "git_note_iterator_free": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 73, "lineto": 73, "args": [ @@ -9803,7 +10569,7 @@ }, "git_note_next": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 86, "lineto": 89, "args": [ @@ -9835,7 +10601,7 @@ }, "git_note_read": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 105, "lineto": 109, "args": [ @@ -9872,7 +10638,7 @@ }, "git_note_commit_read": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 124, "lineto": 128, "args": [ @@ -9909,7 +10675,7 @@ }, "git_note_author": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 136, "lineto": 136, "args": [ @@ -9931,7 +10697,7 @@ }, "git_note_committer": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 144, "lineto": 144, "args": [ @@ -9953,7 +10719,7 @@ }, "git_note_message": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 153, "lineto": 153, "args": [ @@ -9975,7 +10741,7 @@ }, "git_note_id": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 162, "lineto": 162, "args": [ @@ -9997,7 +10763,7 @@ }, "git_note_create": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 179, "lineto": 187, "args": [ @@ -10054,7 +10820,7 @@ }, "git_note_commit_create": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 209, "lineto": 218, "args": [ @@ -10116,7 +10882,7 @@ }, "git_note_remove": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 232, "lineto": 237, "args": [ @@ -10158,7 +10924,7 @@ }, "git_note_commit_remove": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 257, "lineto": 263, "args": [ @@ -10205,7 +10971,7 @@ }, "git_note_free": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 270, "lineto": 270, "args": [ @@ -10225,9 +10991,36 @@ "comments": "", "group": "note" }, + "git_note_default_ref": { + "type": "function", + "file": "git2/notes.h", + "line": 280, + "lineto": 280, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer in which to store the name of the default notes reference" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The Git repository" + } + ], + "argline": "git_buf *out, git_repository *repo", + "sig": "git_buf *::git_repository *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the default notes reference for a repository

\n", + "comments": "", + "group": "note" + }, "git_note_foreach": { "type": "function", - "file": "notes.h", + "file": "git2/notes.h", "line": 298, "lineto": 302, "args": [ @@ -10264,7 +11057,7 @@ }, "git_object_lookup": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 42, "lineto": 46, "args": [ @@ -10285,31 +11078,31 @@ }, { "name": "type", - "type": "git_otype", + "type": "git_object_t", "comment": "the type of the object" } ], - "argline": "git_object **object, git_repository *repo, const git_oid *id, git_otype type", - "sig": "git_object **::git_repository *::const git_oid *::git_otype", + "argline": "git_object **object, git_repository *repo, const git_oid *id, git_object_t type", + "sig": "git_object **::git_repository *::const git_oid *::git_object_t", "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Lookup a reference to one of the objects in a repository.

\n", - "comments": "

The generated reference is owned by the repository and should be closed with the git_object_free method instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object in the odb; the method will fail otherwise. The special value 'GIT_OBJ_ANY' may be passed to let the method guess the object's type.

\n", + "comments": "

The generated reference is owned by the repository and should be closed with the git_object_free method instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object in the odb; the method will fail otherwise. The special value 'GIT_OBJECT_ANY' may be passed to let the method guess the object's type.

\n", "group": "object", "examples": { "log.c": [ - "ex/HEAD/log.html#git_object_lookup-34" + "ex/HEAD/log.html#git_object_lookup-32" ], "merge.c": [ - "ex/HEAD/merge.html#git_object_lookup-21" + "ex/HEAD/merge.html#git_object_lookup-17" ] } }, "git_object_lookup_prefix": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 75, "lineto": 80, "args": [ @@ -10335,23 +11128,23 @@ }, { "name": "type", - "type": "git_otype", + "type": "git_object_t", "comment": "the type of the object" } ], - "argline": "git_object **object_out, git_repository *repo, const git_oid *id, size_t len, git_otype type", - "sig": "git_object **::git_repository *::const git_oid *::size_t::git_otype", + "argline": "git_object **object_out, git_repository *repo, const git_oid *id, size_t len, git_object_t type", + "sig": "git_object **::git_repository *::const git_oid *::size_t::git_object_t", "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Lookup a reference to one of the objects in a repository,\n given a prefix of its identifier (short id).

\n", - "comments": "

The object obtained will be so that its identifier matches the first 'len' hexadecimal characters (packets of 4 bits) of the given 'id'. 'len' must be at least GIT_OID_MINPREFIXLEN, and long enough to identify a unique object matching the prefix; otherwise the method will fail.

\n\n

The generated reference is owned by the repository and should be closed with the git_object_free method instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object in the odb; the method will fail otherwise. The special value 'GIT_OBJ_ANY' may be passed to let the method guess the object's type.

\n", + "comments": "

The object obtained will be so that its identifier matches the first 'len' hexadecimal characters (packets of 4 bits) of the given 'id'. 'len' must be at least GIT_OID_MINPREFIXLEN, and long enough to identify a unique object matching the prefix; otherwise the method will fail.

\n\n

The generated reference is owned by the repository and should be closed with the git_object_free method instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object in the odb; the method will fail otherwise. The special value 'GIT_OBJECT_ANY' may be passed to let the method guess the object's type.

\n", "group": "object" }, "git_object_lookup_bypath": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 93, "lineto": 97, "args": [ @@ -10372,12 +11165,12 @@ }, { "name": "type", - "type": "git_otype", + "type": "git_object_t", "comment": "type of object desired" } ], - "argline": "git_object **out, const git_object *treeish, const char *path, git_otype type", - "sig": "git_object **::const git_object *::const char *::git_otype", + "argline": "git_object **out, const git_object *treeish, const char *path, git_object_t type", + "sig": "git_object **::const git_object *::const char *::git_object_t", "return": { "type": "int", "comment": " 0 on success, or an error code" @@ -10388,7 +11181,7 @@ }, "git_object_id": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 105, "lineto": 105, "args": [ @@ -10409,33 +11202,33 @@ "group": "object", "examples": { "blame.c": [ + "ex/HEAD/blame.html#git_object_id-8", + "ex/HEAD/blame.html#git_object_id-9", "ex/HEAD/blame.html#git_object_id-10", - "ex/HEAD/blame.html#git_object_id-11", - "ex/HEAD/blame.html#git_object_id-12", - "ex/HEAD/blame.html#git_object_id-13" + "ex/HEAD/blame.html#git_object_id-11" ], "cat-file.c": [ - "ex/HEAD/cat-file.html#git_object_id-12", - "ex/HEAD/cat-file.html#git_object_id-13" + "ex/HEAD/cat-file.html#git_object_id-10", + "ex/HEAD/cat-file.html#git_object_id-11" ], "log.c": [ + "ex/HEAD/log.html#git_object_id-33", + "ex/HEAD/log.html#git_object_id-34", "ex/HEAD/log.html#git_object_id-35", - "ex/HEAD/log.html#git_object_id-36", - "ex/HEAD/log.html#git_object_id-37", - "ex/HEAD/log.html#git_object_id-38" + "ex/HEAD/log.html#git_object_id-36" ], "rev-parse.c": [ + "ex/HEAD/rev-parse.html#git_object_id-2", + "ex/HEAD/rev-parse.html#git_object_id-3", "ex/HEAD/rev-parse.html#git_object_id-4", "ex/HEAD/rev-parse.html#git_object_id-5", - "ex/HEAD/rev-parse.html#git_object_id-6", - "ex/HEAD/rev-parse.html#git_object_id-7", - "ex/HEAD/rev-parse.html#git_object_id-8" + "ex/HEAD/rev-parse.html#git_object_id-6" ] } }, "git_object_short_id": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 119, "lineto": 119, "args": [ @@ -10461,13 +11254,13 @@ "group": "object", "examples": { "tag.c": [ - "ex/HEAD/tag.html#git_object_short_id-5" + "ex/HEAD/tag.html#git_object_short_id-3" ] } }, "git_object_type": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 127, "lineto": 127, "args": [ @@ -10480,7 +11273,7 @@ "argline": "const git_object *obj", "sig": "const git_object *", "return": { - "type": "git_otype", + "type": "git_object_t", "comment": " the object's type" }, "description": "

Get the object type of an object

\n", @@ -10488,18 +11281,18 @@ "group": "object", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_object_type-14", - "ex/HEAD/cat-file.html#git_object_type-15", - "ex/HEAD/cat-file.html#git_object_type-16" + "ex/HEAD/cat-file.html#git_object_type-12", + "ex/HEAD/cat-file.html#git_object_type-13", + "ex/HEAD/cat-file.html#git_object_type-14" ], "tag.c": [ - "ex/HEAD/tag.html#git_object_type-6" + "ex/HEAD/tag.html#git_object_type-4" ] } }, "git_object_owner": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 141, "lineto": 141, "args": [ @@ -10521,7 +11314,7 @@ }, "git_object_free": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 158, "lineto": 158, "args": [ @@ -10542,50 +11335,50 @@ "group": "object", "examples": { "blame.c": [ + "ex/HEAD/blame.html#git_object_free-12", + "ex/HEAD/blame.html#git_object_free-13", "ex/HEAD/blame.html#git_object_free-14", - "ex/HEAD/blame.html#git_object_free-15", - "ex/HEAD/blame.html#git_object_free-16", - "ex/HEAD/blame.html#git_object_free-17" + "ex/HEAD/blame.html#git_object_free-15" ], "cat-file.c": [ - "ex/HEAD/cat-file.html#git_object_free-17" + "ex/HEAD/cat-file.html#git_object_free-15" ], "general.c": [ "ex/HEAD/general.html#git_object_free-38" ], "log.c": [ - "ex/HEAD/log.html#git_object_free-39" + "ex/HEAD/log.html#git_object_free-37" ], "merge.c": [ - "ex/HEAD/merge.html#git_object_free-22" + "ex/HEAD/merge.html#git_object_free-18" ], "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_object_free-9", - "ex/HEAD/rev-parse.html#git_object_free-10", - "ex/HEAD/rev-parse.html#git_object_free-11" + "ex/HEAD/rev-parse.html#git_object_free-7", + "ex/HEAD/rev-parse.html#git_object_free-8", + "ex/HEAD/rev-parse.html#git_object_free-9" ], "tag.c": [ + "ex/HEAD/tag.html#git_object_free-5", + "ex/HEAD/tag.html#git_object_free-6", "ex/HEAD/tag.html#git_object_free-7", - "ex/HEAD/tag.html#git_object_free-8", - "ex/HEAD/tag.html#git_object_free-9", - "ex/HEAD/tag.html#git_object_free-10" + "ex/HEAD/tag.html#git_object_free-8" ] } }, "git_object_type2string": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 169, "lineto": 169, "args": [ { "name": "type", - "type": "git_otype", + "type": "git_object_t", "comment": "object type to convert." } ], - "argline": "git_otype type", - "sig": "git_otype", + "argline": "git_object_t type", + "sig": "git_object_t", "return": { "type": "const char *", "comment": " the corresponding string representation." @@ -10595,10 +11388,10 @@ "group": "object", "examples": { "cat-file.c": [ + "ex/HEAD/cat-file.html#git_object_type2string-16", + "ex/HEAD/cat-file.html#git_object_type2string-17", "ex/HEAD/cat-file.html#git_object_type2string-18", - "ex/HEAD/cat-file.html#git_object_type2string-19", - "ex/HEAD/cat-file.html#git_object_type2string-20", - "ex/HEAD/cat-file.html#git_object_type2string-21" + "ex/HEAD/cat-file.html#git_object_type2string-19" ], "general.c": [ "ex/HEAD/general.html#git_object_type2string-39", @@ -10608,7 +11401,7 @@ }, "git_object_string2type": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 177, "lineto": 177, "args": [ @@ -10621,49 +11414,49 @@ "argline": "const char *str", "sig": "const char *", "return": { - "type": "git_otype", - "comment": " the corresponding git_otype." + "type": "git_object_t", + "comment": " the corresponding git_object_t." }, - "description": "

Convert a string object type representation to it's git_otype.

\n", + "description": "

Convert a string object type representation to it's git_object_t.

\n", "comments": "", "group": "object" }, "git_object_typeisloose": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 186, "lineto": 186, "args": [ { "name": "type", - "type": "git_otype", + "type": "git_object_t", "comment": "object type to test." } ], - "argline": "git_otype type", - "sig": "git_otype", + "argline": "git_object_t type", + "sig": "git_object_t", "return": { "type": "int", "comment": " true if the type represents a valid loose object type,\n false otherwise." }, - "description": "

Determine if the given git_otype is a valid loose object type.

\n", + "description": "

Determine if the given git_object_t is a valid loose object type.

\n", "comments": "", "group": "object" }, - "git_object__size": { + "git_object_size": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 200, "lineto": 200, "args": [ { "name": "type", - "type": "git_otype", + "type": "git_object_t", "comment": "object type to get its size" } ], - "argline": "git_otype type", - "sig": "git_otype", + "argline": "git_object_t type", + "sig": "git_object_t", "return": { "type": "size_t", "comment": " size in bytes of the object" @@ -10674,7 +11467,7 @@ }, "git_object_peel": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 225, "lineto": 228, "args": [ @@ -10690,23 +11483,23 @@ }, { "name": "target_type", - "type": "git_otype", - "comment": "The type of the requested object (a GIT_OBJ_ value)" + "type": "git_object_t", + "comment": "The type of the requested object (a GIT_OBJECT_ value)" } ], - "argline": "git_object **peeled, const git_object *object, git_otype target_type", - "sig": "git_object **::const git_object *::git_otype", + "argline": "git_object **peeled, const git_object *object, git_object_t target_type", + "sig": "git_object **::const git_object *::git_object_t", "return": { "type": "int", "comment": " 0 on success, GIT_EINVALIDSPEC, GIT_EPEEL, or an error code" }, "description": "

Recursively peel an object until an object of the specified type is met.

\n", - "comments": "

If the query cannot be satisfied due to the object model, GIT_EINVALIDSPEC will be returned (e.g. trying to peel a blob to a tree).

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object will be peeled until the type changes. A tag will be peeled until the referenced object is no longer a tag, and a commit will be peeled to a tree. Any other object type will return GIT_EINVALIDSPEC.

\n\n

If peeling a tag we discover an object which cannot be peeled to the target type due to the object model, GIT_EPEEL will be returned.

\n\n

You must free the returned object.

\n", + "comments": "

If the query cannot be satisfied due to the object model, GIT_EINVALIDSPEC will be returned (e.g. trying to peel a blob to a tree).

\n\n

If you pass GIT_OBJECT_ANY as the target type, then the object will be peeled until the type changes. A tag will be peeled until the referenced object is no longer a tag, and a commit will be peeled to a tree. Any other object type will return GIT_EINVALIDSPEC.

\n\n

If peeling a tag we discover an object which cannot be peeled to the target type due to the object model, GIT_EPEEL will be returned.

\n\n

You must free the returned object.

\n", "group": "object" }, "git_object_dup": { "type": "function", - "file": "object.h", + "file": "git2/object.h", "line": 237, "lineto": 237, "args": [ @@ -10733,9 +11526,9 @@ }, "git_odb_new": { "type": "function", - "file": "odb.h", - "line": 39, - "lineto": 39, + "file": "git2/odb.h", + "line": 40, + "lineto": 40, "args": [ { "name": "out", @@ -10755,9 +11548,9 @@ }, "git_odb_open": { "type": "function", - "file": "odb.h", - "line": 57, - "lineto": 57, + "file": "git2/odb.h", + "line": 58, + "lineto": 58, "args": [ { "name": "out", @@ -10782,9 +11575,9 @@ }, "git_odb_add_disk_alternate": { "type": "function", - "file": "odb.h", - "line": 74, - "lineto": 74, + "file": "git2/odb.h", + "line": 75, + "lineto": 75, "args": [ { "name": "odb", @@ -10809,9 +11602,9 @@ }, "git_odb_free": { "type": "function", - "file": "odb.h", - "line": 81, - "lineto": 81, + "file": "git2/odb.h", + "line": 82, + "lineto": 82, "args": [ { "name": "db", @@ -10830,7 +11623,7 @@ "group": "odb", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_odb_free-22" + "ex/HEAD/cat-file.html#git_odb_free-20" ], "general.c": [ "ex/HEAD/general.html#git_odb_free-41" @@ -10839,9 +11632,9 @@ }, "git_odb_read": { "type": "function", - "file": "odb.h", - "line": 100, - "lineto": 100, + "file": "git2/odb.h", + "line": 101, + "lineto": 101, "args": [ { "name": "out", @@ -10870,7 +11663,7 @@ "group": "odb", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_odb_read-23" + "ex/HEAD/cat-file.html#git_odb_read-21" ], "general.c": [ "ex/HEAD/general.html#git_odb_read-42" @@ -10879,9 +11672,9 @@ }, "git_odb_read_prefix": { "type": "function", - "file": "odb.h", - "line": 129, - "lineto": 129, + "file": "git2/odb.h", + "line": 130, + "lineto": 130, "args": [ { "name": "out", @@ -10916,9 +11709,9 @@ }, "git_odb_read_header": { "type": "function", - "file": "odb.h", - "line": 149, - "lineto": 149, + "file": "git2/odb.h", + "line": 150, + "lineto": 150, "args": [ { "name": "len_out", @@ -10927,7 +11720,7 @@ }, { "name": "type_out", - "type": "git_otype *", + "type": "git_object_t *", "comment": "pointer where to store the type" }, { @@ -10941,8 +11734,8 @@ "comment": "identity of the object to read." } ], - "argline": "size_t *len_out, git_otype *type_out, git_odb *db, const git_oid *id", - "sig": "size_t *::git_otype *::git_odb *::const git_oid *", + "argline": "size_t *len_out, git_object_t *type_out, git_odb *db, const git_oid *id", + "sig": "size_t *::git_object_t *::git_odb *::const git_oid *", "return": { "type": "int", "comment": " - 0 if the object was read;\n - GIT_ENOTFOUND if the object is not in the database." @@ -10953,9 +11746,9 @@ }, "git_odb_exists": { "type": "function", - "file": "odb.h", - "line": 160, - "lineto": 160, + "file": "git2/odb.h", + "line": 161, + "lineto": 161, "args": [ { "name": "db", @@ -10980,9 +11773,9 @@ }, "git_odb_exists_prefix": { "type": "function", - "file": "odb.h", - "line": 173, - "lineto": 174, + "file": "git2/odb.h", + "line": 174, + "lineto": 175, "args": [ { "name": "out", @@ -11017,9 +11810,9 @@ }, "git_odb_expand_ids": { "type": "function", - "file": "odb.h", - "line": 215, - "lineto": 218, + "file": "git2/odb.h", + "line": 216, + "lineto": 219, "args": [ { "name": "db", @@ -11049,9 +11842,9 @@ }, "git_odb_refresh": { "type": "function", - "file": "odb.h", - "line": 238, - "lineto": 238, + "file": "git2/odb.h", + "line": 239, + "lineto": 239, "args": [ { "name": "db", @@ -11071,9 +11864,9 @@ }, "git_odb_foreach": { "type": "function", - "file": "odb.h", - "line": 253, - "lineto": 253, + "file": "git2/odb.h", + "line": 254, + "lineto": 254, "args": [ { "name": "db", @@ -11103,9 +11896,9 @@ }, "git_odb_write": { "type": "function", - "file": "odb.h", - "line": 273, - "lineto": 273, + "file": "git2/odb.h", + "line": 274, + "lineto": 274, "args": [ { "name": "out", @@ -11129,12 +11922,12 @@ }, { "name": "type", - "type": "git_otype", + "type": "git_object_t", "comment": "type of the data to store" } ], - "argline": "git_oid *out, git_odb *odb, const void *data, size_t len, git_otype type", - "sig": "git_oid *::git_odb *::const void *::size_t::git_otype", + "argline": "git_oid *out, git_odb *odb, const void *data, size_t len, git_object_t type", + "sig": "git_oid *::git_odb *::const void *::size_t::git_object_t", "return": { "type": "int", "comment": " 0 or an error code" @@ -11150,9 +11943,9 @@ }, "git_odb_open_wstream": { "type": "function", - "file": "odb.h", - "line": 296, - "lineto": 296, + "file": "git2/odb.h", + "line": 297, + "lineto": 297, "args": [ { "name": "out", @@ -11171,12 +11964,12 @@ }, { "name": "type", - "type": "git_otype", + "type": "git_object_t", "comment": "type of the object that will be written" } ], - "argline": "git_odb_stream **out, git_odb *db, git_off_t size, git_otype type", - "sig": "git_odb_stream **::git_odb *::git_off_t::git_otype", + "argline": "git_odb_stream **out, git_odb *db, git_off_t size, git_object_t type", + "sig": "git_odb_stream **::git_odb *::git_off_t::git_object_t", "return": { "type": "int", "comment": " 0 if the stream was created; error code otherwise" @@ -11187,9 +11980,9 @@ }, "git_odb_stream_write": { "type": "function", - "file": "odb.h", - "line": 309, - "lineto": 309, + "file": "git2/odb.h", + "line": 310, + "lineto": 310, "args": [ { "name": "stream", @@ -11219,9 +12012,9 @@ }, "git_odb_stream_finalize_write": { "type": "function", - "file": "odb.h", - "line": 324, - "lineto": 324, + "file": "git2/odb.h", + "line": 325, + "lineto": 325, "args": [ { "name": "out", @@ -11246,9 +12039,9 @@ }, "git_odb_stream_read": { "type": "function", - "file": "odb.h", - "line": 331, - "lineto": 331, + "file": "git2/odb.h", + "line": 332, + "lineto": 332, "args": [ { "name": "stream", @@ -11278,9 +12071,9 @@ }, "git_odb_stream_free": { "type": "function", - "file": "odb.h", - "line": 338, - "lineto": 338, + "file": "git2/odb.h", + "line": 339, + "lineto": 339, "args": [ { "name": "stream", @@ -11300,9 +12093,9 @@ }, "git_odb_open_rstream": { "type": "function", - "file": "odb.h", - "line": 366, - "lineto": 371, + "file": "git2/odb.h", + "line": 367, + "lineto": 372, "args": [ { "name": "out", @@ -11316,7 +12109,7 @@ }, { "name": "type", - "type": "git_otype *", + "type": "git_object_t *", "comment": "pointer where to store the type of the object" }, { @@ -11330,8 +12123,8 @@ "comment": "oid of the object the stream will read from" } ], - "argline": "git_odb_stream **out, size_t *len, git_otype *type, git_odb *db, const git_oid *oid", - "sig": "git_odb_stream **::size_t *::git_otype *::git_odb *::const git_oid *", + "argline": "git_odb_stream **out, size_t *len, git_object_t *type, git_odb *db, const git_oid *oid", + "sig": "git_odb_stream **::size_t *::git_object_t *::git_odb *::const git_oid *", "return": { "type": "int", "comment": " 0 if the stream was created; error code otherwise" @@ -11342,9 +12135,9 @@ }, "git_odb_write_pack": { "type": "function", - "file": "odb.h", - "line": 391, - "lineto": 395, + "file": "git2/odb.h", + "line": 392, + "lineto": 396, "args": [ { "name": "out", @@ -11358,7 +12151,7 @@ }, { "name": "progress_cb", - "type": "git_transfer_progress_cb", + "type": "git_indexer_progress_cb", "comment": "function to call with progress information.\n Be aware that this is called inline with network and indexing operations,\n so performance may be affected." }, { @@ -11367,8 +12160,8 @@ "comment": "payload for the progress callback" } ], - "argline": "git_odb_writepack **out, git_odb *db, git_transfer_progress_cb progress_cb, void *progress_payload", - "sig": "git_odb_writepack **::git_odb *::git_transfer_progress_cb::void *", + "argline": "git_odb_writepack **out, git_odb *db, git_indexer_progress_cb progress_cb, void *progress_payload", + "sig": "git_odb_writepack **::git_odb *::git_indexer_progress_cb::void *", "return": { "type": "int", "comment": null @@ -11379,9 +12172,9 @@ }, "git_odb_hash": { "type": "function", - "file": "odb.h", - "line": 409, - "lineto": 409, + "file": "git2/odb.h", + "line": 410, + "lineto": 410, "args": [ { "name": "out", @@ -11400,12 +12193,12 @@ }, { "name": "type", - "type": "git_otype", + "type": "git_object_t", "comment": "of the data to hash" } ], - "argline": "git_oid *out, const void *data, size_t len, git_otype type", - "sig": "git_oid *::const void *::size_t::git_otype", + "argline": "git_oid *out, const void *data, size_t len, git_object_t type", + "sig": "git_oid *::const void *::size_t::git_object_t", "return": { "type": "int", "comment": " 0 or an error code" @@ -11416,9 +12209,9 @@ }, "git_odb_hashfile": { "type": "function", - "file": "odb.h", - "line": 424, - "lineto": 424, + "file": "git2/odb.h", + "line": 425, + "lineto": 425, "args": [ { "name": "out", @@ -11432,12 +12225,12 @@ }, { "name": "type", - "type": "git_otype", + "type": "git_object_t", "comment": "the type of the object that will be hashed" } ], - "argline": "git_oid *out, const char *path, git_otype type", - "sig": "git_oid *::const char *::git_otype", + "argline": "git_oid *out, const char *path, git_object_t type", + "sig": "git_oid *::const char *::git_object_t", "return": { "type": "int", "comment": " 0 or an error code" @@ -11448,9 +12241,9 @@ }, "git_odb_object_dup": { "type": "function", - "file": "odb.h", - "line": 438, - "lineto": 438, + "file": "git2/odb.h", + "line": 439, + "lineto": 439, "args": [ { "name": "dest", @@ -11475,9 +12268,9 @@ }, "git_odb_object_free": { "type": "function", - "file": "odb.h", - "line": 448, - "lineto": 448, + "file": "git2/odb.h", + "line": 449, + "lineto": 449, "args": [ { "name": "object", @@ -11496,7 +12289,7 @@ "group": "odb", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_odb_object_free-24" + "ex/HEAD/cat-file.html#git_odb_object_free-22" ], "general.c": [ "ex/HEAD/general.html#git_odb_object_free-44" @@ -11505,9 +12298,9 @@ }, "git_odb_object_id": { "type": "function", - "file": "odb.h", - "line": 458, - "lineto": 458, + "file": "git2/odb.h", + "line": 459, + "lineto": 459, "args": [ { "name": "object", @@ -11527,9 +12320,9 @@ }, "git_odb_object_data": { "type": "function", - "file": "odb.h", - "line": 471, - "lineto": 471, + "file": "git2/odb.h", + "line": 472, + "lineto": 472, "args": [ { "name": "object", @@ -11554,9 +12347,9 @@ }, "git_odb_object_size": { "type": "function", - "file": "odb.h", - "line": 482, - "lineto": 482, + "file": "git2/odb.h", + "line": 483, + "lineto": 483, "args": [ { "name": "object", @@ -11575,7 +12368,7 @@ "group": "odb", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_odb_object_size-25" + "ex/HEAD/cat-file.html#git_odb_object_size-23" ], "general.c": [ "ex/HEAD/general.html#git_odb_object_size-46" @@ -11584,9 +12377,9 @@ }, "git_odb_object_type": { "type": "function", - "file": "odb.h", - "line": 490, - "lineto": 490, + "file": "git2/odb.h", + "line": 491, + "lineto": 491, "args": [ { "name": "object", @@ -11597,7 +12390,7 @@ "argline": "git_odb_object *object", "sig": "git_odb_object *", "return": { - "type": "git_otype", + "type": "git_object_t", "comment": " the type" }, "description": "

Return the type of an ODB object

\n", @@ -11611,9 +12404,9 @@ }, "git_odb_add_backend": { "type": "function", - "file": "odb.h", - "line": 505, - "lineto": 505, + "file": "git2/odb.h", + "line": 506, + "lineto": 506, "args": [ { "name": "odb", @@ -11643,9 +12436,9 @@ }, "git_odb_add_alternate": { "type": "function", - "file": "odb.h", - "line": 526, - "lineto": 526, + "file": "git2/odb.h", + "line": 527, + "lineto": 527, "args": [ { "name": "odb", @@ -11675,9 +12468,9 @@ }, "git_odb_num_backends": { "type": "function", - "file": "odb.h", - "line": 534, - "lineto": 534, + "file": "git2/odb.h", + "line": 535, + "lineto": 535, "args": [ { "name": "odb", @@ -11697,9 +12490,9 @@ }, "git_odb_get_backend": { "type": "function", - "file": "odb.h", - "line": 544, - "lineto": 544, + "file": "git2/odb.h", + "line": 545, + "lineto": 545, "args": [ { "name": "out", @@ -11729,9 +12522,9 @@ }, "git_odb_backend_pack": { "type": "function", - "file": "odb_backend.h", - "line": 34, - "lineto": 34, + "file": "git2/odb_backend.h", + "line": 35, + "lineto": 35, "args": [ { "name": "out", @@ -11756,9 +12549,9 @@ }, "git_odb_backend_loose": { "type": "function", - "file": "odb_backend.h", - "line": 48, - "lineto": 54, + "file": "git2/odb_backend.h", + "line": 49, + "lineto": 55, "args": [ { "name": "out", @@ -11803,9 +12596,9 @@ }, "git_odb_backend_one_pack": { "type": "function", - "file": "odb_backend.h", - "line": 67, - "lineto": 67, + "file": "git2/odb_backend.h", + "line": 68, + "lineto": 68, "args": [ { "name": "out", @@ -11830,7 +12623,7 @@ }, "git_oid_fromstr": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 47, "lineto": 47, "args": [ @@ -11864,15 +12657,12 @@ "ex/HEAD/general.html#git_oid_fromstr-53", "ex/HEAD/general.html#git_oid_fromstr-54", "ex/HEAD/general.html#git_oid_fromstr-55" - ], - "merge.c": [ - "ex/HEAD/merge.html#git_oid_fromstr-23" ] } }, "git_oid_fromstrp": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 56, "lineto": 56, "args": [ @@ -11899,7 +12689,7 @@ }, "git_oid_fromstrn": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 69, "lineto": 69, "args": [ @@ -11931,7 +12721,7 @@ }, "git_oid_fromraw": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 77, "lineto": 77, "args": [ @@ -11958,7 +12748,7 @@ }, "git_oid_fmt": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 89, "lineto": 89, "args": [ @@ -11983,6 +12773,10 @@ "comments": "", "group": "oid", "examples": { + "fetch.c": [ + "ex/HEAD/fetch.html#git_oid_fmt-1", + "ex/HEAD/fetch.html#git_oid_fmt-2" + ], "general.c": [ "ex/HEAD/general.html#git_oid_fmt-56", "ex/HEAD/general.html#git_oid_fmt-57", @@ -11991,21 +12785,14 @@ "ex/HEAD/general.html#git_oid_fmt-60", "ex/HEAD/general.html#git_oid_fmt-61" ], - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_oid_fmt-1", - "ex/HEAD/network/fetch.html#git_oid_fmt-2" - ], - "network/index-pack.c": [ - "ex/HEAD/network/index-pack.html#git_oid_fmt-6" - ], - "network/ls-remote.c": [ - "ex/HEAD/network/ls-remote.html#git_oid_fmt-1" + "ls-remote.c": [ + "ex/HEAD/ls-remote.html#git_oid_fmt-1" ] } }, "git_oid_nfmt": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 100, "lineto": 100, "args": [ @@ -12037,7 +12824,7 @@ }, "git_oid_pathfmt": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 115, "lineto": 115, "args": [ @@ -12064,7 +12851,7 @@ }, "git_oid_tostr_s": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 128, "lineto": 128, "args": [ @@ -12085,14 +12872,14 @@ "group": "oid", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_oid_tostr_s-24", - "ex/HEAD/merge.html#git_oid_tostr_s-25" + "ex/HEAD/merge.html#git_oid_tostr_s-19", + "ex/HEAD/merge.html#git_oid_tostr_s-20" ] } }, "git_oid_tostr": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 147, "lineto": 147, "args": [ @@ -12123,31 +12910,31 @@ "group": "oid", "examples": { "blame.c": [ - "ex/HEAD/blame.html#git_oid_tostr-18", - "ex/HEAD/blame.html#git_oid_tostr-19" + "ex/HEAD/blame.html#git_oid_tostr-16", + "ex/HEAD/blame.html#git_oid_tostr-17" ], "cat-file.c": [ + "ex/HEAD/cat-file.html#git_oid_tostr-24", + "ex/HEAD/cat-file.html#git_oid_tostr-25", "ex/HEAD/cat-file.html#git_oid_tostr-26", "ex/HEAD/cat-file.html#git_oid_tostr-27", - "ex/HEAD/cat-file.html#git_oid_tostr-28", - "ex/HEAD/cat-file.html#git_oid_tostr-29", - "ex/HEAD/cat-file.html#git_oid_tostr-30" + "ex/HEAD/cat-file.html#git_oid_tostr-28" ], "log.c": [ - "ex/HEAD/log.html#git_oid_tostr-40", - "ex/HEAD/log.html#git_oid_tostr-41" + "ex/HEAD/log.html#git_oid_tostr-38", + "ex/HEAD/log.html#git_oid_tostr-39" ], "rev-parse.c": [ + "ex/HEAD/rev-parse.html#git_oid_tostr-10", + "ex/HEAD/rev-parse.html#git_oid_tostr-11", "ex/HEAD/rev-parse.html#git_oid_tostr-12", - "ex/HEAD/rev-parse.html#git_oid_tostr-13", - "ex/HEAD/rev-parse.html#git_oid_tostr-14", - "ex/HEAD/rev-parse.html#git_oid_tostr-15" + "ex/HEAD/rev-parse.html#git_oid_tostr-13" ] } }, "git_oid_cpy": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 155, "lineto": 155, "args": [ @@ -12173,15 +12960,15 @@ "group": "oid", "examples": { "blame.c": [ - "ex/HEAD/blame.html#git_oid_cpy-20", - "ex/HEAD/blame.html#git_oid_cpy-21", - "ex/HEAD/blame.html#git_oid_cpy-22" + "ex/HEAD/blame.html#git_oid_cpy-18", + "ex/HEAD/blame.html#git_oid_cpy-19", + "ex/HEAD/blame.html#git_oid_cpy-20" ] } }, "git_oid_cmp": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 164, "lineto": 164, "args": [ @@ -12208,7 +12995,7 @@ }, "git_oid_equal": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 173, "lineto": 173, "args": [ @@ -12235,7 +13022,7 @@ }, "git_oid_ncmp": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 184, "lineto": 184, "args": [ @@ -12267,7 +13054,7 @@ }, "git_oid_streq": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 193, "lineto": 193, "args": [ @@ -12294,7 +13081,7 @@ }, "git_oid_strcmp": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 203, "lineto": 203, "args": [ @@ -12319,9 +13106,9 @@ "comments": "", "group": "oid" }, - "git_oid_iszero": { + "git_oid_is_zero": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 210, "lineto": 210, "args": [ @@ -12342,16 +13129,16 @@ "group": "oid", "examples": { "blame.c": [ - "ex/HEAD/blame.html#git_oid_iszero-23" + "ex/HEAD/blame.html#git_oid_is_zero-21" ], - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_oid_iszero-3" + "fetch.c": [ + "ex/HEAD/fetch.html#git_oid_is_zero-3" ] } }, "git_oid_shorten_new": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 231, "lineto": 231, "args": [ @@ -12373,7 +13160,7 @@ }, "git_oid_shorten_add": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 257, "lineto": 257, "args": [ @@ -12395,12 +13182,12 @@ "comment": " the minimal length to uniquely identify all OIDs\n\t\tadded so far to the set; or an error code (\n<\n0) if an\n\t\terror occurs." }, "description": "

Add a new OID to set of shortened OIDs and calculate\n the minimal length to uniquely identify all the OIDs in\n the set.

\n", - "comments": "

The OID is expected to be a 40-char hexadecimal string. The OID is owned by the user and will not be modified or freed.

\n\n

For performance reasons, there is a hard-limit of how many OIDs can be added to a single set (around ~32000, assuming a mostly randomized distribution), which should be enough for any kind of program, and keeps the algorithm fast and memory-efficient.

\n\n

Attempting to add more than those OIDs will result in a GITERR_INVALID error

\n", + "comments": "

The OID is expected to be a 40-char hexadecimal string. The OID is owned by the user and will not be modified or freed.

\n\n

For performance reasons, there is a hard-limit of how many OIDs can be added to a single set (around ~32000, assuming a mostly randomized distribution), which should be enough for any kind of program, and keeps the algorithm fast and memory-efficient.

\n\n

Attempting to add more than those OIDs will result in a GIT_ERROR_INVALID error

\n", "group": "oid" }, "git_oid_shorten_free": { "type": "function", - "file": "oid.h", + "file": "git2/oid.h", "line": 264, "lineto": 264, "args": [ @@ -12422,7 +13209,7 @@ }, "git_oidarray_free": { "type": "function", - "file": "oidarray.h", + "file": "git2/oidarray.h", "line": 34, "lineto": 34, "args": [ @@ -12444,9 +13231,9 @@ }, "git_packbuilder_new": { "type": "function", - "file": "pack.h", - "line": 64, - "lineto": 64, + "file": "git2/pack.h", + "line": 65, + "lineto": 65, "args": [ { "name": "out", @@ -12471,9 +13258,9 @@ }, "git_packbuilder_set_threads": { "type": "function", - "file": "pack.h", - "line": 77, - "lineto": 77, + "file": "git2/pack.h", + "line": 78, + "lineto": 78, "args": [ { "name": "pb", @@ -12498,9 +13285,9 @@ }, "git_packbuilder_insert": { "type": "function", - "file": "pack.h", - "line": 91, - "lineto": 91, + "file": "git2/pack.h", + "line": 92, + "lineto": 92, "args": [ { "name": "pb", @@ -12530,9 +13317,9 @@ }, "git_packbuilder_insert_tree": { "type": "function", - "file": "pack.h", - "line": 103, - "lineto": 103, + "file": "git2/pack.h", + "line": 104, + "lineto": 104, "args": [ { "name": "pb", @@ -12557,9 +13344,9 @@ }, "git_packbuilder_insert_commit": { "type": "function", - "file": "pack.h", - "line": 115, - "lineto": 115, + "file": "git2/pack.h", + "line": 116, + "lineto": 116, "args": [ { "name": "pb", @@ -12584,9 +13371,9 @@ }, "git_packbuilder_insert_walk": { "type": "function", - "file": "pack.h", - "line": 128, - "lineto": 128, + "file": "git2/pack.h", + "line": 129, + "lineto": 129, "args": [ { "name": "pb", @@ -12611,9 +13398,9 @@ }, "git_packbuilder_insert_recur": { "type": "function", - "file": "pack.h", - "line": 140, - "lineto": 140, + "file": "git2/pack.h", + "line": 141, + "lineto": 141, "args": [ { "name": "pb", @@ -12641,11 +13428,38 @@ "comments": "

Insert the object as well as any object it references.

\n", "group": "packbuilder" }, + "git_packbuilder_write_buf": { + "type": "function", + "file": "git2/pack.h", + "line": 152, + "lineto": 152, + "args": [ + { + "name": "buf", + "type": "git_buf *", + "comment": "Buffer where to write the packfile" + }, + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" + } + ], + "argline": "git_buf *buf, git_packbuilder *pb", + "sig": "git_buf *::git_packbuilder *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Write the contents of the packfile to an in-memory buffer

\n", + "comments": "

The contents of the buffer will become a valid packfile, even though there will be no attached index

\n", + "group": "packbuilder" + }, "git_packbuilder_write": { "type": "function", - "file": "pack.h", - "line": 164, - "lineto": 169, + "file": "git2/pack.h", + "line": 165, + "lineto": 170, "args": [ { "name": "pb", @@ -12664,7 +13478,7 @@ }, { "name": "progress_cb", - "type": "git_transfer_progress_cb", + "type": "git_indexer_progress_cb", "comment": "function to call with progress information from the indexer (optional)" }, { @@ -12673,8 +13487,8 @@ "comment": "payload for the progress callback (optional)" } ], - "argline": "git_packbuilder *pb, const char *path, unsigned int mode, git_transfer_progress_cb progress_cb, void *progress_cb_payload", - "sig": "git_packbuilder *::const char *::unsigned int::git_transfer_progress_cb::void *", + "argline": "git_packbuilder *pb, const char *path, unsigned int mode, git_indexer_progress_cb progress_cb, void *progress_cb_payload", + "sig": "git_packbuilder *::const char *::unsigned int::git_indexer_progress_cb::void *", "return": { "type": "int", "comment": " 0 or an error code" @@ -12685,9 +13499,9 @@ }, "git_packbuilder_hash": { "type": "function", - "file": "pack.h", - "line": 179, - "lineto": 179, + "file": "git2/pack.h", + "line": 180, + "lineto": 180, "args": [ { "name": "pb", @@ -12707,9 +13521,9 @@ }, "git_packbuilder_foreach": { "type": "function", - "file": "pack.h", - "line": 191, - "lineto": 191, + "file": "git2/pack.h", + "line": 202, + "lineto": 202, "args": [ { "name": "pb", @@ -12739,9 +13553,9 @@ }, "git_packbuilder_object_count": { "type": "function", - "file": "pack.h", - "line": 199, - "lineto": 199, + "file": "git2/pack.h", + "line": 210, + "lineto": 210, "args": [ { "name": "pb", @@ -12761,9 +13575,9 @@ }, "git_packbuilder_written": { "type": "function", - "file": "pack.h", - "line": 207, - "lineto": 207, + "file": "git2/pack.h", + "line": 218, + "lineto": 218, "args": [ { "name": "pb", @@ -12783,9 +13597,9 @@ }, "git_packbuilder_set_callbacks": { "type": "function", - "file": "pack.h", - "line": 226, - "lineto": 229, + "file": "git2/pack.h", + "line": 237, + "lineto": 240, "args": [ { "name": "pb", @@ -12815,9 +13629,9 @@ }, "git_packbuilder_free": { "type": "function", - "file": "pack.h", - "line": 236, - "lineto": 236, + "file": "git2/pack.h", + "line": 247, + "lineto": 247, "args": [ { "name": "pb", @@ -12837,7 +13651,7 @@ }, "git_patch_from_diff": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 51, "lineto": 52, "args": [ @@ -12869,7 +13683,7 @@ }, "git_patch_from_blobs": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 70, "lineto": 76, "args": [ @@ -12916,7 +13730,7 @@ }, "git_patch_from_blob_and_buffer": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 95, "lineto": 102, "args": [ @@ -12968,7 +13782,7 @@ }, "git_patch_from_buffers": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 122, "lineto": 130, "args": [ @@ -13025,7 +13839,7 @@ }, "git_patch_free": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 135, "lineto": 135, "args": [ @@ -13047,7 +13861,7 @@ }, "git_patch_get_delta": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 141, "lineto": 141, "args": [ @@ -13069,7 +13883,7 @@ }, "git_patch_num_hunks": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 146, "lineto": 146, "args": [ @@ -13091,7 +13905,7 @@ }, "git_patch_line_stats": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 164, "lineto": 168, "args": [ @@ -13128,7 +13942,7 @@ }, "git_patch_get_hunk": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 183, "lineto": 187, "args": [ @@ -13165,7 +13979,7 @@ }, "git_patch_num_lines_in_hunk": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 196, "lineto": 198, "args": [ @@ -13192,7 +14006,7 @@ }, "git_patch_get_line_in_hunk": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 214, "lineto": 218, "args": [ @@ -13229,7 +14043,7 @@ }, "git_patch_size": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 236, "lineto": 240, "args": [ @@ -13266,7 +14080,7 @@ }, "git_patch_print": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 254, "lineto": 257, "args": [ @@ -13298,7 +14112,7 @@ }, "git_patch_to_buf": { "type": "function", - "file": "patch.h", + "file": "git2/patch.h", "line": 266, "lineto": 268, "args": [ @@ -13325,7 +14139,7 @@ }, "git_pathspec_new": { "type": "function", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 82, "lineto": 83, "args": [ @@ -13351,13 +14165,13 @@ "group": "pathspec", "examples": { "log.c": [ - "ex/HEAD/log.html#git_pathspec_new-42" + "ex/HEAD/log.html#git_pathspec_new-40" ] } }, "git_pathspec_free": { "type": "function", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 90, "lineto": 90, "args": [ @@ -13378,13 +14192,13 @@ "group": "pathspec", "examples": { "log.c": [ - "ex/HEAD/log.html#git_pathspec_free-43" + "ex/HEAD/log.html#git_pathspec_free-41" ] } }, "git_pathspec_matches_path": { "type": "function", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 105, "lineto": 106, "args": [ @@ -13416,7 +14230,7 @@ }, "git_pathspec_match_workdir": { "type": "function", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 130, "lineto": 134, "args": [ @@ -13453,7 +14267,7 @@ }, "git_pathspec_match_index": { "type": "function", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 159, "lineto": 163, "args": [ @@ -13490,7 +14304,7 @@ }, "git_pathspec_match_tree": { "type": "function", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 183, "lineto": 187, "args": [ @@ -13526,13 +14340,13 @@ "group": "pathspec", "examples": { "log.c": [ - "ex/HEAD/log.html#git_pathspec_match_tree-44" + "ex/HEAD/log.html#git_pathspec_match_tree-42" ] } }, "git_pathspec_match_diff": { "type": "function", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 207, "lineto": 211, "args": [ @@ -13569,7 +14383,7 @@ }, "git_pathspec_match_list_free": { "type": "function", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 218, "lineto": 218, "args": [ @@ -13591,7 +14405,7 @@ }, "git_pathspec_match_list_entrycount": { "type": "function", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 226, "lineto": 227, "args": [ @@ -13613,7 +14427,7 @@ }, "git_pathspec_match_list_entry": { "type": "function", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 239, "lineto": 240, "args": [ @@ -13640,7 +14454,7 @@ }, "git_pathspec_match_list_diff_entry": { "type": "function", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 252, "lineto": 253, "args": [ @@ -13667,7 +14481,7 @@ }, "git_pathspec_match_list_failed_entrycount": { "type": "function", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 264, "lineto": 265, "args": [ @@ -13689,7 +14503,7 @@ }, "git_pathspec_match_list_failed_entry": { "type": "function", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 276, "lineto": 277, "args": [ @@ -13714,48 +14528,48 @@ "comments": "

This will be return NULL for positions out of range.

\n", "group": "pathspec" }, - "git_proxy_init_options": { + "git_proxy_options_init": { "type": "function", - "file": "proxy.h", - "line": 88, - "lineto": 88, + "file": "git2/proxy.h", + "line": 92, + "lineto": 92, "args": [ { "name": "opts", "type": "git_proxy_options *", - "comment": "the options struct to initialize" + "comment": "The `git_proxy_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "the version of the struct, use `GIT_PROXY_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_PROXY_OPTIONS_VERSION`." } ], "argline": "git_proxy_options *opts, unsigned int version", "sig": "git_proxy_options *::unsigned int", "return": { "type": "int", - "comment": null + "comment": " Zero on success; -1 on failure." }, - "description": "

Initialize a proxy options structure

\n", - "comments": "", + "description": "

Initialize git_proxy_options structure

\n", + "comments": "

Initializes a git_proxy_options with default values. Equivalent to creating an instance with GIT_PROXY_OPTIONS_INIT.

\n", "group": "proxy" }, - "git_rebase_init_options": { + "git_rebase_options_init": { "type": "function", - "file": "rebase.h", - "line": 156, - "lineto": 158, + "file": "git2/rebase.h", + "line": 159, + "lineto": 161, "args": [ { "name": "opts", "type": "git_rebase_options *", - "comment": "the `git_rebase_options` instance to initialize." + "comment": "The `git_rebase_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "the version of the struct; you should pass\n `GIT_REBASE_OPTIONS_VERSION` here." + "comment": "The struct version; pass `GIT_REBASE_OPTIONS_VERSION`." } ], "argline": "git_rebase_options *opts, unsigned int version", @@ -13764,15 +14578,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_rebase_options with default values. Equivalent to\n creating an instance with GIT_REBASE_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_rebase_options structure

\n", + "comments": "

Initializes a git_rebase_options with default values. Equivalent to creating an instance with GIT_REBASE_OPTIONS_INIT.

\n", "group": "rebase" }, "git_rebase_init": { "type": "function", - "file": "rebase.h", - "line": 177, - "lineto": 183, + "file": "git2/rebase.h", + "line": 180, + "lineto": 186, "args": [ { "name": "out", @@ -13817,9 +14631,9 @@ }, "git_rebase_open": { "type": "function", - "file": "rebase.h", - "line": 194, - "lineto": 197, + "file": "git2/rebase.h", + "line": 197, + "lineto": 200, "args": [ { "name": "out", @@ -13847,11 +14661,99 @@ "comments": "", "group": "rebase" }, + "git_rebase_orig_head_name": { + "type": "function", + "file": "git2/rebase.h", + "line": 207, + "lineto": 207, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": null + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { + "type": "const char *", + "comment": " The original `HEAD` ref name" + }, + "description": "

Gets the original HEAD ref name for merge rebases.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_orig_head_id": { + "type": "function", + "file": "git2/rebase.h", + "line": 214, + "lineto": 214, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": null + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { + "type": "const git_oid *", + "comment": " The original `HEAD` id" + }, + "description": "

Gets the original HEAD id for merge rebases.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_onto_name": { + "type": "function", + "file": "git2/rebase.h", + "line": 221, + "lineto": 221, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": null + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { + "type": "const char *", + "comment": " The `onto` ref name" + }, + "description": "

Gets the onto ref name for merge rebases.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_onto_id": { + "type": "function", + "file": "git2/rebase.h", + "line": 228, + "lineto": 228, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": null + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { + "type": "const git_oid *", + "comment": " The `onto` id" + }, + "description": "

Gets the onto id for merge rebases.

\n", + "comments": "", + "group": "rebase" + }, "git_rebase_operation_entrycount": { "type": "function", - "file": "rebase.h", - "line": 205, - "lineto": 205, + "file": "git2/rebase.h", + "line": 236, + "lineto": 236, "args": [ { "name": "rebase", @@ -13871,9 +14773,9 @@ }, "git_rebase_operation_current": { "type": "function", - "file": "rebase.h", - "line": 216, - "lineto": 216, + "file": "git2/rebase.h", + "line": 247, + "lineto": 247, "args": [ { "name": "rebase", @@ -13893,9 +14795,9 @@ }, "git_rebase_operation_byindex": { "type": "function", - "file": "rebase.h", - "line": 225, - "lineto": 227, + "file": "git2/rebase.h", + "line": 256, + "lineto": 258, "args": [ { "name": "rebase", @@ -13920,9 +14822,9 @@ }, "git_rebase_next": { "type": "function", - "file": "rebase.h", - "line": 240, - "lineto": 242, + "file": "git2/rebase.h", + "line": 271, + "lineto": 273, "args": [ { "name": "operation", @@ -13947,9 +14849,9 @@ }, "git_rebase_inmemory_index": { "type": "function", - "file": "rebase.h", - "line": 255, - "lineto": 257, + "file": "git2/rebase.h", + "line": 286, + "lineto": 288, "args": [ { "name": "index", @@ -13974,9 +14876,9 @@ }, "git_rebase_commit": { "type": "function", - "file": "rebase.h", - "line": 281, - "lineto": 287, + "file": "git2/rebase.h", + "line": 312, + "lineto": 318, "args": [ { "name": "id", @@ -14021,9 +14923,9 @@ }, "git_rebase_abort": { "type": "function", - "file": "rebase.h", - "line": 297, - "lineto": 297, + "file": "git2/rebase.h", + "line": 328, + "lineto": 328, "args": [ { "name": "rebase", @@ -14043,9 +14945,9 @@ }, "git_rebase_finish": { "type": "function", - "file": "rebase.h", - "line": 307, - "lineto": 309, + "file": "git2/rebase.h", + "line": 338, + "lineto": 340, "args": [ { "name": "rebase", @@ -14070,9 +14972,9 @@ }, "git_rebase_free": { "type": "function", - "file": "rebase.h", - "line": 316, - "lineto": 316, + "file": "git2/rebase.h", + "line": 347, + "lineto": 347, "args": [ { "name": "rebase", @@ -14092,7 +14994,7 @@ }, "git_refdb_new": { "type": "function", - "file": "refdb.h", + "file": "git2/refdb.h", "line": 35, "lineto": 35, "args": [ @@ -14119,7 +15021,7 @@ }, "git_refdb_open": { "type": "function", - "file": "refdb.h", + "file": "git2/refdb.h", "line": 49, "lineto": 49, "args": [ @@ -14146,7 +15048,7 @@ }, "git_refdb_compress": { "type": "function", - "file": "refdb.h", + "file": "git2/refdb.h", "line": 56, "lineto": 56, "args": [ @@ -14168,7 +15070,7 @@ }, "git_refdb_free": { "type": "function", - "file": "refdb.h", + "file": "git2/refdb.h", "line": 63, "lineto": 63, "args": [ @@ -14190,7 +15092,7 @@ }, "git_reflog_read": { "type": "function", - "file": "reflog.h", + "file": "git2/reflog.h", "line": 38, "lineto": 38, "args": [ @@ -14222,7 +15124,7 @@ }, "git_reflog_write": { "type": "function", - "file": "reflog.h", + "file": "git2/reflog.h", "line": 47, "lineto": 47, "args": [ @@ -14244,7 +15146,7 @@ }, "git_reflog_append": { "type": "function", - "file": "reflog.h", + "file": "git2/reflog.h", "line": 60, "lineto": 60, "args": [ @@ -14281,7 +15183,7 @@ }, "git_reflog_rename": { "type": "function", - "file": "reflog.h", + "file": "git2/reflog.h", "line": 75, "lineto": 75, "args": [ @@ -14313,7 +15215,7 @@ }, "git_reflog_delete": { "type": "function", - "file": "reflog.h", + "file": "git2/reflog.h", "line": 84, "lineto": 84, "args": [ @@ -14340,7 +15242,7 @@ }, "git_reflog_entrycount": { "type": "function", - "file": "reflog.h", + "file": "git2/reflog.h", "line": 92, "lineto": 92, "args": [ @@ -14362,7 +15264,7 @@ }, "git_reflog_entry_byindex": { "type": "function", - "file": "reflog.h", + "file": "git2/reflog.h", "line": 105, "lineto": 105, "args": [ @@ -14389,7 +15291,7 @@ }, "git_reflog_drop": { "type": "function", - "file": "reflog.h", + "file": "git2/reflog.h", "line": 124, "lineto": 127, "args": [ @@ -14421,7 +15323,7 @@ }, "git_reflog_entry_id_old": { "type": "function", - "file": "reflog.h", + "file": "git2/reflog.h", "line": 135, "lineto": 135, "args": [ @@ -14443,7 +15345,7 @@ }, "git_reflog_entry_id_new": { "type": "function", - "file": "reflog.h", + "file": "git2/reflog.h", "line": 143, "lineto": 143, "args": [ @@ -14465,7 +15367,7 @@ }, "git_reflog_entry_committer": { "type": "function", - "file": "reflog.h", + "file": "git2/reflog.h", "line": 151, "lineto": 151, "args": [ @@ -14487,7 +15389,7 @@ }, "git_reflog_entry_message": { "type": "function", - "file": "reflog.h", + "file": "git2/reflog.h", "line": 159, "lineto": 159, "args": [ @@ -14509,7 +15411,7 @@ }, "git_reflog_free": { "type": "function", - "file": "reflog.h", + "file": "git2/reflog.h", "line": 166, "lineto": 166, "args": [ @@ -14531,7 +15433,7 @@ }, "git_reference_lookup": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 37, "lineto": 37, "args": [ @@ -14565,13 +15467,13 @@ "ex/HEAD/general.html#git_reference_lookup-62" ], "merge.c": [ - "ex/HEAD/merge.html#git_reference_lookup-26" + "ex/HEAD/merge.html#git_reference_lookup-21" ] } }, "git_reference_name_to_id": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 54, "lineto": 55, "args": [ @@ -14603,7 +15505,7 @@ }, "git_reference_dwim": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 68, "lineto": 68, "args": [ @@ -14634,14 +15536,13 @@ "group": "reference", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_reference_dwim-27", - "ex/HEAD/merge.html#git_reference_dwim-28" + "ex/HEAD/merge.html#git_reference_dwim-22" ] } }, "git_reference_symbolic_create_matching": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 109, "lineto": 109, "args": [ @@ -14693,7 +15594,7 @@ }, "git_reference_symbolic_create": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 145, "lineto": 145, "args": [ @@ -14740,7 +15641,7 @@ }, "git_reference_create": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 182, "lineto": 182, "args": [ @@ -14786,13 +15687,13 @@ "group": "reference", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_reference_create-29" + "ex/HEAD/merge.html#git_reference_create-23" ] } }, "git_reference_create_matching": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 225, "lineto": 225, "args": [ @@ -14844,7 +15745,7 @@ }, "git_reference_target": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 240, "lineto": 240, "args": [ @@ -14871,7 +15772,7 @@ }, "git_reference_target_peel": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 251, "lineto": 251, "args": [ @@ -14893,7 +15794,7 @@ }, "git_reference_symbolic_target": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 261, "lineto": 261, "args": [ @@ -14917,13 +15818,13 @@ "ex/HEAD/general.html#git_reference_symbolic_target-64" ], "merge.c": [ - "ex/HEAD/merge.html#git_reference_symbolic_target-30" + "ex/HEAD/merge.html#git_reference_symbolic_target-24" ] } }, "git_reference_type": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 271, "lineto": 271, "args": [ @@ -14936,11 +15837,11 @@ "argline": "const git_reference *ref", "sig": "const git_reference *", "return": { - "type": "git_ref_t", + "type": "git_reference_t", "comment": " the type" }, "description": "

Get the type of a reference.

\n", - "comments": "

Either direct (GIT_REF_OID) or symbolic (GIT_REF_SYMBOLIC)

\n", + "comments": "

Either direct (GIT_REFERENCE_DIRECT) or symbolic (GIT_REFERENCE_SYMBOLIC)

\n", "group": "reference", "examples": { "general.c": [ @@ -14950,7 +15851,7 @@ }, "git_reference_name": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 281, "lineto": 281, "args": [ @@ -14971,13 +15872,13 @@ "group": "reference", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_reference_name-31" + "ex/HEAD/merge.html#git_reference_name-25" ] } }, "git_reference_resolve": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 299, "lineto": 299, "args": [ @@ -15004,7 +15905,7 @@ }, "git_reference_owner": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 307, "lineto": 307, "args": [ @@ -15026,7 +15927,7 @@ }, "git_reference_symbolic_set_target": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 329, "lineto": 333, "args": [ @@ -15063,7 +15964,7 @@ }, "git_reference_set_target": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 349, "lineto": 353, "args": [ @@ -15099,13 +16000,13 @@ "group": "reference", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_reference_set_target-32" + "ex/HEAD/merge.html#git_reference_set_target-26" ] } }, "git_reference_rename": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 378, "lineto": 383, "args": [ @@ -15147,7 +16048,7 @@ }, "git_reference_delete": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 398, "lineto": 398, "args": [ @@ -15169,7 +16070,7 @@ }, "git_reference_remove": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 409, "lineto": 409, "args": [ @@ -15196,7 +16097,7 @@ }, "git_reference_list": { "type": "function", - "file": "refs.h", + "file": "git2/refs.h", "line": 423, "lineto": 423, "args": [ @@ -15228,9 +16129,9 @@ }, "git_reference_foreach": { "type": "function", - "file": "refs.h", - "line": 444, - "lineto": 447, + "file": "git2/refs.h", + "line": 463, + "lineto": 466, "args": [ { "name": "repo", @@ -15260,9 +16161,9 @@ }, "git_reference_foreach_name": { "type": "function", - "file": "refs.h", - "line": 462, - "lineto": 465, + "file": "git2/refs.h", + "line": 481, + "lineto": 484, "args": [ { "name": "repo", @@ -15292,9 +16193,9 @@ }, "git_reference_dup": { "type": "function", - "file": "refs.h", - "line": 476, - "lineto": 476, + "file": "git2/refs.h", + "line": 495, + "lineto": 495, "args": [ { "name": "dest", @@ -15319,9 +16220,9 @@ }, "git_reference_free": { "type": "function", - "file": "refs.h", - "line": 483, - "lineto": 483, + "file": "git2/refs.h", + "line": 502, + "lineto": 502, "args": [ { "name": "ref", @@ -15343,21 +16244,20 @@ "ex/HEAD/general.html#git_reference_free-67" ], "merge.c": [ - "ex/HEAD/merge.html#git_reference_free-33", - "ex/HEAD/merge.html#git_reference_free-34", - "ex/HEAD/merge.html#git_reference_free-35", - "ex/HEAD/merge.html#git_reference_free-36" + "ex/HEAD/merge.html#git_reference_free-27", + "ex/HEAD/merge.html#git_reference_free-28", + "ex/HEAD/merge.html#git_reference_free-29" ], "status.c": [ - "ex/HEAD/status.html#git_reference_free-3" + "ex/HEAD/status.html#git_reference_free-1" ] } }, "git_reference_cmp": { "type": "function", - "file": "refs.h", - "line": 492, - "lineto": 494, + "file": "git2/refs.h", + "line": 511, + "lineto": 513, "args": [ { "name": "ref1", @@ -15382,9 +16282,9 @@ }, "git_reference_iterator_new": { "type": "function", - "file": "refs.h", - "line": 503, - "lineto": 505, + "file": "git2/refs.h", + "line": 522, + "lineto": 524, "args": [ { "name": "out", @@ -15409,9 +16309,9 @@ }, "git_reference_iterator_glob_new": { "type": "function", - "file": "refs.h", - "line": 516, - "lineto": 519, + "file": "git2/refs.h", + "line": 535, + "lineto": 538, "args": [ { "name": "out", @@ -15441,9 +16341,9 @@ }, "git_reference_next": { "type": "function", - "file": "refs.h", - "line": 528, - "lineto": 528, + "file": "git2/refs.h", + "line": 547, + "lineto": 547, "args": [ { "name": "out", @@ -15468,9 +16368,9 @@ }, "git_reference_next_name": { "type": "function", - "file": "refs.h", - "line": 541, - "lineto": 541, + "file": "git2/refs.h", + "line": 560, + "lineto": 560, "args": [ { "name": "out", @@ -15495,9 +16395,9 @@ }, "git_reference_iterator_free": { "type": "function", - "file": "refs.h", - "line": 548, - "lineto": 548, + "file": "git2/refs.h", + "line": 567, + "lineto": 567, "args": [ { "name": "iter", @@ -15517,9 +16417,9 @@ }, "git_reference_foreach_glob": { "type": "function", - "file": "refs.h", - "line": 568, - "lineto": 572, + "file": "git2/refs.h", + "line": 587, + "lineto": 591, "args": [ { "name": "repo", @@ -15554,9 +16454,9 @@ }, "git_reference_has_log": { "type": "function", - "file": "refs.h", - "line": 582, - "lineto": 582, + "file": "git2/refs.h", + "line": 601, + "lineto": 601, "args": [ { "name": "repo", @@ -15581,9 +16481,9 @@ }, "git_reference_ensure_log": { "type": "function", - "file": "refs.h", - "line": 594, - "lineto": 594, + "file": "git2/refs.h", + "line": 613, + "lineto": 613, "args": [ { "name": "repo", @@ -15608,9 +16508,9 @@ }, "git_reference_is_branch": { "type": "function", - "file": "refs.h", - "line": 604, - "lineto": 604, + "file": "git2/refs.h", + "line": 623, + "lineto": 623, "args": [ { "name": "ref", @@ -15630,9 +16530,9 @@ }, "git_reference_is_remote": { "type": "function", - "file": "refs.h", - "line": 614, - "lineto": 614, + "file": "git2/refs.h", + "line": 633, + "lineto": 633, "args": [ { "name": "ref", @@ -15652,9 +16552,9 @@ }, "git_reference_is_tag": { "type": "function", - "file": "refs.h", - "line": 624, - "lineto": 624, + "file": "git2/refs.h", + "line": 643, + "lineto": 643, "args": [ { "name": "ref", @@ -15674,9 +16574,9 @@ }, "git_reference_is_note": { "type": "function", - "file": "refs.h", - "line": 634, - "lineto": 634, + "file": "git2/refs.h", + "line": 653, + "lineto": 653, "args": [ { "name": "ref", @@ -15696,9 +16596,9 @@ }, "git_reference_normalize_name": { "type": "function", - "file": "refs.h", - "line": 690, - "lineto": 694, + "file": "git2/refs.h", + "line": 709, + "lineto": 713, "args": [ { "name": "buffer_out", @@ -15718,7 +16618,7 @@ { "name": "flags", "type": "unsigned int", - "comment": "Flags to constrain name validation rules - see the\n GIT_REF_FORMAT constants above." + "comment": "Flags to constrain name validation rules - see the\n GIT_REFERENCE_FORMAT constants above." } ], "argline": "char *buffer_out, size_t buffer_size, const char *name, unsigned int flags", @@ -15733,9 +16633,9 @@ }, "git_reference_peel": { "type": "function", - "file": "refs.h", - "line": 711, - "lineto": 714, + "file": "git2/refs.h", + "line": 730, + "lineto": 733, "args": [ { "name": "out", @@ -15744,35 +16644,35 @@ }, { "name": "ref", - "type": "git_reference *", + "type": "const git_reference *", "comment": "The reference to be processed" }, { "name": "type", - "type": "git_otype", - "comment": "The type of the requested object (GIT_OBJ_COMMIT,\n GIT_OBJ_TAG, GIT_OBJ_TREE, GIT_OBJ_BLOB or GIT_OBJ_ANY)." + "type": "git_object_t", + "comment": "The type of the requested object (GIT_OBJECT_COMMIT,\n GIT_OBJECT_TAG, GIT_OBJECT_TREE, GIT_OBJECT_BLOB or GIT_OBJECT_ANY)." } ], - "argline": "git_object **out, git_reference *ref, git_otype type", - "sig": "git_object **::git_reference *::git_otype", + "argline": "git_object **out, const git_reference *ref, git_object_t type", + "sig": "git_object **::const git_reference *::git_object_t", "return": { "type": "int", "comment": " 0 on success, GIT_EAMBIGUOUS, GIT_ENOTFOUND or an error code" }, "description": "

Recursively peel reference until object of the specified type is found.

\n", - "comments": "

The retrieved peeled object is owned by the repository and should be closed with the git_object_free method.

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object will be peeled until a non-tag object is met.

\n", + "comments": "

The retrieved peeled object is owned by the repository and should be closed with the git_object_free method.

\n\n

If you pass GIT_OBJECT_ANY as the target type, then the object will be peeled until a non-tag object is met.

\n", "group": "reference", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_reference_peel-37" + "ex/HEAD/merge.html#git_reference_peel-30" ] } }, "git_reference_is_valid_name": { "type": "function", - "file": "refs.h", - "line": 730, - "lineto": 730, + "file": "git2/refs.h", + "line": 749, + "lineto": 749, "args": [ { "name": "refname", @@ -15792,9 +16692,9 @@ }, "git_reference_shorthand": { "type": "function", - "file": "refs.h", - "line": 744, - "lineto": 744, + "file": "git2/refs.h", + "line": 763, + "lineto": 763, "args": [ { "name": "ref", @@ -15813,15 +16713,69 @@ "group": "reference", "examples": { "status.c": [ - "ex/HEAD/status.html#git_reference_shorthand-4" + "ex/HEAD/status.html#git_reference_shorthand-2" ] } }, + "git_refspec_parse": { + "type": "function", + "file": "git2/refspec.h", + "line": 32, + "lineto": 32, + "args": [ + { + "name": "refspec", + "type": "git_refspec **", + "comment": "a pointer to hold the refspec handle" + }, + { + "name": "input", + "type": "const char *", + "comment": "the refspec string" + }, + { + "name": "is_fetch", + "type": "int", + "comment": "is this a refspec for a fetch" + } + ], + "argline": "git_refspec **refspec, const char *input, int is_fetch", + "sig": "git_refspec **::const char *::int", + "return": { + "type": "int", + "comment": " 0 if the refspec string could be parsed, -1 otherwise" + }, + "description": "

Parse a given refspec string

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_free": { + "type": "function", + "file": "git2/refspec.h", + "line": 39, + "lineto": 39, + "args": [ + { + "name": "refspec", + "type": "git_refspec *", + "comment": "the refspec object" + } + ], + "argline": "git_refspec *refspec", + "sig": "git_refspec *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free a refspec object which has been created by git_refspec_parse

\n", + "comments": "", + "group": "refspec" + }, "git_refspec_src": { "type": "function", - "file": "refspec.h", - "line": 30, - "lineto": 30, + "file": "git2/refspec.h", + "line": 47, + "lineto": 47, "args": [ { "name": "refspec", @@ -15841,9 +16795,9 @@ }, "git_refspec_dst": { "type": "function", - "file": "refspec.h", - "line": 38, - "lineto": 38, + "file": "git2/refspec.h", + "line": 55, + "lineto": 55, "args": [ { "name": "refspec", @@ -15863,9 +16817,9 @@ }, "git_refspec_string": { "type": "function", - "file": "refspec.h", - "line": 46, - "lineto": 46, + "file": "git2/refspec.h", + "line": 63, + "lineto": 63, "args": [ { "name": "refspec", @@ -15885,9 +16839,9 @@ }, "git_refspec_force": { "type": "function", - "file": "refspec.h", - "line": 54, - "lineto": 54, + "file": "git2/refspec.h", + "line": 71, + "lineto": 71, "args": [ { "name": "refspec", @@ -15907,9 +16861,9 @@ }, "git_refspec_direction": { "type": "function", - "file": "refspec.h", - "line": 62, - "lineto": 62, + "file": "git2/refspec.h", + "line": 79, + "lineto": 79, "args": [ { "name": "spec", @@ -15929,9 +16883,9 @@ }, "git_refspec_src_matches": { "type": "function", - "file": "refspec.h", - "line": 71, - "lineto": 71, + "file": "git2/refspec.h", + "line": 88, + "lineto": 88, "args": [ { "name": "refspec", @@ -15956,9 +16910,9 @@ }, "git_refspec_dst_matches": { "type": "function", - "file": "refspec.h", - "line": 80, - "lineto": 80, + "file": "git2/refspec.h", + "line": 97, + "lineto": 97, "args": [ { "name": "refspec", @@ -15983,9 +16937,9 @@ }, "git_refspec_transform": { "type": "function", - "file": "refspec.h", - "line": 90, - "lineto": 90, + "file": "git2/refspec.h", + "line": 107, + "lineto": 107, "args": [ { "name": "out", @@ -16015,9 +16969,9 @@ }, "git_refspec_rtransform": { "type": "function", - "file": "refspec.h", - "line": 100, - "lineto": 100, + "file": "git2/refspec.h", + "line": 117, + "lineto": 117, "args": [ { "name": "out", @@ -16047,7 +17001,7 @@ }, "git_remote_create": { "type": "function", - "file": "remote.h", + "file": "git2/remote.h", "line": 38, "lineto": 42, "args": [ @@ -16083,15 +17037,74 @@ "group": "remote", "examples": { "remote.c": [ - "ex/HEAD/remote.html#git_remote_create-4" + "ex/HEAD/remote.html#git_remote_create-1" ] } }, + "git_remote_create_options_init": { + "type": "function", + "file": "git2/remote.h", + "line": 97, + "lineto": 99, + "args": [ + { + "name": "opts", + "type": "git_remote_create_options *", + "comment": "The `git_remote_create_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_REMOTE_CREATE_OPTIONS_VERSION`." + } + ], + "argline": "git_remote_create_options *opts, unsigned int version", + "sig": "git_remote_create_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_remote_create_options structure

\n", + "comments": "

Initializes a git_remote_create_options with default values. Equivalent to creating an instance with GIT_REMOTE_CREATE_OPTIONS_INIT.

\n", + "group": "remote" + }, + "git_remote_create_with_opts": { + "type": "function", + "file": "git2/remote.h", + "line": 113, + "lineto": 116, + "args": [ + { + "name": "out", + "type": "git_remote **", + "comment": "the resulting remote" + }, + { + "name": "url", + "type": "const char *", + "comment": "the remote's url" + }, + { + "name": "opts", + "type": "const git_remote_create_options *", + "comment": "the remote creation options" + } + ], + "argline": "git_remote **out, const char *url, const git_remote_create_options *opts", + "sig": "git_remote **::const char *::const git_remote_create_options *", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + }, + "description": "

Create a remote, with options.

\n", + "comments": "

This function allows more fine-grained control over the remote creation.

\n\n

Passing NULL as the opts argument will result in a detached remote.

\n", + "group": "remote" + }, "git_remote_create_with_fetchspec": { "type": "function", - "file": "remote.h", - "line": 55, - "lineto": 60, + "file": "git2/remote.h", + "line": 129, + "lineto": 134, "args": [ { "name": "out", @@ -16131,9 +17144,9 @@ }, "git_remote_create_anonymous": { "type": "function", - "file": "remote.h", - "line": 73, - "lineto": 76, + "file": "git2/remote.h", + "line": 147, + "lineto": 150, "args": [ { "name": "out", @@ -16161,19 +17174,19 @@ "comments": "

Create a remote with the given url in-memory. You can use this when you have a URL instead of a remote's name.

\n", "group": "remote", "examples": { - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_remote_create_anonymous-4" + "fetch.c": [ + "ex/HEAD/fetch.html#git_remote_create_anonymous-4" ], - "network/ls-remote.c": [ - "ex/HEAD/network/ls-remote.html#git_remote_create_anonymous-2" + "ls-remote.c": [ + "ex/HEAD/ls-remote.html#git_remote_create_anonymous-2" ] } }, "git_remote_create_detached": { "type": "function", - "file": "remote.h", - "line": 92, - "lineto": 94, + "file": "git2/remote.h", + "line": 166, + "lineto": 168, "args": [ { "name": "out", @@ -16198,9 +17211,9 @@ }, "git_remote_lookup": { "type": "function", - "file": "remote.h", - "line": 107, - "lineto": 107, + "file": "git2/remote.h", + "line": 181, + "lineto": 181, "args": [ { "name": "out", @@ -16228,22 +17241,22 @@ "comments": "

The name will be checked for validity. See git_tag_create() for rules about valid names.

\n", "group": "remote", "examples": { - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_remote_lookup-5" + "fetch.c": [ + "ex/HEAD/fetch.html#git_remote_lookup-5" ], - "network/ls-remote.c": [ - "ex/HEAD/network/ls-remote.html#git_remote_lookup-3" + "ls-remote.c": [ + "ex/HEAD/ls-remote.html#git_remote_lookup-3" ], "remote.c": [ - "ex/HEAD/remote.html#git_remote_lookup-5" + "ex/HEAD/remote.html#git_remote_lookup-2" ] } }, "git_remote_dup": { "type": "function", - "file": "remote.h", - "line": 119, - "lineto": 119, + "file": "git2/remote.h", + "line": 193, + "lineto": 193, "args": [ { "name": "dest", @@ -16268,9 +17281,9 @@ }, "git_remote_owner": { "type": "function", - "file": "remote.h", - "line": 127, - "lineto": 127, + "file": "git2/remote.h", + "line": 201, + "lineto": 201, "args": [ { "name": "remote", @@ -16290,9 +17303,9 @@ }, "git_remote_name": { "type": "function", - "file": "remote.h", - "line": 135, - "lineto": 135, + "file": "git2/remote.h", + "line": 209, + "lineto": 209, "args": [ { "name": "remote", @@ -16312,9 +17325,9 @@ }, "git_remote_url": { "type": "function", - "file": "remote.h", - "line": 146, - "lineto": 146, + "file": "git2/remote.h", + "line": 220, + "lineto": 220, "args": [ { "name": "remote", @@ -16333,15 +17346,15 @@ "group": "remote", "examples": { "remote.c": [ - "ex/HEAD/remote.html#git_remote_url-6" + "ex/HEAD/remote.html#git_remote_url-3" ] } }, "git_remote_pushurl": { "type": "function", - "file": "remote.h", - "line": 157, - "lineto": 157, + "file": "git2/remote.h", + "line": 231, + "lineto": 231, "args": [ { "name": "remote", @@ -16360,15 +17373,15 @@ "group": "remote", "examples": { "remote.c": [ - "ex/HEAD/remote.html#git_remote_pushurl-7" + "ex/HEAD/remote.html#git_remote_pushurl-4" ] } }, "git_remote_set_url": { "type": "function", - "file": "remote.h", - "line": 170, - "lineto": 170, + "file": "git2/remote.h", + "line": 244, + "lineto": 244, "args": [ { "name": "repo", @@ -16397,15 +17410,15 @@ "group": "remote", "examples": { "remote.c": [ - "ex/HEAD/remote.html#git_remote_set_url-8" + "ex/HEAD/remote.html#git_remote_set_url-5" ] } }, "git_remote_set_pushurl": { "type": "function", - "file": "remote.h", - "line": 183, - "lineto": 183, + "file": "git2/remote.h", + "line": 257, + "lineto": 257, "args": [ { "name": "repo", @@ -16434,15 +17447,15 @@ "group": "remote", "examples": { "remote.c": [ - "ex/HEAD/remote.html#git_remote_set_pushurl-9" + "ex/HEAD/remote.html#git_remote_set_pushurl-6" ] } }, "git_remote_add_fetch": { "type": "function", - "file": "remote.h", - "line": 196, - "lineto": 196, + "file": "git2/remote.h", + "line": 270, + "lineto": 270, "args": [ { "name": "repo", @@ -16472,9 +17485,9 @@ }, "git_remote_get_fetch_refspecs": { "type": "function", - "file": "remote.h", - "line": 207, - "lineto": 207, + "file": "git2/remote.h", + "line": 281, + "lineto": 281, "args": [ { "name": "array", @@ -16499,9 +17512,9 @@ }, "git_remote_add_push": { "type": "function", - "file": "remote.h", - "line": 220, - "lineto": 220, + "file": "git2/remote.h", + "line": 294, + "lineto": 294, "args": [ { "name": "repo", @@ -16531,9 +17544,9 @@ }, "git_remote_get_push_refspecs": { "type": "function", - "file": "remote.h", - "line": 231, - "lineto": 231, + "file": "git2/remote.h", + "line": 305, + "lineto": 305, "args": [ { "name": "array", @@ -16558,9 +17571,9 @@ }, "git_remote_refspec_count": { "type": "function", - "file": "remote.h", - "line": 239, - "lineto": 239, + "file": "git2/remote.h", + "line": 313, + "lineto": 313, "args": [ { "name": "remote", @@ -16580,9 +17593,9 @@ }, "git_remote_get_refspec": { "type": "function", - "file": "remote.h", - "line": 248, - "lineto": 248, + "file": "git2/remote.h", + "line": 322, + "lineto": 322, "args": [ { "name": "remote", @@ -16607,9 +17620,9 @@ }, "git_remote_connect": { "type": "function", - "file": "remote.h", - "line": 265, - "lineto": 265, + "file": "git2/remote.h", + "line": 339, + "lineto": 339, "args": [ { "name": "remote", @@ -16647,16 +17660,16 @@ "comments": "

The transport is selected based on the URL. The direction argument is due to a limitation of the git protocol (over TCP or SSH) which starts up a specific binary which can only do the one or the other.

\n", "group": "remote", "examples": { - "network/ls-remote.c": [ - "ex/HEAD/network/ls-remote.html#git_remote_connect-4" + "ls-remote.c": [ + "ex/HEAD/ls-remote.html#git_remote_connect-4" ] } }, "git_remote_ls": { "type": "function", - "file": "remote.h", - "line": 287, - "lineto": 287, + "file": "git2/remote.h", + "line": 361, + "lineto": 361, "args": [ { "name": "out", @@ -16684,16 +17697,16 @@ "comments": "

Get the list of references with which the server responds to a new connection.

\n\n

The remote (or more exactly its transport) must have connected to the remote repository. This list is available as soon as the connection to the remote is initiated and it remains available after disconnecting.

\n\n

The memory belongs to the remote. The pointer will be valid as long as a new connection is not initiated, but it is recommended that you make a copy in order to make use of the data.

\n", "group": "remote", "examples": { - "network/ls-remote.c": [ - "ex/HEAD/network/ls-remote.html#git_remote_ls-5" + "ls-remote.c": [ + "ex/HEAD/ls-remote.html#git_remote_ls-5" ] } }, "git_remote_connected": { "type": "function", - "file": "remote.h", - "line": 298, - "lineto": 298, + "file": "git2/remote.h", + "line": 372, + "lineto": 372, "args": [ { "name": "remote", @@ -16713,9 +17726,9 @@ }, "git_remote_stop": { "type": "function", - "file": "remote.h", - "line": 308, - "lineto": 308, + "file": "git2/remote.h", + "line": 382, + "lineto": 382, "args": [ { "name": "remote", @@ -16735,9 +17748,9 @@ }, "git_remote_disconnect": { "type": "function", - "file": "remote.h", - "line": 317, - "lineto": 317, + "file": "git2/remote.h", + "line": 391, + "lineto": 391, "args": [ { "name": "remote", @@ -16757,9 +17770,9 @@ }, "git_remote_free": { "type": "function", - "file": "remote.h", - "line": 327, - "lineto": 327, + "file": "git2/remote.h", + "line": 401, + "lineto": 401, "args": [ { "name": "remote", @@ -16777,23 +17790,23 @@ "comments": "

This also disconnects from the remote, if the connection has not been closed yet (using git_remote_disconnect).

\n", "group": "remote", "examples": { - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_remote_free-6", - "ex/HEAD/network/fetch.html#git_remote_free-7" + "fetch.c": [ + "ex/HEAD/fetch.html#git_remote_free-6", + "ex/HEAD/fetch.html#git_remote_free-7" ], - "network/ls-remote.c": [ - "ex/HEAD/network/ls-remote.html#git_remote_free-6" + "ls-remote.c": [ + "ex/HEAD/ls-remote.html#git_remote_free-6" ], "remote.c": [ - "ex/HEAD/remote.html#git_remote_free-10" + "ex/HEAD/remote.html#git_remote_free-7" ] } }, "git_remote_list": { "type": "function", - "file": "remote.h", - "line": 338, - "lineto": 338, + "file": "git2/remote.h", + "line": 412, + "lineto": 412, "args": [ { "name": "out", @@ -16817,15 +17830,15 @@ "group": "remote", "examples": { "remote.c": [ - "ex/HEAD/remote.html#git_remote_list-11" + "ex/HEAD/remote.html#git_remote_list-8" ] } }, "git_remote_init_callbacks": { "type": "function", - "file": "remote.h", - "line": 503, - "lineto": 505, + "file": "git2/remote.h", + "line": 599, + "lineto": 601, "args": [ { "name": "opts", @@ -16848,21 +17861,21 @@ "comments": "", "group": "remote" }, - "git_fetch_init_options": { + "git_fetch_options_init": { "type": "function", - "file": "remote.h", - "line": 607, - "lineto": 609, + "file": "git2/remote.h", + "line": 705, + "lineto": 707, "args": [ { "name": "opts", "type": "git_fetch_options *", - "comment": "the `git_fetch_options` instance to initialize." + "comment": "The `git_fetch_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "the version of the struct; you should pass\n `GIT_FETCH_OPTIONS_VERSION` here." + "comment": "The struct version; pass `GIT_FETCH_OPTIONS_VERSION`." } ], "argline": "git_fetch_options *opts, unsigned int version", @@ -16871,25 +17884,25 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_fetch_options with default values. Equivalent to\n creating an instance with GIT_FETCH_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_fetch_options structure

\n", + "comments": "

Initializes a git_fetch_options with default values. Equivalent to creating an instance with GIT_FETCH_OPTIONS_INIT.

\n", "group": "fetch" }, - "git_push_init_options": { + "git_push_options_init": { "type": "function", - "file": "remote.h", - "line": 656, - "lineto": 658, + "file": "git2/remote.h", + "line": 755, + "lineto": 757, "args": [ { "name": "opts", "type": "git_push_options *", - "comment": "the `git_push_options` instance to initialize." + "comment": "The `git_push_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "the version of the struct; you should pass\n `GIT_PUSH_OPTIONS_VERSION` here." + "comment": "The struct version; pass `GIT_PUSH_OPTIONS_VERSION`." } ], "argline": "git_push_options *opts, unsigned int version", @@ -16898,15 +17911,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_push_options with default values. Equivalent to\n creating an instance with GIT_PUSH_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_push_options structure

\n", + "comments": "

Initializes a git_push_options with default values. Equivalent to creating an instance with GIT_PUSH_OPTIONS_INIT.

\n", "group": "push" }, "git_remote_download": { "type": "function", - "file": "remote.h", - "line": 676, - "lineto": 676, + "file": "git2/remote.h", + "line": 775, + "lineto": 775, "args": [ { "name": "remote", @@ -16936,9 +17949,9 @@ }, "git_remote_upload": { "type": "function", - "file": "remote.h", - "line": 690, - "lineto": 690, + "file": "git2/remote.h", + "line": 789, + "lineto": 789, "args": [ { "name": "remote", @@ -16968,9 +17981,9 @@ }, "git_remote_update_tips": { "type": "function", - "file": "remote.h", - "line": 706, - "lineto": 711, + "file": "git2/remote.h", + "line": 805, + "lineto": 810, "args": [ { "name": "remote", @@ -17010,9 +18023,9 @@ }, "git_remote_fetch": { "type": "function", - "file": "remote.h", - "line": 727, - "lineto": 731, + "file": "git2/remote.h", + "line": 826, + "lineto": 830, "args": [ { "name": "remote", @@ -17045,16 +18058,16 @@ "comments": "

Convenience function to connect to a remote, download the data, disconnect and update the remote-tracking branches.

\n", "group": "remote", "examples": { - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_remote_fetch-8" + "fetch.c": [ + "ex/HEAD/fetch.html#git_remote_fetch-8" ] } }, "git_remote_prune": { "type": "function", - "file": "remote.h", - "line": 740, - "lineto": 740, + "file": "git2/remote.h", + "line": 839, + "lineto": 839, "args": [ { "name": "remote", @@ -17079,9 +18092,9 @@ }, "git_remote_push": { "type": "function", - "file": "remote.h", - "line": 752, - "lineto": 754, + "file": "git2/remote.h", + "line": 851, + "lineto": 853, "args": [ { "name": "remote", @@ -17111,9 +18124,9 @@ }, "git_remote_stats": { "type": "function", - "file": "remote.h", - "line": 759, - "lineto": 759, + "file": "git2/remote.h", + "line": 858, + "lineto": 858, "args": [ { "name": "remote", @@ -17124,23 +18137,23 @@ "argline": "git_remote *remote", "sig": "git_remote *", "return": { - "type": "const git_transfer_progress *", + "type": "const git_indexer_progress *", "comment": null }, "description": "

Get the statistics structure that is filled in by the fetch operation.

\n", "comments": "", "group": "remote", "examples": { - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_remote_stats-9" + "fetch.c": [ + "ex/HEAD/fetch.html#git_remote_stats-9" ] } }, "git_remote_autotag": { "type": "function", - "file": "remote.h", - "line": 767, - "lineto": 767, + "file": "git2/remote.h", + "line": 866, + "lineto": 866, "args": [ { "name": "remote", @@ -17160,9 +18173,9 @@ }, "git_remote_set_autotag": { "type": "function", - "file": "remote.h", - "line": 779, - "lineto": 779, + "file": "git2/remote.h", + "line": 878, + "lineto": 878, "args": [ { "name": "repo", @@ -17192,9 +18205,9 @@ }, "git_remote_prune_refs": { "type": "function", - "file": "remote.h", - "line": 786, - "lineto": 786, + "file": "git2/remote.h", + "line": 885, + "lineto": 885, "args": [ { "name": "remote", @@ -17214,9 +18227,9 @@ }, "git_remote_rename": { "type": "function", - "file": "remote.h", - "line": 808, - "lineto": 812, + "file": "git2/remote.h", + "line": 907, + "lineto": 911, "args": [ { "name": "problems", @@ -17250,15 +18263,15 @@ "group": "remote", "examples": { "remote.c": [ - "ex/HEAD/remote.html#git_remote_rename-12" + "ex/HEAD/remote.html#git_remote_rename-9" ] } }, "git_remote_is_valid_name": { "type": "function", - "file": "remote.h", - "line": 820, - "lineto": 820, + "file": "git2/remote.h", + "line": 919, + "lineto": 919, "args": [ { "name": "remote_name", @@ -17278,9 +18291,9 @@ }, "git_remote_delete": { "type": "function", - "file": "remote.h", - "line": 832, - "lineto": 832, + "file": "git2/remote.h", + "line": 931, + "lineto": 931, "args": [ { "name": "repo", @@ -17304,15 +18317,15 @@ "group": "remote", "examples": { "remote.c": [ - "ex/HEAD/remote.html#git_remote_delete-13" + "ex/HEAD/remote.html#git_remote_delete-10" ] } }, "git_remote_default_branch": { "type": "function", - "file": "remote.h", - "line": 850, - "lineto": 850, + "file": "git2/remote.h", + "line": 949, + "lineto": 949, "args": [ { "name": "out", @@ -17337,7 +18350,7 @@ }, "git_repository_open": { "type": "function", - "file": "repository.h", + "file": "git2/repository.h", "line": 37, "lineto": 37, "args": [ @@ -17364,15 +18377,12 @@ "examples": { "general.c": [ "ex/HEAD/general.html#git_repository_open-68" - ], - "remote.c": [ - "ex/HEAD/remote.html#git_repository_open-14" ] } }, "git_repository_open_from_worktree": { "type": "function", - "file": "repository.h", + "file": "git2/repository.h", "line": 48, "lineto": 48, "args": [ @@ -17399,7 +18409,7 @@ }, "git_repository_wrap_odb": { "type": "function", - "file": "repository.h", + "file": "git2/repository.h", "line": 61, "lineto": 61, "args": [ @@ -17426,7 +18436,7 @@ }, "git_repository_discover": { "type": "function", - "file": "repository.h", + "file": "git2/repository.h", "line": 89, "lineto": 93, "args": [ @@ -17459,18 +18469,13 @@ }, "description": "

Look for a git repository and copy its path in the given buffer.\n The lookup start from base_path and walk across parent directories\n if nothing has been found. The lookup ends when the first repository\n is found, or when reaching a directory referenced in ceiling_dirs\n or when the filesystem changes (in case across_fs is true).

\n", "comments": "

The method will automatically detect if the repository is bare (if there is a repository).

\n", - "group": "repository", - "examples": { - "remote.c": [ - "ex/HEAD/remote.html#git_repository_discover-15" - ] - } + "group": "repository" }, "git_repository_open_ext": { "type": "function", - "file": "repository.h", - "line": 152, - "lineto": 156, + "file": "git2/repository.h", + "line": 165, + "lineto": 169, "args": [ { "name": "out", @@ -17503,41 +18508,16 @@ "comments": "", "group": "repository", "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_repository_open_ext-24" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_repository_open_ext-31" - ], - "describe.c": [ - "ex/HEAD/describe.html#git_repository_open_ext-6" - ], - "diff.c": [ - "ex/HEAD/diff.html#git_repository_open_ext-15" - ], "log.c": [ - "ex/HEAD/log.html#git_repository_open_ext-45", - "ex/HEAD/log.html#git_repository_open_ext-46" - ], - "merge.c": [ - "ex/HEAD/merge.html#git_repository_open_ext-38" - ], - "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_repository_open_ext-16" - ], - "status.c": [ - "ex/HEAD/status.html#git_repository_open_ext-5" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_repository_open_ext-11" + "ex/HEAD/log.html#git_repository_open_ext-43" ] } }, "git_repository_open_bare": { "type": "function", - "file": "repository.h", - "line": 169, - "lineto": 169, + "file": "git2/repository.h", + "line": 182, + "lineto": 182, "args": [ { "name": "out", @@ -17562,9 +18542,9 @@ }, "git_repository_free": { "type": "function", - "file": "repository.h", - "line": 182, - "lineto": 182, + "file": "git2/repository.h", + "line": 195, + "lineto": 195, "args": [ { "name": "repo", @@ -17582,49 +18562,19 @@ "comments": "

Note that after a repository is free'd, all the objects it has spawned will still exist until they are manually closed by the user with git_object_free, but accessing any of the attributes of an object without a backing repository will result in undefined behavior

\n", "group": "repository", "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_repository_free-25" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_repository_free-32" - ], - "describe.c": [ - "ex/HEAD/describe.html#git_repository_free-7" - ], - "diff.c": [ - "ex/HEAD/diff.html#git_repository_free-16" - ], "general.c": [ "ex/HEAD/general.html#git_repository_free-69" ], "init.c": [ - "ex/HEAD/init.html#git_repository_free-6" - ], - "log.c": [ - "ex/HEAD/log.html#git_repository_free-47" - ], - "merge.c": [ - "ex/HEAD/merge.html#git_repository_free-39" - ], - "network/clone.c": [ - "ex/HEAD/network/clone.html#git_repository_free-3" - ], - "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_repository_free-17" - ], - "status.c": [ - "ex/HEAD/status.html#git_repository_free-6" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_repository_free-12" + "ex/HEAD/init.html#git_repository_free-4" ] } }, "git_repository_init": { "type": "function", - "file": "repository.h", - "line": 199, - "lineto": 202, + "file": "git2/repository.h", + "line": 212, + "lineto": 215, "args": [ { "name": "out", @@ -17653,25 +18603,25 @@ "group": "repository", "examples": { "init.c": [ - "ex/HEAD/init.html#git_repository_init-7" + "ex/HEAD/init.html#git_repository_init-5" ] } }, - "git_repository_init_init_options": { + "git_repository_init_options_init": { "type": "function", - "file": "repository.h", - "line": 311, - "lineto": 313, + "file": "git2/repository.h", + "line": 326, + "lineto": 328, "args": [ { "name": "opts", "type": "git_repository_init_options *", - "comment": "the `git_repository_init_options` struct to initialize" + "comment": "The `git_repository_init_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_REPOSITORY_INIT_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_REPOSITORY_INIT_OPTIONS_VERSION`." } ], "argline": "git_repository_init_options *opts, unsigned int version", @@ -17680,15 +18630,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_repository_init_options with default values. Equivalent\n to creating an instance with GIT_REPOSITORY_INIT_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_repository_init_options structure

\n", + "comments": "

Initializes a git_repository_init_options with default values. Equivalent to creating an instance with GIT_REPOSITORY_INIT_OPTIONS_INIT.

\n", "group": "repository" }, "git_repository_init_ext": { "type": "function", - "file": "repository.h", - "line": 328, - "lineto": 331, + "file": "git2/repository.h", + "line": 343, + "lineto": 346, "args": [ { "name": "out", @@ -17717,15 +18667,15 @@ "group": "repository", "examples": { "init.c": [ - "ex/HEAD/init.html#git_repository_init_ext-8" + "ex/HEAD/init.html#git_repository_init_ext-6" ] } }, "git_repository_head": { "type": "function", - "file": "repository.h", - "line": 346, - "lineto": 346, + "file": "git2/repository.h", + "line": 361, + "lineto": 361, "args": [ { "name": "out", @@ -17749,19 +18699,19 @@ "group": "repository", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_repository_head-40", - "ex/HEAD/merge.html#git_repository_head-41" + "ex/HEAD/merge.html#git_repository_head-31", + "ex/HEAD/merge.html#git_repository_head-32" ], "status.c": [ - "ex/HEAD/status.html#git_repository_head-7" + "ex/HEAD/status.html#git_repository_head-3" ] } }, "git_repository_head_for_worktree": { "type": "function", - "file": "repository.h", - "line": 356, - "lineto": 357, + "file": "git2/repository.h", + "line": 371, + "lineto": 372, "args": [ { "name": "out", @@ -17791,9 +18741,9 @@ }, "git_repository_head_detached": { "type": "function", - "file": "repository.h", - "line": 369, - "lineto": 369, + "file": "git2/repository.h", + "line": 384, + "lineto": 384, "args": [ { "name": "repo", @@ -17811,11 +18761,38 @@ "comments": "

A repository's HEAD is detached when it points directly to a commit instead of a branch.

\n", "group": "repository" }, + "git_repository_head_detached_for_worktree": { + "type": "function", + "file": "git2/repository.h", + "line": 397, + "lineto": 398, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "a repository object" + }, + { + "name": "name", + "type": "const char *", + "comment": "name of the worktree to retrieve HEAD for" + } + ], + "argline": "git_repository *repo, const char *name", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 1 if HEAD is detached, 0 if its not; error code if\n there was an error" + }, + "description": "

Check if a worktree's HEAD is detached

\n", + "comments": "

A worktree's HEAD is detached when it points directly to a commit instead of a branch.

\n", + "group": "repository" + }, "git_repository_head_unborn": { "type": "function", - "file": "repository.h", - "line": 395, - "lineto": 395, + "file": "git2/repository.h", + "line": 410, + "lineto": 410, "args": [ { "name": "repo", @@ -17835,9 +18812,9 @@ }, "git_repository_is_empty": { "type": "function", - "file": "repository.h", - "line": 407, - "lineto": 407, + "file": "git2/repository.h", + "line": 422, + "lineto": 422, "args": [ { "name": "repo", @@ -17857,9 +18834,9 @@ }, "git_repository_item_path": { "type": "function", - "file": "repository.h", - "line": 443, - "lineto": 443, + "file": "git2/repository.h", + "line": 459, + "lineto": 459, "args": [ { "name": "out", @@ -17889,9 +18866,9 @@ }, "git_repository_path": { "type": "function", - "file": "repository.h", - "line": 454, - "lineto": 454, + "file": "git2/repository.h", + "line": 470, + "lineto": 470, "args": [ { "name": "repo", @@ -17910,18 +18887,18 @@ "group": "repository", "examples": { "init.c": [ - "ex/HEAD/init.html#git_repository_path-9" + "ex/HEAD/init.html#git_repository_path-7" ], "status.c": [ - "ex/HEAD/status.html#git_repository_path-8" + "ex/HEAD/status.html#git_repository_path-4" ] } }, "git_repository_workdir": { "type": "function", - "file": "repository.h", - "line": 465, - "lineto": 465, + "file": "git2/repository.h", + "line": 481, + "lineto": 481, "args": [ { "name": "repo", @@ -17940,15 +18917,15 @@ "group": "repository", "examples": { "init.c": [ - "ex/HEAD/init.html#git_repository_workdir-10" + "ex/HEAD/init.html#git_repository_workdir-8" ] } }, "git_repository_commondir": { "type": "function", - "file": "repository.h", - "line": 476, - "lineto": 476, + "file": "git2/repository.h", + "line": 492, + "lineto": 492, "args": [ { "name": "repo", @@ -17968,9 +18945,9 @@ }, "git_repository_set_workdir": { "type": "function", - "file": "repository.h", - "line": 495, - "lineto": 496, + "file": "git2/repository.h", + "line": 511, + "lineto": 512, "args": [ { "name": "repo", @@ -18000,9 +18977,9 @@ }, "git_repository_is_bare": { "type": "function", - "file": "repository.h", - "line": 504, - "lineto": 504, + "file": "git2/repository.h", + "line": 520, + "lineto": 520, "args": [ { "name": "repo", @@ -18021,15 +18998,15 @@ "group": "repository", "examples": { "status.c": [ - "ex/HEAD/status.html#git_repository_is_bare-9" + "ex/HEAD/status.html#git_repository_is_bare-5" ] } }, "git_repository_is_worktree": { "type": "function", - "file": "repository.h", - "line": 512, - "lineto": 512, + "file": "git2/repository.h", + "line": 528, + "lineto": 528, "args": [ { "name": "repo", @@ -18049,9 +19026,9 @@ }, "git_repository_config": { "type": "function", - "file": "repository.h", - "line": 528, - "lineto": 528, + "file": "git2/repository.h", + "line": 544, + "lineto": 544, "args": [ { "name": "out", @@ -18076,9 +19053,9 @@ }, "git_repository_config_snapshot": { "type": "function", - "file": "repository.h", - "line": 544, - "lineto": 544, + "file": "git2/repository.h", + "line": 560, + "lineto": 560, "args": [ { "name": "out", @@ -18109,9 +19086,9 @@ }, "git_repository_odb": { "type": "function", - "file": "repository.h", - "line": 560, - "lineto": 560, + "file": "git2/repository.h", + "line": 576, + "lineto": 576, "args": [ { "name": "out", @@ -18135,7 +19112,7 @@ "group": "repository", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_repository_odb-33" + "ex/HEAD/cat-file.html#git_repository_odb-29" ], "general.c": [ "ex/HEAD/general.html#git_repository_odb-72" @@ -18144,9 +19121,9 @@ }, "git_repository_refdb": { "type": "function", - "file": "repository.h", - "line": 576, - "lineto": 576, + "file": "git2/repository.h", + "line": 592, + "lineto": 592, "args": [ { "name": "out", @@ -18171,9 +19148,9 @@ }, "git_repository_index": { "type": "function", - "file": "repository.h", - "line": 592, - "lineto": 592, + "file": "git2/repository.h", + "line": 608, + "lineto": 608, "args": [ { "name": "out", @@ -18196,22 +19173,28 @@ "comments": "

If a custom index has not been set, the default index for the repository will be returned (the one located in .git/index).

\n\n

The index must be freed once it's no longer being used by the user.

\n", "group": "repository", "examples": { + "add.c": [ + "ex/HEAD/add.html#git_repository_index-5" + ], "general.c": [ "ex/HEAD/general.html#git_repository_index-73" ], "init.c": [ - "ex/HEAD/init.html#git_repository_index-11" + "ex/HEAD/init.html#git_repository_index-9" + ], + "ls-files.c": [ + "ex/HEAD/ls-files.html#git_repository_index-5" ], "merge.c": [ - "ex/HEAD/merge.html#git_repository_index-42" + "ex/HEAD/merge.html#git_repository_index-33" ] } }, "git_repository_message": { "type": "function", - "file": "repository.h", - "line": 610, - "lineto": 610, + "file": "git2/repository.h", + "line": 626, + "lineto": 626, "args": [ { "name": "out", @@ -18236,9 +19219,9 @@ }, "git_repository_message_remove": { "type": "function", - "file": "repository.h", - "line": 617, - "lineto": 617, + "file": "git2/repository.h", + "line": 633, + "lineto": 633, "args": [ { "name": "repo", @@ -18258,9 +19241,9 @@ }, "git_repository_state_cleanup": { "type": "function", - "file": "repository.h", - "line": 626, - "lineto": 626, + "file": "git2/repository.h", + "line": 642, + "lineto": 642, "args": [ { "name": "repo", @@ -18279,15 +19262,15 @@ "group": "repository", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_repository_state_cleanup-43" + "ex/HEAD/merge.html#git_repository_state_cleanup-34" ] } }, "git_repository_fetchhead_foreach": { "type": "function", - "file": "repository.h", - "line": 645, - "lineto": 648, + "file": "git2/repository.h", + "line": 673, + "lineto": 676, "args": [ { "name": "repo", @@ -18317,9 +19300,9 @@ }, "git_repository_mergehead_foreach": { "type": "function", - "file": "repository.h", - "line": 665, - "lineto": 668, + "file": "git2/repository.h", + "line": 702, + "lineto": 705, "args": [ { "name": "repo", @@ -18349,9 +19332,9 @@ }, "git_repository_hashfile": { "type": "function", - "file": "repository.h", - "line": 693, - "lineto": 698, + "file": "git2/repository.h", + "line": 730, + "lineto": 735, "args": [ { "name": "out", @@ -18370,8 +19353,8 @@ }, { "name": "type", - "type": "git_otype", - "comment": "The object type to hash as (e.g. GIT_OBJ_BLOB)" + "type": "git_object_t", + "comment": "The object type to hash as (e.g. GIT_OBJECT_BLOB)" }, { "name": "as_path", @@ -18379,8 +19362,8 @@ "comment": "The path to use to look up filtering rules. If this is\n NULL, then the `path` parameter will be used instead. If\n this is passed as the empty string, then no filters will be\n applied when calculating the hash." } ], - "argline": "git_oid *out, git_repository *repo, const char *path, git_otype type, const char *as_path", - "sig": "git_oid *::git_repository *::const char *::git_otype::const char *", + "argline": "git_oid *out, git_repository *repo, const char *path, git_object_t type, const char *as_path", + "sig": "git_oid *::git_repository *::const char *::git_object_t::const char *", "return": { "type": "int", "comment": " 0 on success, or an error code" @@ -18391,9 +19374,9 @@ }, "git_repository_set_head": { "type": "function", - "file": "repository.h", - "line": 718, - "lineto": 720, + "file": "git2/repository.h", + "line": 755, + "lineto": 757, "args": [ { "name": "repo", @@ -18414,13 +19397,18 @@ }, "description": "

Make the repository HEAD point to the specified reference.

\n", "comments": "

If the provided reference points to a Tree or a Blob, the HEAD is unaltered and -1 is returned.

\n\n

If the provided reference points to a branch, the HEAD will point to that branch, staying attached, or become attached if it isn't yet. If the branch doesn't exist yet, no error will be return. The HEAD will then be attached to an unborn branch.

\n\n

Otherwise, the HEAD will be detached and will directly point to the Commit.

\n", - "group": "repository" + "group": "repository", + "examples": { + "checkout.c": [ + "ex/HEAD/checkout.html#git_repository_set_head-12" + ] + } }, "git_repository_set_head_detached": { "type": "function", - "file": "repository.h", - "line": 738, - "lineto": 740, + "file": "git2/repository.h", + "line": 775, + "lineto": 777, "args": [ { "name": "repo", @@ -18445,9 +19433,9 @@ }, "git_repository_set_head_detached_from_annotated": { "type": "function", - "file": "repository.h", - "line": 754, - "lineto": 756, + "file": "git2/repository.h", + "line": 791, + "lineto": 793, "args": [ { "name": "repo", @@ -18468,13 +19456,18 @@ }, "description": "

Make the repository HEAD directly point to the Commit.

\n", "comments": "

This behaves like git_repository_set_head_detached() but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_repository_set_head_detached().

\n", - "group": "repository" + "group": "repository", + "examples": { + "checkout.c": [ + "ex/HEAD/checkout.html#git_repository_set_head_detached_from_annotated-13" + ] + } }, "git_repository_detach_head": { "type": "function", - "file": "repository.h", - "line": 775, - "lineto": 776, + "file": "git2/repository.h", + "line": 812, + "lineto": 813, "args": [ { "name": "repo", @@ -18494,9 +19487,9 @@ }, "git_repository_state": { "type": "function", - "file": "repository.h", - "line": 806, - "lineto": 806, + "file": "git2/repository.h", + "line": 843, + "lineto": 843, "args": [ { "name": "repo", @@ -18514,16 +19507,19 @@ "comments": "", "group": "repository", "examples": { + "checkout.c": [ + "ex/HEAD/checkout.html#git_repository_state-14" + ], "merge.c": [ - "ex/HEAD/merge.html#git_repository_state-44" + "ex/HEAD/merge.html#git_repository_state-35" ] } }, "git_repository_set_namespace": { "type": "function", - "file": "repository.h", - "line": 820, - "lineto": 820, + "file": "git2/repository.h", + "line": 857, + "lineto": 857, "args": [ { "name": "repo", @@ -18548,9 +19544,9 @@ }, "git_repository_get_namespace": { "type": "function", - "file": "repository.h", - "line": 828, - "lineto": 828, + "file": "git2/repository.h", + "line": 865, + "lineto": 865, "args": [ { "name": "repo", @@ -18570,9 +19566,9 @@ }, "git_repository_is_shallow": { "type": "function", - "file": "repository.h", - "line": 837, - "lineto": 837, + "file": "git2/repository.h", + "line": 874, + "lineto": 874, "args": [ { "name": "repo", @@ -18592,9 +19588,9 @@ }, "git_repository_ident": { "type": "function", - "file": "repository.h", - "line": 849, - "lineto": 849, + "file": "git2/repository.h", + "line": 886, + "lineto": 886, "args": [ { "name": "name", @@ -18624,9 +19620,9 @@ }, "git_repository_set_ident": { "type": "function", - "file": "repository.h", - "line": 862, - "lineto": 862, + "file": "git2/repository.h", + "line": 899, + "lineto": 899, "args": [ { "name": "repo", @@ -18656,7 +19652,7 @@ }, "git_reset": { "type": "function", - "file": "reset.h", + "file": "git2/reset.h", "line": 62, "lineto": 66, "args": [ @@ -18693,7 +19689,7 @@ }, "git_reset_from_annotated": { "type": "function", - "file": "reset.h", + "file": "git2/reset.h", "line": 80, "lineto": 84, "args": [ @@ -18730,7 +19726,7 @@ }, "git_reset_default": { "type": "function", - "file": "reset.h", + "file": "git2/reset.h", "line": 104, "lineto": 107, "args": [ @@ -18760,21 +19756,21 @@ "comments": "

The scope of the updated entries is determined by the paths being passed in the pathspec parameters.

\n\n

Passing a NULL target will result in removing entries in the index matching the provided pathspecs.

\n", "group": "reset" }, - "git_revert_init_options": { + "git_revert_options_init": { "type": "function", - "file": "revert.h", - "line": 47, - "lineto": 49, + "file": "git2/revert.h", + "line": 49, + "lineto": 51, "args": [ { "name": "opts", "type": "git_revert_options *", - "comment": "the `git_revert_options` struct to initialize" + "comment": "The `git_revert_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_REVERT_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_REVERT_OPTIONS_VERSION`." } ], "argline": "git_revert_options *opts, unsigned int version", @@ -18783,15 +19779,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_revert_options with default values. Equivalent to\n creating an instance with GIT_REVERT_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_revert_options structure

\n", + "comments": "

Initializes a git_revert_options with default values. Equivalent to creating an instance with GIT_REVERT_OPTIONS_INIT.

\n", "group": "revert" }, "git_revert_commit": { "type": "function", - "file": "revert.h", - "line": 65, - "lineto": 71, + "file": "git2/revert.h", + "line": 67, + "lineto": 73, "args": [ { "name": "out", @@ -18836,9 +19832,9 @@ }, "git_revert": { "type": "function", - "file": "revert.h", - "line": 81, - "lineto": 84, + "file": "git2/revert.h", + "line": 83, + "lineto": 86, "args": [ { "name": "repo", @@ -18868,7 +19864,7 @@ }, "git_revparse_single": { "type": "function", - "file": "revparse.h", + "file": "git2/revparse.h", "line": 37, "lineto": 38, "args": [ @@ -18899,28 +19895,28 @@ "group": "revparse", "examples": { "blame.c": [ - "ex/HEAD/blame.html#git_revparse_single-26" + "ex/HEAD/blame.html#git_revparse_single-22" ], "cat-file.c": [ - "ex/HEAD/cat-file.html#git_revparse_single-34" + "ex/HEAD/cat-file.html#git_revparse_single-30" ], "describe.c": [ - "ex/HEAD/describe.html#git_revparse_single-8" + "ex/HEAD/describe.html#git_revparse_single-6" ], "log.c": [ - "ex/HEAD/log.html#git_revparse_single-48" + "ex/HEAD/log.html#git_revparse_single-44" ], "tag.c": [ - "ex/HEAD/tag.html#git_revparse_single-13", - "ex/HEAD/tag.html#git_revparse_single-14", - "ex/HEAD/tag.html#git_revparse_single-15", - "ex/HEAD/tag.html#git_revparse_single-16" + "ex/HEAD/tag.html#git_revparse_single-9", + "ex/HEAD/tag.html#git_revparse_single-10", + "ex/HEAD/tag.html#git_revparse_single-11", + "ex/HEAD/tag.html#git_revparse_single-12" ] } }, "git_revparse_ext": { "type": "function", - "file": "revparse.h", + "file": "git2/revparse.h", "line": 61, "lineto": 65, "args": [ @@ -18957,7 +19953,7 @@ }, "git_revparse": { "type": "function", - "file": "revparse.h", + "file": "git2/revparse.h", "line": 105, "lineto": 108, "args": [ @@ -18988,20 +19984,20 @@ "group": "revparse", "examples": { "blame.c": [ - "ex/HEAD/blame.html#git_revparse-27" + "ex/HEAD/blame.html#git_revparse-23" ], "log.c": [ - "ex/HEAD/log.html#git_revparse-49" + "ex/HEAD/log.html#git_revparse-45" ], "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_revparse-18", - "ex/HEAD/rev-parse.html#git_revparse-19" + "ex/HEAD/rev-parse.html#git_revparse-14", + "ex/HEAD/rev-parse.html#git_revparse-15" ] } }, "git_revwalk_new": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 73, "lineto": 73, "args": [ @@ -19030,14 +20026,14 @@ "ex/HEAD/general.html#git_revwalk_new-74" ], "log.c": [ - "ex/HEAD/log.html#git_revwalk_new-50", - "ex/HEAD/log.html#git_revwalk_new-51" + "ex/HEAD/log.html#git_revwalk_new-46", + "ex/HEAD/log.html#git_revwalk_new-47" ] } }, "git_revwalk_reset": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 88, "lineto": 88, "args": [ @@ -19059,7 +20055,7 @@ }, "git_revwalk_push": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 107, "lineto": 107, "args": [ @@ -19088,13 +20084,13 @@ "ex/HEAD/general.html#git_revwalk_push-75" ], "log.c": [ - "ex/HEAD/log.html#git_revwalk_push-52" + "ex/HEAD/log.html#git_revwalk_push-48" ] } }, "git_revwalk_push_glob": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 125, "lineto": 125, "args": [ @@ -19121,7 +20117,7 @@ }, "git_revwalk_push_head": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 133, "lineto": 133, "args": [ @@ -19142,13 +20138,13 @@ "group": "revwalk", "examples": { "log.c": [ - "ex/HEAD/log.html#git_revwalk_push_head-53" + "ex/HEAD/log.html#git_revwalk_push_head-49" ] } }, "git_revwalk_hide": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 148, "lineto": 148, "args": [ @@ -19174,13 +20170,13 @@ "group": "revwalk", "examples": { "log.c": [ - "ex/HEAD/log.html#git_revwalk_hide-54" + "ex/HEAD/log.html#git_revwalk_hide-50" ] } }, "git_revwalk_hide_glob": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 167, "lineto": 167, "args": [ @@ -19207,7 +20203,7 @@ }, "git_revwalk_hide_head": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 175, "lineto": 175, "args": [ @@ -19229,7 +20225,7 @@ }, "git_revwalk_push_ref": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 186, "lineto": 186, "args": [ @@ -19256,7 +20252,7 @@ }, "git_revwalk_hide_ref": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 197, "lineto": 197, "args": [ @@ -19283,7 +20279,7 @@ }, "git_revwalk_next": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 217, "lineto": 217, "args": [ @@ -19312,13 +20308,13 @@ "ex/HEAD/general.html#git_revwalk_next-76" ], "log.c": [ - "ex/HEAD/log.html#git_revwalk_next-55" + "ex/HEAD/log.html#git_revwalk_next-51" ] } }, "git_revwalk_sorting": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 228, "lineto": 228, "args": [ @@ -19347,14 +20343,14 @@ "ex/HEAD/general.html#git_revwalk_sorting-77" ], "log.c": [ - "ex/HEAD/log.html#git_revwalk_sorting-56", - "ex/HEAD/log.html#git_revwalk_sorting-57" + "ex/HEAD/log.html#git_revwalk_sorting-52", + "ex/HEAD/log.html#git_revwalk_sorting-53" ] } }, "git_revwalk_push_range": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 243, "lineto": 243, "args": [ @@ -19381,7 +20377,7 @@ }, "git_revwalk_simplify_first_parent": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 250, "lineto": 250, "args": [ @@ -19403,7 +20399,7 @@ }, "git_revwalk_free": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 258, "lineto": 258, "args": [ @@ -19427,13 +20423,13 @@ "ex/HEAD/general.html#git_revwalk_free-78" ], "log.c": [ - "ex/HEAD/log.html#git_revwalk_free-58" + "ex/HEAD/log.html#git_revwalk_free-54" ] } }, "git_revwalk_repository": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 267, "lineto": 267, "args": [ @@ -19455,7 +20451,7 @@ }, "git_revwalk_add_hide_cb": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 288, "lineto": 291, "args": [ @@ -19481,13 +20477,13 @@ "type": "int", "comment": null }, - "description": "

Adds a callback function to hide a commit and its parents

\n", + "description": "

Adds, changes or removes a callback function to hide a commit and its parents

\n", "comments": "", "group": "revwalk" }, "git_signature_new": { "type": "function", - "file": "signature.h", + "file": "git2/signature.h", "line": 37, "lineto": 37, "args": [ @@ -19509,12 +20505,12 @@ { "name": "time", "type": "git_time_t", - "comment": "time when the action happened" + "comment": "time (in seconds from epoch) when the action happened" }, { "name": "offset", "type": "int", - "comment": "timezone offset in minutes for the time" + "comment": "timezone offset (in minutes) for the time" } ], "argline": "git_signature **out, const char *name, const char *email, git_time_t time, int offset", @@ -19535,7 +20531,7 @@ }, "git_signature_now": { "type": "function", - "file": "signature.h", + "file": "git2/signature.h", "line": 49, "lineto": 49, "args": [ @@ -19566,13 +20562,13 @@ "group": "signature", "examples": { "merge.c": [ - "ex/HEAD/merge.html#git_signature_now-45" + "ex/HEAD/merge.html#git_signature_now-36" ] } }, "git_signature_default": { "type": "function", - "file": "signature.h", + "file": "git2/signature.h", "line": 63, "lineto": 63, "args": [ @@ -19598,16 +20594,16 @@ "group": "signature", "examples": { "init.c": [ - "ex/HEAD/init.html#git_signature_default-12" + "ex/HEAD/init.html#git_signature_default-10" ], "tag.c": [ - "ex/HEAD/tag.html#git_signature_default-17" + "ex/HEAD/tag.html#git_signature_default-13" ] } }, "git_signature_from_buffer": { "type": "function", - "file": "signature.h", + "file": "git2/signature.h", "line": 76, "lineto": 76, "args": [ @@ -19634,7 +20630,7 @@ }, "git_signature_dup": { "type": "function", - "file": "signature.h", + "file": "git2/signature.h", "line": 88, "lineto": 88, "args": [ @@ -19661,7 +20657,7 @@ }, "git_signature_free": { "type": "function", - "file": "signature.h", + "file": "git2/signature.h", "line": 99, "lineto": 99, "args": [ @@ -19686,28 +20682,70 @@ "ex/HEAD/general.html#git_signature_free-82" ], "init.c": [ - "ex/HEAD/init.html#git_signature_free-13" + "ex/HEAD/init.html#git_signature_free-11" ], "tag.c": [ - "ex/HEAD/tag.html#git_signature_free-18" + "ex/HEAD/tag.html#git_signature_free-14" ] } }, - "git_stash_apply_init_options": { + "git_stash_save": { "type": "function", - "file": "stash.h", - "line": 153, - "lineto": 154, + "file": "git2/stash.h", + "line": 67, + "lineto": 72, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "Object id of the commit containing the stashed state.\n This commit is also the target of the direct reference refs/stash." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The owning repository." + }, + { + "name": "stasher", + "type": "const git_signature *", + "comment": "The identity of the person performing the stashing." + }, + { + "name": "message", + "type": "const char *", + "comment": "Optional description along with the stashed state." + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Flags to control the stashing process. (see GIT_STASH_* above)" + } + ], + "argline": "git_oid *out, git_repository *repo, const git_signature *stasher, const char *message, uint32_t flags", + "sig": "git_oid *::git_repository *::const git_signature *::const char *::uint32_t", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND where there's nothing to stash,\n or error code." + }, + "description": "

Save the local modifications to a new stash.

\n", + "comments": "", + "group": "stash" + }, + "git_stash_apply_options_init": { + "type": "function", + "file": "git2/stash.h", + "line": 156, + "lineto": 157, "args": [ { "name": "opts", "type": "git_stash_apply_options *", - "comment": "the `git_stash_apply_options` instance to initialize." + "comment": "The `git_stash_apply_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "the version of the struct; you should pass\n `GIT_STASH_APPLY_OPTIONS_INIT` here." + "comment": "The struct version; pass `GIT_STASH_APPLY_OPTIONS_VERSION`." } ], "argline": "git_stash_apply_options *opts, unsigned int version", @@ -19716,15 +20754,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_stash_apply_options with default values. Equivalent to\n creating an instance with GIT_STASH_APPLY_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_stash_apply_options structure

\n", + "comments": "

Initializes a git_stash_apply_options with default values. Equivalent to creating an instance with GIT_STASH_APPLY_OPTIONS_INIT.

\n", "group": "stash" }, "git_stash_apply": { "type": "function", - "file": "stash.h", - "line": 182, - "lineto": 185, + "file": "git2/stash.h", + "line": 185, + "lineto": 188, "args": [ { "name": "repo", @@ -19754,9 +20792,9 @@ }, "git_stash_foreach": { "type": "function", - "file": "stash.h", - "line": 218, - "lineto": 221, + "file": "git2/stash.h", + "line": 221, + "lineto": 224, "args": [ { "name": "repo", @@ -19786,9 +20824,9 @@ }, "git_stash_drop": { "type": "function", - "file": "stash.h", - "line": 234, - "lineto": 236, + "file": "git2/stash.h", + "line": 237, + "lineto": 239, "args": [ { "name": "repo", @@ -19813,9 +20851,9 @@ }, "git_stash_pop": { "type": "function", - "file": "stash.h", - "line": 250, - "lineto": 253, + "file": "git2/stash.h", + "line": 253, + "lineto": 256, "args": [ { "name": "repo", @@ -19843,21 +20881,21 @@ "comments": "", "group": "stash" }, - "git_status_init_options": { + "git_status_options_init": { "type": "function", - "file": "status.h", - "line": 199, - "lineto": 201, + "file": "git2/status.h", + "line": 212, + "lineto": 214, "args": [ { "name": "opts", "type": "git_status_options *", - "comment": "The `git_status_options` instance to initialize." + "comment": "The `git_status_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_STATUS_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_STATUS_OPTIONS_VERSION`." } ], "argline": "git_status_options *opts, unsigned int version", @@ -19866,15 +20904,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_status_options with default values. Equivalent to\n creating an instance with GIT_STATUS_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_status_options structure

\n", + "comments": "

Initializes a git_status_options with default values. Equivalent to creating an instance with GIT_STATUS_OPTIONS_INIT.

\n", "group": "status" }, "git_status_foreach": { "type": "function", - "file": "status.h", - "line": 239, - "lineto": 242, + "file": "git2/status.h", + "line": 252, + "lineto": 255, "args": [ { "name": "repo", @@ -19903,15 +20941,15 @@ "group": "status", "examples": { "status.c": [ - "ex/HEAD/status.html#git_status_foreach-10" + "ex/HEAD/status.html#git_status_foreach-6" ] } }, "git_status_foreach_ext": { "type": "function", - "file": "status.h", - "line": 263, - "lineto": 267, + "file": "git2/status.h", + "line": 276, + "lineto": 280, "args": [ { "name": "repo", @@ -19945,15 +20983,15 @@ "group": "status", "examples": { "status.c": [ - "ex/HEAD/status.html#git_status_foreach_ext-11" + "ex/HEAD/status.html#git_status_foreach_ext-7" ] } }, "git_status_file": { "type": "function", - "file": "status.h", - "line": 295, - "lineto": 298, + "file": "git2/status.h", + "line": 308, + "lineto": 311, "args": [ { "name": "status_flags", @@ -19979,13 +21017,18 @@ }, "description": "

Get file status for a single file.

\n", "comments": "

This tries to get status for the filename that you give. If no files match that name (in either the HEAD, index, or working directory), this returns GIT_ENOTFOUND.

\n\n

If the name matches multiple files (for example, if the path names a directory or if running on a case- insensitive filesystem and yet the HEAD has two entries that both match the path), then this returns GIT_EAMBIGUOUS because it cannot give correct results.

\n\n

This does not do any sort of rename detection. Renames require a set of targets and because of the path filtering, there is not enough information to check renames correctly. To check file status with rename detection, there is no choice but to do a full git_status_list_new and scan through looking for the path that you are interested in.

\n", - "group": "status" + "group": "status", + "examples": { + "add.c": [ + "ex/HEAD/add.html#git_status_file-6" + ] + } }, "git_status_list_new": { "type": "function", - "file": "status.h", - "line": 313, - "lineto": 316, + "file": "git2/status.h", + "line": 326, + "lineto": 329, "args": [ { "name": "out", @@ -20014,16 +21057,16 @@ "group": "status", "examples": { "status.c": [ - "ex/HEAD/status.html#git_status_list_new-12", - "ex/HEAD/status.html#git_status_list_new-13" + "ex/HEAD/status.html#git_status_list_new-8", + "ex/HEAD/status.html#git_status_list_new-9" ] } }, "git_status_list_entrycount": { "type": "function", - "file": "status.h", - "line": 327, - "lineto": 328, + "file": "git2/status.h", + "line": 340, + "lineto": 341, "args": [ { "name": "statuslist", @@ -20042,16 +21085,16 @@ "group": "status", "examples": { "status.c": [ - "ex/HEAD/status.html#git_status_list_entrycount-14", - "ex/HEAD/status.html#git_status_list_entrycount-15" + "ex/HEAD/status.html#git_status_list_entrycount-10", + "ex/HEAD/status.html#git_status_list_entrycount-11" ] } }, "git_status_byindex": { "type": "function", - "file": "status.h", - "line": 339, - "lineto": 341, + "file": "git2/status.h", + "line": 352, + "lineto": 354, "args": [ { "name": "statuslist", @@ -20075,20 +21118,20 @@ "group": "status", "examples": { "status.c": [ + "ex/HEAD/status.html#git_status_byindex-12", + "ex/HEAD/status.html#git_status_byindex-13", + "ex/HEAD/status.html#git_status_byindex-14", + "ex/HEAD/status.html#git_status_byindex-15", "ex/HEAD/status.html#git_status_byindex-16", - "ex/HEAD/status.html#git_status_byindex-17", - "ex/HEAD/status.html#git_status_byindex-18", - "ex/HEAD/status.html#git_status_byindex-19", - "ex/HEAD/status.html#git_status_byindex-20", - "ex/HEAD/status.html#git_status_byindex-21" + "ex/HEAD/status.html#git_status_byindex-17" ] } }, "git_status_list_free": { "type": "function", - "file": "status.h", - "line": 348, - "lineto": 349, + "file": "git2/status.h", + "line": 361, + "lineto": 362, "args": [ { "name": "statuslist", @@ -20107,15 +21150,15 @@ "group": "status", "examples": { "status.c": [ - "ex/HEAD/status.html#git_status_list_free-22" + "ex/HEAD/status.html#git_status_list_free-18" ] } }, "git_status_should_ignore": { "type": "function", - "file": "status.h", - "line": 367, - "lineto": 370, + "file": "git2/status.h", + "line": 380, + "lineto": 383, "args": [ { "name": "ignored", @@ -20145,7 +21188,7 @@ }, "git_strarray_free": { "type": "function", - "file": "strarray.h", + "file": "git2/strarray.h", "line": 41, "lineto": 41, "args": [ @@ -20169,17 +21212,17 @@ "ex/HEAD/general.html#git_strarray_free-83" ], "remote.c": [ - "ex/HEAD/remote.html#git_strarray_free-16", - "ex/HEAD/remote.html#git_strarray_free-17" + "ex/HEAD/remote.html#git_strarray_free-11", + "ex/HEAD/remote.html#git_strarray_free-12" ], "tag.c": [ - "ex/HEAD/tag.html#git_strarray_free-19" + "ex/HEAD/tag.html#git_strarray_free-15" ] } }, "git_strarray_copy": { "type": "function", - "file": "strarray.h", + "file": "git2/strarray.h", "line": 53, "lineto": 53, "args": [ @@ -20204,21 +21247,21 @@ "comments": "

Note: target is overwritten and hence should be empty, otherwise its contents are leaked. Call git_strarray_free() if necessary.

\n", "group": "strarray" }, - "git_submodule_update_init_options": { + "git_submodule_update_options_init": { "type": "function", - "file": "submodule.h", - "line": 170, - "lineto": 171, + "file": "git2/submodule.h", + "line": 171, + "lineto": 172, "args": [ { "name": "opts", "type": "git_submodule_update_options *", - "comment": "The `git_submodule_update_options` instance to initialize." + "comment": "The `git_submodule_update_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_SUBMODULE_UPDATE_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_SUBMODULE_UPDATE_OPTIONS_VERSION`." } ], "argline": "git_submodule_update_options *opts, unsigned int version", @@ -20227,15 +21270,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_submodule_update_options with default values.\n Equivalent to creating an instance with GIT_SUBMODULE_UPDATE_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_submodule_update_options structure

\n", + "comments": "

Initializes a git_submodule_update_options with default values. Equivalent to creating an instance with GIT_SUBMODULE_UPDATE_OPTIONS_INIT.

\n", "group": "submodule" }, "git_submodule_update": { "type": "function", - "file": "submodule.h", - "line": 191, - "lineto": 191, + "file": "git2/submodule.h", + "line": 192, + "lineto": 192, "args": [ { "name": "submodule", @@ -20257,7 +21300,7 @@ "sig": "git_submodule *::int::git_submodule_update_options *", "return": { "type": "int", - "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `giterr_last` for a detailed error message)." + "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `git_error_last` for a detailed error message)." }, "description": "

Update a submodule. This will clone a missing submodule and\n checkout the subrepository to the commit specified in the index of\n the containing repository. If the submodule repository doesn't contain\n the target commit (e.g. because fetchRecurseSubmodules isn't set), then\n the submodule is fetched using the fetch options supplied in options.

\n", "comments": "", @@ -20265,9 +21308,9 @@ }, "git_submodule_lookup": { "type": "function", - "file": "submodule.h", - "line": 220, - "lineto": 223, + "file": "git2/submodule.h", + "line": 221, + "lineto": 224, "args": [ { "name": "out", @@ -20297,9 +21340,9 @@ }, "git_submodule_free": { "type": "function", - "file": "submodule.h", - "line": 230, - "lineto": 230, + "file": "git2/submodule.h", + "line": 231, + "lineto": 231, "args": [ { "name": "submodule", @@ -20319,9 +21362,9 @@ }, "git_submodule_foreach": { "type": "function", - "file": "submodule.h", - "line": 250, - "lineto": 253, + "file": "git2/submodule.h", + "line": 251, + "lineto": 254, "args": [ { "name": "repo", @@ -20350,15 +21393,15 @@ "group": "submodule", "examples": { "status.c": [ - "ex/HEAD/status.html#git_submodule_foreach-23" + "ex/HEAD/status.html#git_submodule_foreach-19" ] } }, "git_submodule_add_setup": { "type": "function", - "file": "submodule.h", - "line": 280, - "lineto": 285, + "file": "git2/submodule.h", + "line": 281, + "lineto": 286, "args": [ { "name": "out", @@ -20398,9 +21441,9 @@ }, "git_submodule_add_finalize": { "type": "function", - "file": "submodule.h", - "line": 297, - "lineto": 297, + "file": "git2/submodule.h", + "line": 298, + "lineto": 298, "args": [ { "name": "submodule", @@ -20420,9 +21463,9 @@ }, "git_submodule_add_to_index": { "type": "function", - "file": "submodule.h", - "line": 309, - "lineto": 311, + "file": "git2/submodule.h", + "line": 310, + "lineto": 312, "args": [ { "name": "submodule", @@ -20447,9 +21490,9 @@ }, "git_submodule_owner": { "type": "function", - "file": "submodule.h", - "line": 324, - "lineto": 324, + "file": "git2/submodule.h", + "line": 325, + "lineto": 325, "args": [ { "name": "submodule", @@ -20469,9 +21512,9 @@ }, "git_submodule_name": { "type": "function", - "file": "submodule.h", - "line": 332, - "lineto": 332, + "file": "git2/submodule.h", + "line": 333, + "lineto": 333, "args": [ { "name": "submodule", @@ -20490,15 +21533,15 @@ "group": "submodule", "examples": { "status.c": [ - "ex/HEAD/status.html#git_submodule_name-24" + "ex/HEAD/status.html#git_submodule_name-20" ] } }, "git_submodule_path": { "type": "function", - "file": "submodule.h", - "line": 343, - "lineto": 343, + "file": "git2/submodule.h", + "line": 344, + "lineto": 344, "args": [ { "name": "submodule", @@ -20517,15 +21560,15 @@ "group": "submodule", "examples": { "status.c": [ - "ex/HEAD/status.html#git_submodule_path-25" + "ex/HEAD/status.html#git_submodule_path-21" ] } }, "git_submodule_url": { "type": "function", - "file": "submodule.h", - "line": 351, - "lineto": 351, + "file": "git2/submodule.h", + "line": 352, + "lineto": 352, "args": [ { "name": "submodule", @@ -20545,9 +21588,9 @@ }, "git_submodule_resolve_url": { "type": "function", - "file": "submodule.h", - "line": 361, - "lineto": 361, + "file": "git2/submodule.h", + "line": 362, + "lineto": 362, "args": [ { "name": "out", @@ -20577,9 +21620,9 @@ }, "git_submodule_branch": { "type": "function", - "file": "submodule.h", - "line": 369, - "lineto": 369, + "file": "git2/submodule.h", + "line": 370, + "lineto": 370, "args": [ { "name": "submodule", @@ -20599,9 +21642,9 @@ }, "git_submodule_set_branch": { "type": "function", - "file": "submodule.h", - "line": 382, - "lineto": 382, + "file": "git2/submodule.h", + "line": 383, + "lineto": 383, "args": [ { "name": "repo", @@ -20631,9 +21674,9 @@ }, "git_submodule_set_url": { "type": "function", - "file": "submodule.h", - "line": 396, - "lineto": 396, + "file": "git2/submodule.h", + "line": 397, + "lineto": 397, "args": [ { "name": "repo", @@ -20663,9 +21706,9 @@ }, "git_submodule_index_id": { "type": "function", - "file": "submodule.h", - "line": 404, - "lineto": 404, + "file": "git2/submodule.h", + "line": 405, + "lineto": 405, "args": [ { "name": "submodule", @@ -20685,9 +21728,9 @@ }, "git_submodule_head_id": { "type": "function", - "file": "submodule.h", - "line": 412, - "lineto": 412, + "file": "git2/submodule.h", + "line": 413, + "lineto": 413, "args": [ { "name": "submodule", @@ -20707,9 +21750,9 @@ }, "git_submodule_wd_id": { "type": "function", - "file": "submodule.h", - "line": 425, - "lineto": 425, + "file": "git2/submodule.h", + "line": 426, + "lineto": 426, "args": [ { "name": "submodule", @@ -20729,9 +21772,9 @@ }, "git_submodule_ignore": { "type": "function", - "file": "submodule.h", - "line": 450, - "lineto": 451, + "file": "git2/submodule.h", + "line": 451, + "lineto": 452, "args": [ { "name": "submodule", @@ -20751,9 +21794,9 @@ }, "git_submodule_set_ignore": { "type": "function", - "file": "submodule.h", - "line": 463, - "lineto": 466, + "file": "git2/submodule.h", + "line": 464, + "lineto": 467, "args": [ { "name": "repo", @@ -20783,9 +21826,9 @@ }, "git_submodule_update_strategy": { "type": "function", - "file": "submodule.h", - "line": 478, - "lineto": 479, + "file": "git2/submodule.h", + "line": 479, + "lineto": 480, "args": [ { "name": "submodule", @@ -20793,2064 +21836,309 @@ "comment": "The submodule to check" } ], - "argline": "git_submodule *submodule", - "sig": "git_submodule *", - "return": { - "type": "git_submodule_update_t", - "comment": " The current git_submodule_update_t value that will be used\n for this submodule." - }, - "description": "

Get the update rule that will be used for the submodule.

\n", - "comments": "

This value controls the behavior of the git submodule update command. There are four useful values documented with git_submodule_update_t.

\n", - "group": "submodule" - }, - "git_submodule_set_update": { - "type": "function", - "file": "submodule.h", - "line": 491, - "lineto": 494, - "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": "the repository to affect" - }, - { - "name": "name", - "type": "const char *", - "comment": "the name of the submodule to configure" - }, - { - "name": "update", - "type": "git_submodule_update_t", - "comment": "The new value to use" - } - ], - "argline": "git_repository *repo, const char *name, git_submodule_update_t update", - "sig": "git_repository *::const char *::git_submodule_update_t", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Set the update rule for the submodule in the configuration

\n", - "comments": "

This setting won't affect any existing instances.

\n", - "group": "submodule" - }, - "git_submodule_fetch_recurse_submodules": { - "type": "function", - "file": "submodule.h", - "line": 507, - "lineto": 508, - "args": [ - { - "name": "submodule", - "type": "git_submodule *", - "comment": null - } - ], - "argline": "git_submodule *submodule", - "sig": "git_submodule *", - "return": { - "type": "git_submodule_recurse_t", - "comment": " 0 if fetchRecurseSubmodules is false, 1 if true" - }, - "description": "

Read the fetchRecurseSubmodules rule for a submodule.

\n", - "comments": "

This accesses the submodule..fetchRecurseSubmodules value for the submodule that controls fetching behavior for the submodule.

\n\n

Note that at this time, libgit2 does not honor this setting and the fetch functionality current ignores submodules.

\n", - "group": "submodule" - }, - "git_submodule_set_fetch_recurse_submodules": { - "type": "function", - "file": "submodule.h", - "line": 520, - "lineto": 523, - "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": "the repository to affect" - }, - { - "name": "name", - "type": "const char *", - "comment": "the submodule to configure" - }, - { - "name": "fetch_recurse_submodules", - "type": "git_submodule_recurse_t", - "comment": "Boolean value" - } - ], - "argline": "git_repository *repo, const char *name, git_submodule_recurse_t fetch_recurse_submodules", - "sig": "git_repository *::const char *::git_submodule_recurse_t", - "return": { - "type": "int", - "comment": " old value for fetchRecurseSubmodules" - }, - "description": "

Set the fetchRecurseSubmodules rule for a submodule in the configuration

\n", - "comments": "

This setting won't affect any existing instances.

\n", - "group": "submodule" - }, - "git_submodule_init": { - "type": "function", - "file": "submodule.h", - "line": 538, - "lineto": 538, - "args": [ - { - "name": "submodule", - "type": "git_submodule *", - "comment": "The submodule to write into the superproject config" - }, - { - "name": "overwrite", - "type": "int", - "comment": "By default, existing entries will not be overwritten,\n but setting this to true forces them to be updated." - } - ], - "argline": "git_submodule *submodule, int overwrite", - "sig": "git_submodule *::int", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 on failure." - }, - "description": "

Copy submodule info into ".git/config" file.

\n", - "comments": "

Just like "git submodule init", this copies information about the submodule into ".git/config". You can use the accessor functions above to alter the in-memory git_submodule object and control what is written to the config, overriding what is in .gitmodules.

\n", - "group": "submodule" - }, - "git_submodule_repo_init": { - "type": "function", - "file": "submodule.h", - "line": 553, - "lineto": 556, - "args": [ - { - "name": "out", - "type": "git_repository **", - "comment": "Output pointer to the created git repository." - }, - { - "name": "sm", - "type": "const git_submodule *", - "comment": "The submodule to create a new subrepository from." - }, - { - "name": "use_gitlink", - "type": "int", - "comment": "Should the workdir contain a gitlink to\n the repo in .git/modules vs. repo directly in workdir." - } - ], - "argline": "git_repository **out, const git_submodule *sm, int use_gitlink", - "sig": "git_repository **::const git_submodule *::int", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 on failure." - }, - "description": "

Set up the subrepository for a submodule in preparation for clone.

\n", - "comments": "

This function can be called to init and set up a submodule repository from a submodule in preparation to clone it from its remote.

\n", - "group": "submodule" - }, - "git_submodule_sync": { - "type": "function", - "file": "submodule.h", - "line": 566, - "lineto": 566, - "args": [ - { - "name": "submodule", - "type": "git_submodule *", - "comment": null - } - ], - "argline": "git_submodule *submodule", - "sig": "git_submodule *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Copy submodule remote info into submodule repo.

\n", - "comments": "

This copies the information about the submodules URL into the checked out submodule config, acting like "git submodule sync". This is useful if you have altered the URL for the submodule (or it has been altered by a fetch of upstream changes) and you need to update your local repo.

\n", - "group": "submodule" - }, - "git_submodule_open": { - "type": "function", - "file": "submodule.h", - "line": 580, - "lineto": 582, - "args": [ - { - "name": "repo", - "type": "git_repository **", - "comment": "Pointer to the submodule repo which was opened" - }, - { - "name": "submodule", - "type": "git_submodule *", - "comment": "Submodule to be opened" - } - ], - "argline": "git_repository **repo, git_submodule *submodule", - "sig": "git_repository **::git_submodule *", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 if submodule repo could not be opened." - }, - "description": "

Open the repository for a submodule.

\n", - "comments": "

This is a newly opened repository object. The caller is responsible for calling git_repository_free() on it when done. Multiple calls to this function will return distinct git_repository objects. This will only work if the submodule is checked out into the working directory.

\n", - "group": "submodule" - }, - "git_submodule_reload": { - "type": "function", - "file": "submodule.h", - "line": 594, - "lineto": 594, - "args": [ - { - "name": "submodule", - "type": "git_submodule *", - "comment": "The submodule to reload" - }, - { - "name": "force", - "type": "int", - "comment": "Force reload even if the data doesn't seem out of date" - } - ], - "argline": "git_submodule *submodule, int force", - "sig": "git_submodule *::int", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 on error" - }, - "description": "

Reread submodule info from config, index, and HEAD.

\n", - "comments": "

Call this to reread cached submodule information for this submodule if you have reason to believe that it has changed.

\n", - "group": "submodule" - }, - "git_submodule_status": { - "type": "function", - "file": "submodule.h", - "line": 610, - "lineto": 614, - "args": [ - { - "name": "status", - "type": "unsigned int *", - "comment": "Combination of `GIT_SUBMODULE_STATUS` flags" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "the repository in which to look" - }, - { - "name": "name", - "type": "const char *", - "comment": "name of the submodule" - }, - { - "name": "ignore", - "type": "git_submodule_ignore_t", - "comment": "the ignore rules to follow" - } - ], - "argline": "unsigned int *status, git_repository *repo, const char *name, git_submodule_ignore_t ignore", - "sig": "unsigned int *::git_repository *::const char *::git_submodule_ignore_t", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 on error" - }, - "description": "

Get the status for a submodule.

\n", - "comments": "

This looks at a submodule and tries to determine the status. It will return a combination of the GIT_SUBMODULE_STATUS values above. How deeply it examines the working directory to do this will depend on the git_submodule_ignore_t value for the submodule.

\n", - "group": "submodule", - "examples": { - "status.c": [ - "ex/HEAD/status.html#git_submodule_status-26" - ] - } - }, - "git_submodule_location": { - "type": "function", - "file": "submodule.h", - "line": 630, - "lineto": 632, - "args": [ - { - "name": "location_status", - "type": "unsigned int *", - "comment": "Combination of first four `GIT_SUBMODULE_STATUS` flags" - }, - { - "name": "submodule", - "type": "git_submodule *", - "comment": "Submodule for which to get status" - } - ], - "argline": "unsigned int *location_status, git_submodule *submodule", - "sig": "unsigned int *::git_submodule *", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 on error" - }, - "description": "

Get the locations of submodule information.

\n", - "comments": "

This is a bit like a very lightweight version of git_submodule_status. It just returns a made of the first four submodule status values (i.e. the ones like GIT_SUBMODULE_STATUS_IN_HEAD, etc) that tell you where the submodule data comes from (i.e. the HEAD commit, gitmodules file, etc.). This can be useful if you want to know if the submodule is present in the working directory at this point in time, etc.

\n", - "group": "submodule" - }, - "git_commit_create_from_ids": { - "type": "function", - "file": "sys/commit.h", - "line": 34, - "lineto": 44, - "args": [ - { - "name": "id", - "type": "git_oid *", - "comment": null - }, - { - "name": "repo", - "type": "git_repository *", - "comment": null - }, - { - "name": "update_ref", - "type": "const char *", - "comment": null - }, - { - "name": "author", - "type": "const git_signature *", - "comment": null - }, - { - "name": "committer", - "type": "const git_signature *", - "comment": null - }, - { - "name": "message_encoding", - "type": "const char *", - "comment": null - }, - { - "name": "message", - "type": "const char *", - "comment": null - }, - { - "name": "tree", - "type": "const git_oid *", - "comment": null - }, - { - "name": "parent_count", - "type": "size_t", - "comment": null - }, - { - "name": "parents", - "type": "const git_oid *[]", - "comment": null - } - ], - "argline": "git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_oid *tree, size_t parent_count, const git_oid *[] parents", - "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_oid *::size_t::const git_oid *[]", - "return": { - "type": "int", - "comment": null - }, - "description": "

Create new commit in the repository from a list of git_oid values.

\n", - "comments": "

See documentation for git_commit_create() for information about the parameters, as the meaning is identical excepting that tree and parents now take git_oid. This is a dangerous API in that nor the tree, neither the parents list of git_oids are checked for validity.

\n", - "group": "commit" - }, - "git_commit_create_from_callback": { - "type": "function", - "file": "sys/commit.h", - "line": 66, - "lineto": 76, - "args": [ - { - "name": "id", - "type": "git_oid *", - "comment": null - }, - { - "name": "repo", - "type": "git_repository *", - "comment": null - }, - { - "name": "update_ref", - "type": "const char *", - "comment": null - }, - { - "name": "author", - "type": "const git_signature *", - "comment": null - }, - { - "name": "committer", - "type": "const git_signature *", - "comment": null - }, - { - "name": "message_encoding", - "type": "const char *", - "comment": null - }, - { - "name": "message", - "type": "const char *", - "comment": null - }, - { - "name": "tree", - "type": "const git_oid *", - "comment": null - }, - { - "name": "parent_cb", - "type": "git_commit_parent_callback", - "comment": null - }, - { - "name": "parent_payload", - "type": "void *", - "comment": null - } - ], - "argline": "git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_oid *tree, git_commit_parent_callback parent_cb, void *parent_payload", - "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_oid *::git_commit_parent_callback::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Create a new commit in the repository with an callback to supply parents.

\n", - "comments": "

See documentation for git_commit_create() for information about the parameters, as the meaning is identical excepting that tree takes a git_oid and doesn't check for validity, and parent_cb is invoked with parent_payload and should return git_oid values or NULL to indicate that all parents are accounted for.

\n", - "group": "commit" - }, - "git_config_init_backend": { - "type": "function", - "file": "sys/config.h", - "line": 97, - "lineto": 99, - "args": [ - { - "name": "backend", - "type": "git_config_backend *", - "comment": "the `git_config_backend` struct to initialize." - }, - { - "name": "version", - "type": "unsigned int", - "comment": "Version of struct; pass `GIT_CONFIG_BACKEND_VERSION`" - } - ], - "argline": "git_config_backend *backend, unsigned int version", - "sig": "git_config_backend *::unsigned int", - "return": { - "type": "int", - "comment": " Zero on success; -1 on failure." - }, - "description": "

Initializes a git_config_backend with default values. Equivalent to\n creating an instance with GIT_CONFIG_BACKEND_INIT.

\n", - "comments": "", - "group": "config" - }, - "git_config_add_backend": { - "type": "function", - "file": "sys/config.h", - "line": 121, - "lineto": 126, - "args": [ - { - "name": "cfg", - "type": "git_config *", - "comment": "the configuration to add the file to" - }, - { - "name": "file", - "type": "git_config_backend *", - "comment": "the configuration file (backend) to add" - }, - { - "name": "level", - "type": "git_config_level_t", - "comment": "the priority level of the backend" - }, - { - "name": "repo", - "type": "const git_repository *", - "comment": "optional repository to allow parsing of\n conditional includes" - }, - { - "name": "force", - "type": "int", - "comment": "if a config file already exists for the given\n priority level, replace it" - } - ], - "argline": "git_config *cfg, git_config_backend *file, git_config_level_t level, const git_repository *repo, int force", - "sig": "git_config *::git_config_backend *::git_config_level_t::const git_repository *::int", - "return": { - "type": "int", - "comment": " 0 on success, GIT_EEXISTS when adding more than one file\n for a given priority level (and force_replace set to 0), or error code" - }, - "description": "

Add a generic config file instance to an existing config

\n", - "comments": "

Note that the configuration object will free the file automatically.

\n\n

Further queries on this config object will access each of the config file instances in order (instances with a higher priority level will be accessed first).

\n", - "group": "config" - }, - "git_diff_print_callback__to_buf": { - "type": "function", - "file": "sys/diff.h", - "line": 37, - "lineto": 41, - "args": [ - { - "name": "delta", - "type": "const git_diff_delta *", - "comment": null - }, - { - "name": "hunk", - "type": "const git_diff_hunk *", - "comment": null - }, - { - "name": "line", - "type": "const git_diff_line *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload", - "sig": "const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Diff print callback that writes to a git_buf.

\n", - "comments": "

This function is provided not for you to call it directly, but instead so you can use it as a function pointer to the git_diff_print or git_patch_print APIs. When using those APIs, you specify a callback to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a git_buf buffer. You must pass a git_buf * value as the payload to the git_diff_print and/or git_patch_print function. The data will be appended to the buffer (after any existing content).

\n", - "group": "diff" - }, - "git_diff_print_callback__to_file_handle": { - "type": "function", - "file": "sys/diff.h", - "line": 57, - "lineto": 61, - "args": [ - { - "name": "delta", - "type": "const git_diff_delta *", - "comment": null - }, - { - "name": "hunk", - "type": "const git_diff_hunk *", - "comment": null - }, - { - "name": "line", - "type": "const git_diff_line *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload", - "sig": "const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Diff print callback that writes to stdio FILE handle.

\n", - "comments": "

This function is provided not for you to call it directly, but instead so you can use it as a function pointer to the git_diff_print or git_patch_print APIs. When using those APIs, you specify a callback to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a stdio FILE handle. You must pass a FILE * value (such as stdout or stderr or the return value from fopen()) as the payload to the git_diff_print and/or git_patch_print function. If you pass NULL, this will write data to stdout.

\n", - "group": "diff" - }, - "git_diff_get_perfdata": { - "type": "function", - "file": "sys/diff.h", - "line": 83, - "lineto": 84, - "args": [ - { - "name": "out", - "type": "git_diff_perfdata *", - "comment": "Structure to be filled with diff performance data" - }, - { - "name": "diff", - "type": "const git_diff *", - "comment": "Diff to read performance data from" - } - ], - "argline": "git_diff_perfdata *out, const git_diff *diff", - "sig": "git_diff_perfdata *::const git_diff *", - "return": { - "type": "int", - "comment": " 0 for success, \n<\n0 for error" - }, - "description": "

Get performance data for a diff object.

\n", - "comments": "", - "group": "diff" - }, - "git_status_list_get_perfdata": { - "type": "function", - "file": "sys/diff.h", - "line": 89, - "lineto": 90, - "args": [ - { - "name": "out", - "type": "git_diff_perfdata *", - "comment": null - }, - { - "name": "status", - "type": "const git_status_list *", - "comment": null - } - ], - "argline": "git_diff_perfdata *out, const git_status_list *status", - "sig": "git_diff_perfdata *::const git_status_list *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Get performance data for diffs from a git_status_list

\n", - "comments": "", - "group": "status" - }, - "git_filter_lookup": { - "type": "function", - "file": "sys/filter.h", - "line": 27, - "lineto": 27, - "args": [ - { - "name": "name", - "type": "const char *", - "comment": "The name of the filter" - } - ], - "argline": "const char *name", - "sig": "const char *", - "return": { - "type": "git_filter *", - "comment": " Pointer to the filter object or NULL if not found" - }, - "description": "

Look up a filter by name

\n", - "comments": "", - "group": "filter" - }, - "git_filter_list_new": { - "type": "function", - "file": "sys/filter.h", - "line": 57, - "lineto": 61, - "args": [ - { - "name": "out", - "type": "git_filter_list **", - "comment": null - }, - { - "name": "repo", - "type": "git_repository *", - "comment": null - }, - { - "name": "mode", - "type": "git_filter_mode_t", - "comment": null - }, - { - "name": "options", - "type": "uint32_t", - "comment": null - } - ], - "argline": "git_filter_list **out, git_repository *repo, git_filter_mode_t mode, uint32_t options", - "sig": "git_filter_list **::git_repository *::git_filter_mode_t::uint32_t", - "return": { - "type": "int", - "comment": null - }, - "description": "

Create a new empty filter list

\n", - "comments": "

Normally you won't use this because git_filter_list_load will create the filter list for you, but you can use this in combination with the git_filter_lookup and git_filter_list_push functions to assemble your own chains of filters.

\n", - "group": "filter" - }, - "git_filter_list_push": { - "type": "function", - "file": "sys/filter.h", - "line": 76, - "lineto": 77, - "args": [ - { - "name": "fl", - "type": "git_filter_list *", - "comment": null - }, - { - "name": "filter", - "type": "git_filter *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "git_filter_list *fl, git_filter *filter, void *payload", - "sig": "git_filter_list *::git_filter *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Add a filter to a filter list with the given payload.

\n", - "comments": "

Normally you won't have to do this because the filter list is created by calling the "check" function on registered filters when the filter attributes are set, but this does allow more direct manipulation of filter lists when desired.

\n\n

Note that normally the "check" function can set up a payload for the filter. Using this function, you can either pass in a payload if you know the expected payload format, or you can pass NULL. Some filters may fail with a NULL payload. Good luck!

\n", - "group": "filter" - }, - "git_filter_list_length": { - "type": "function", - "file": "sys/filter.h", - "line": 90, - "lineto": 90, - "args": [ - { - "name": "fl", - "type": "const git_filter_list *", - "comment": "A filter list" - } - ], - "argline": "const git_filter_list *fl", - "sig": "const git_filter_list *", - "return": { - "type": "size_t", - "comment": " The number of filters in the list" - }, - "description": "

Look up how many filters are in the list

\n", - "comments": "

We will attempt to apply all of these filters to any data passed in, but note that the filter apply action still has the option of skipping data that is passed in (for example, the CRLF filter will skip data that appears to be binary).

\n", - "group": "filter" - }, - "git_filter_source_repo": { - "type": "function", - "file": "sys/filter.h", - "line": 100, - "lineto": 100, - "args": [ - { - "name": "src", - "type": "const git_filter_source *", - "comment": null - } - ], - "argline": "const git_filter_source *src", - "sig": "const git_filter_source *", - "return": { - "type": "git_repository *", - "comment": null - }, - "description": "

Get the repository that the source data is coming from.

\n", - "comments": "", - "group": "filter" - }, - "git_filter_source_path": { - "type": "function", - "file": "sys/filter.h", - "line": 105, - "lineto": 105, - "args": [ - { - "name": "src", - "type": "const git_filter_source *", - "comment": null - } - ], - "argline": "const git_filter_source *src", - "sig": "const git_filter_source *", - "return": { - "type": "const char *", - "comment": null - }, - "description": "

Get the path that the source data is coming from.

\n", - "comments": "", - "group": "filter" - }, - "git_filter_source_filemode": { - "type": "function", - "file": "sys/filter.h", - "line": 111, - "lineto": 111, - "args": [ - { - "name": "src", - "type": "const git_filter_source *", - "comment": null - } - ], - "argline": "const git_filter_source *src", - "sig": "const git_filter_source *", - "return": { - "type": "uint16_t", - "comment": null - }, - "description": "

Get the file mode of the source file\n If the mode is unknown, this will return 0

\n", - "comments": "", - "group": "filter" - }, - "git_filter_source_id": { - "type": "function", - "file": "sys/filter.h", - "line": 118, - "lineto": 118, - "args": [ - { - "name": "src", - "type": "const git_filter_source *", - "comment": null - } - ], - "argline": "const git_filter_source *src", - "sig": "const git_filter_source *", - "return": { - "type": "const git_oid *", - "comment": null - }, - "description": "

Get the OID of the source\n If the OID is unknown (often the case with GIT_FILTER_CLEAN) then\n this will return NULL.

\n", - "comments": "", - "group": "filter" - }, - "git_filter_source_mode": { - "type": "function", - "file": "sys/filter.h", - "line": 123, - "lineto": 123, - "args": [ - { - "name": "src", - "type": "const git_filter_source *", - "comment": null - } - ], - "argline": "const git_filter_source *src", - "sig": "const git_filter_source *", - "return": { - "type": "git_filter_mode_t", - "comment": null - }, - "description": "

Get the git_filter_mode_t to be used

\n", - "comments": "", - "group": "filter" - }, - "git_filter_source_flags": { - "type": "function", - "file": "sys/filter.h", - "line": 128, - "lineto": 128, - "args": [ - { - "name": "src", - "type": "const git_filter_source *", - "comment": null - } - ], - "argline": "const git_filter_source *src", - "sig": "const git_filter_source *", - "return": { - "type": "uint32_t", - "comment": null - }, - "description": "

Get the combination git_filter_flag_t options to be applied

\n", - "comments": "", - "group": "filter" - }, - "git_filter_init": { - "type": "function", - "file": "sys/filter.h", - "line": 284, - "lineto": 284, - "args": [ - { - "name": "filter", - "type": "git_filter *", - "comment": "the `git_filter` struct to initialize." - }, - { - "name": "version", - "type": "unsigned int", - "comment": "Version the struct; pass `GIT_FILTER_VERSION`" - } - ], - "argline": "git_filter *filter, unsigned int version", - "sig": "git_filter *::unsigned int", - "return": { - "type": "int", - "comment": " Zero on success; -1 on failure." - }, - "description": "

Initializes a git_filter with default values. Equivalent to\n creating an instance with GIT_FILTER_INIT.

\n", - "comments": "", - "group": "filter" - }, - "git_filter_register": { - "type": "function", - "file": "sys/filter.h", - "line": 312, - "lineto": 313, - "args": [ - { - "name": "name", - "type": "const char *", - "comment": "A name by which the filter can be referenced. Attempting\n \t\t\tto register with an in-use name will return GIT_EEXISTS." - }, - { - "name": "filter", - "type": "git_filter *", - "comment": "The filter definition. This pointer will be stored as is\n \t\t\tby libgit2 so it must be a durable allocation (either static\n \t\t\tor on the heap)." - }, - { - "name": "priority", - "type": "int", - "comment": "The priority for filter application" - } - ], - "argline": "const char *name, git_filter *filter, int priority", - "sig": "const char *::git_filter *::int", - "return": { - "type": "int", - "comment": " 0 on successful registry, error code \n<\n0 on failure" - }, - "description": "

Register a filter under a given name with a given priority.

\n", - "comments": "

As mentioned elsewhere, the initialize callback will not be invoked immediately. It is deferred until the filter is used in some way.

\n\n

A filter's attribute checks and check and apply callbacks will be issued in order of priority on smudge (to workdir), and in reverse order of priority on clean (to odb).

\n\n

Two filters are preregistered with libgit2: - GIT_FILTER_CRLF with priority 0 - GIT_FILTER_IDENT with priority 100

\n\n

Currently the filter registry is not thread safe, so any registering or deregistering of filters must be done outside of any possible usage of the filters (i.e. during application setup or shutdown).

\n", - "group": "filter" - }, - "git_filter_unregister": { - "type": "function", - "file": "sys/filter.h", - "line": 328, - "lineto": 328, - "args": [ - { - "name": "name", - "type": "const char *", - "comment": "The name under which the filter was registered" - } - ], - "argline": "const char *name", - "sig": "const char *", - "return": { - "type": "int", - "comment": " 0 on success, error code \n<\n0 on failure" - }, - "description": "

Remove the filter with the given name

\n", - "comments": "

Attempting to remove the builtin libgit2 filters is not permitted and will return an error.

\n\n

Currently the filter registry is not thread safe, so any registering or deregistering of filters must be done outside of any possible usage of the filters (i.e. during application setup or shutdown).

\n", - "group": "filter" - }, - "git_hashsig_create": { - "type": "function", - "file": "sys/hashsig.h", - "line": 62, - "lineto": 66, - "args": [ - { - "name": "out", - "type": "git_hashsig **", - "comment": "The computed similarity signature." - }, - { - "name": "buf", - "type": "const char *", - "comment": "The input buffer." - }, - { - "name": "buflen", - "type": "size_t", - "comment": "The input buffer size." - }, - { - "name": "opts", - "type": "git_hashsig_option_t", - "comment": "The signature computation options (see above)." - } - ], - "argline": "git_hashsig **out, const char *buf, size_t buflen, git_hashsig_option_t opts", - "sig": "git_hashsig **::const char *::size_t::git_hashsig_option_t", - "return": { - "type": "int", - "comment": " 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to\n compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or\n error code." - }, - "description": "

Compute a similarity signature for a text buffer

\n", - "comments": "

If you have passed the option GIT_HASHSIG_IGNORE_WHITESPACE, then the whitespace will be removed from the buffer while it is being processed, modifying the buffer in place. Sorry about that!

\n", - "group": "hashsig" - }, - "git_hashsig_create_fromfile": { - "type": "function", - "file": "sys/hashsig.h", - "line": 81, - "lineto": 84, - "args": [ - { - "name": "out", - "type": "git_hashsig **", - "comment": "The computed similarity signature." - }, - { - "name": "path", - "type": "const char *", - "comment": "The path to the input file." - }, - { - "name": "opts", - "type": "git_hashsig_option_t", - "comment": "The signature computation options (see above)." - } - ], - "argline": "git_hashsig **out, const char *path, git_hashsig_option_t opts", - "sig": "git_hashsig **::const char *::git_hashsig_option_t", - "return": { - "type": "int", - "comment": " 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to\n compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or\n error code." - }, - "description": "

Compute a similarity signature for a text file

\n", - "comments": "

This walks through the file, only loading a maximum of 4K of file data at a time. Otherwise, it acts just like git_hashsig_create.

\n", - "group": "hashsig" - }, - "git_hashsig_free": { - "type": "function", - "file": "sys/hashsig.h", - "line": 91, - "lineto": 91, - "args": [ - { - "name": "sig", - "type": "git_hashsig *", - "comment": "The similarity signature to free." - } - ], - "argline": "git_hashsig *sig", - "sig": "git_hashsig *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Release memory for a content similarity signature

\n", - "comments": "", - "group": "hashsig" - }, - "git_hashsig_compare": { - "type": "function", - "file": "sys/hashsig.h", - "line": 100, - "lineto": 102, - "args": [ - { - "name": "a", - "type": "const git_hashsig *", - "comment": "The first similarity signature to compare." - }, - { - "name": "b", - "type": "const git_hashsig *", - "comment": "The second similarity signature to compare." - } - ], - "argline": "const git_hashsig *a, const git_hashsig *b", - "sig": "const git_hashsig *::const git_hashsig *", - "return": { - "type": "int", - "comment": " [0 to 100] on success as the similarity score, or error code." - }, - "description": "

Measure similarity score between two similarity signatures

\n", - "comments": "", - "group": "hashsig" - }, - "git_mempack_new": { - "type": "function", - "file": "sys/mempack.h", - "line": 45, - "lineto": 45, - "args": [ - { - "name": "out", - "type": "git_odb_backend **", - "comment": "Pointer where to store the ODB backend" - } - ], - "argline": "git_odb_backend **out", - "sig": "git_odb_backend **", - "return": { - "type": "int", - "comment": " 0 on success; error code otherwise" - }, - "description": "
Instantiate a new mempack backend.\n
\n", - "comments": "
The backend must be added to an existing ODB with the highest   priority.\n\n    git_mempack_new(&mempacker);        git_repository_odb(&odb, repository);       git_odb_add_backend(odb, mempacker, 999);\n\nOnce the backend has been loaded, all writes to the ODB will    instead be queued in memory, and can be finalized with  `git_mempack_dump`.\n\nSubsequent reads will also be served from the in-memory store   to ensure consistency, until the memory store is dumped.\n
\n", - "group": "mempack" - }, - "git_mempack_dump": { - "type": "function", - "file": "sys/mempack.h", - "line": 68, - "lineto": 68, - "args": [ - { - "name": "pack", - "type": "git_buf *", - "comment": "Buffer where to store the raw packfile" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "The active repository where the backend is loaded" - }, - { - "name": "backend", - "type": "git_odb_backend *", - "comment": "The mempack backend" - } - ], - "argline": "git_buf *pack, git_repository *repo, git_odb_backend *backend", - "sig": "git_buf *::git_repository *::git_odb_backend *", - "return": { - "type": "int", - "comment": " 0 on success; error code otherwise" - }, - "description": "
Dump all the queued in-memory writes to a packfile.\n
\n", - "comments": "
The contents of the packfile will be stored in the given buffer.    It is the caller's responsibility to ensure that the generated  packfile is available to the repository (e.g. by writing it to disk, or doing something crazy like distributing it across   several copies of the repository over a network).\n\nOnce the generated packfile is available to the repository, call `git_mempack_reset` to cleanup the memory store.\n\nCalling `git_mempack_reset` before the packfile has been    written to disk will result in an inconsistent repository   (the objects in the memory store won't be accessible).\n
\n", - "group": "mempack" - }, - "git_mempack_reset": { - "type": "function", - "file": "sys/mempack.h", - "line": 82, - "lineto": 82, - "args": [ - { - "name": "backend", - "type": "git_odb_backend *", - "comment": "The mempack backend" - } - ], - "argline": "git_odb_backend *backend", - "sig": "git_odb_backend *", - "return": { - "type": "void", - "comment": null - }, - "description": "
Reset the memory packer by clearing all the queued objects.\n
\n", - "comments": "
This assumes that `git_mempack_dump` has been called before to  store all the queued objects into a single packfile.\n\nAlternatively, call `reset` without a previous dump to "undo"   all the recently written objects, giving transaction-like   semantics to the Git repository.\n
\n", - "group": "mempack" - }, - "git_odb_init_backend": { - "type": "function", - "file": "sys/odb_backend.h", - "line": 116, - "lineto": 118, - "args": [ - { - "name": "backend", - "type": "git_odb_backend *", - "comment": "the `git_odb_backend` struct to initialize." - }, - { - "name": "version", - "type": "unsigned int", - "comment": "Version the struct; pass `GIT_ODB_BACKEND_VERSION`" - } - ], - "argline": "git_odb_backend *backend, unsigned int version", - "sig": "git_odb_backend *::unsigned int", - "return": { - "type": "int", - "comment": " Zero on success; -1 on failure." - }, - "description": "

Initializes a git_odb_backend with default values. Equivalent to\n creating an instance with GIT_ODB_BACKEND_INIT.

\n", - "comments": "", - "group": "odb" - }, - "git_openssl_set_locking": { - "type": "function", - "file": "sys/openssl.h", - "line": 34, - "lineto": 34, - "args": [], - "argline": "", - "sig": "", - "return": { - "type": "int", - "comment": " 0 on success, -1 if there are errors or if libgit2 was not\n built with OpenSSL and threading support." - }, - "description": "

Initialize the OpenSSL locks

\n", - "comments": "

OpenSSL requires the application to determine how it performs locking.

\n\n

This is a last-resort convenience function which libgit2 provides for allocating and initializing the locks as well as setting the locking function to use the system's native locking functions.

\n\n

The locking function will be cleared and the memory will be freed when you call git_threads_sutdown().

\n\n

If your programming language has an OpenSSL package/bindings, it likely sets up locking. You should very strongly prefer that over this function.

\n", - "group": "openssl" - }, - "git_refdb_init_backend": { - "type": "function", - "file": "sys/refdb_backend.h", - "line": 183, - "lineto": 185, - "args": [ - { - "name": "backend", - "type": "git_refdb_backend *", - "comment": "the `git_refdb_backend` struct to initialize" - }, - { - "name": "version", - "type": "unsigned int", - "comment": "Version of struct; pass `GIT_REFDB_BACKEND_VERSION`" - } - ], - "argline": "git_refdb_backend *backend, unsigned int version", - "sig": "git_refdb_backend *::unsigned int", - "return": { - "type": "int", - "comment": " Zero on success; -1 on failure." - }, - "description": "

Initializes a git_refdb_backend with default values. Equivalent to\n creating an instance with GIT_REFDB_BACKEND_INIT.

\n", - "comments": "", - "group": "refdb" - }, - "git_refdb_backend_fs": { - "type": "function", - "file": "sys/refdb_backend.h", - "line": 198, - "lineto": 200, - "args": [ - { - "name": "backend_out", - "type": "git_refdb_backend **", - "comment": "Output pointer to the git_refdb_backend object" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "Git repository to access" - } - ], - "argline": "git_refdb_backend **backend_out, git_repository *repo", - "sig": "git_refdb_backend **::git_repository *", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 error code on failure" - }, - "description": "

Constructors for default filesystem-based refdb backend

\n", - "comments": "

Under normal usage, this is called for you when the repository is opened / created, but you can use this to explicitly construct a filesystem refdb backend for a repository.

\n", - "group": "refdb" - }, - "git_refdb_set_backend": { - "type": "function", - "file": "sys/refdb_backend.h", - "line": 212, - "lineto": 214, - "args": [ - { - "name": "refdb", - "type": "git_refdb *", - "comment": "database to add the backend to" - }, - { - "name": "backend", - "type": "git_refdb_backend *", - "comment": "pointer to a git_refdb_backend instance" - } - ], - "argline": "git_refdb *refdb, git_refdb_backend *backend", - "sig": "git_refdb *::git_refdb_backend *", - "return": { - "type": "int", - "comment": " 0 on success; error code otherwise" - }, - "description": "

Sets the custom backend to an existing reference DB

\n", - "comments": "

The git_refdb will take ownership of the git_refdb_backend so you should NOT free it after calling this function.

\n", - "group": "refdb" - }, - "git_reference__alloc": { - "type": "function", - "file": "sys/refs.h", - "line": 31, - "lineto": 34, - "args": [ - { - "name": "name", - "type": "const char *", - "comment": "the reference name" - }, - { - "name": "oid", - "type": "const git_oid *", - "comment": "the object id for a direct reference" - }, - { - "name": "peel", - "type": "const git_oid *", - "comment": "the first non-tag object's OID, or NULL" - } - ], - "argline": "const char *name, const git_oid *oid, const git_oid *peel", - "sig": "const char *::const git_oid *::const git_oid *", - "return": { - "type": "git_reference *", - "comment": " the created git_reference or NULL on error" - }, - "description": "

Create a new direct reference from an OID.

\n", - "comments": "", - "group": "reference" - }, - "git_reference__alloc_symbolic": { - "type": "function", - "file": "sys/refs.h", - "line": 43, - "lineto": 45, - "args": [ - { - "name": "name", - "type": "const char *", - "comment": "the reference name" - }, - { - "name": "target", - "type": "const char *", - "comment": "the target for a symbolic reference" - } - ], - "argline": "const char *name, const char *target", - "sig": "const char *::const char *", - "return": { - "type": "git_reference *", - "comment": " the created git_reference or NULL on error" - }, - "description": "

Create a new symbolic reference.

\n", - "comments": "", - "group": "reference" - }, - "git_repository_new": { - "type": "function", - "file": "sys/repository.h", - "line": 31, - "lineto": 31, - "args": [ - { - "name": "out", - "type": "git_repository **", - "comment": "The blank repository" - } - ], - "argline": "git_repository **out", - "sig": "git_repository **", - "return": { - "type": "int", - "comment": " 0 on success, or an error code" - }, - "description": "

Create a new repository with neither backends nor config object

\n", - "comments": "

Note that this is only useful if you wish to associate the repository with a non-filesystem-backed object database and config store.

\n", - "group": "repository" - }, - "git_repository__cleanup": { - "type": "function", - "file": "sys/repository.h", - "line": 44, - "lineto": 44, - "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": null - } - ], - "argline": "git_repository *repo", - "sig": "git_repository *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Reset all the internal state in a repository.

\n", - "comments": "

This will free all the mapped memory and internal objects of the repository and leave it in a "blank" state.

\n\n

There's no need to call this function directly unless you're trying to aggressively cleanup the repo before its deallocation. git_repository_free already performs this operation before deallocation the repo.

\n", - "group": "repository" - }, - "git_repository_reinit_filesystem": { - "type": "function", - "file": "sys/repository.h", - "line": 61, - "lineto": 63, - "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": "A repository object" - }, - { - "name": "recurse_submodules", - "type": "int", - "comment": "Should submodules be updated recursively" - } - ], - "argline": "git_repository *repo, int recurse_submodules", - "sig": "git_repository *::int", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n 0 on error" - }, - "description": "

Update the filesystem config settings for an open repository

\n", - "comments": "

When a repository is initialized, config values are set based on the properties of the filesystem that the repository is on, such as "core.ignorecase", "core.filemode", "core.symlinks", etc. If the repository is moved to a new filesystem, these properties may no longer be correct and API calls may not behave as expected. This call reruns the phase of repository initialization that sets those properties to compensate for the current filesystem of the repo.

\n", - "group": "repository" - }, - "git_repository_set_config": { - "type": "function", - "file": "sys/repository.h", - "line": 78, - "lineto": 78, - "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": "A repository object" - }, - { - "name": "config", - "type": "git_config *", - "comment": "A Config object" - } - ], - "argline": "git_repository *repo, git_config *config", - "sig": "git_repository *::git_config *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Set the configuration file for this repository

\n", - "comments": "

This configuration file will be used for all configuration queries involving this repository.

\n\n

The repository will keep a reference to the config file; the user must still free the config after setting it to the repository, or it will leak.

\n", - "group": "repository" - }, - "git_repository_set_odb": { - "type": "function", - "file": "sys/repository.h", - "line": 93, - "lineto": 93, - "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": "A repository object" - }, - { - "name": "odb", - "type": "git_odb *", - "comment": "An ODB object" - } - ], - "argline": "git_repository *repo, git_odb *odb", - "sig": "git_repository *::git_odb *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Set the Object Database for this repository

\n", - "comments": "

The ODB will be used for all object-related operations involving this repository.

\n\n

The repository will keep a reference to the ODB; the user must still free the ODB object after setting it to the repository, or it will leak.

\n", - "group": "repository" - }, - "git_repository_set_refdb": { - "type": "function", - "file": "sys/repository.h", - "line": 108, - "lineto": 108, - "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": "A repository object" - }, - { - "name": "refdb", - "type": "git_refdb *", - "comment": "An refdb object" - } - ], - "argline": "git_repository *repo, git_refdb *refdb", - "sig": "git_repository *::git_refdb *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Set the Reference Database Backend for this repository

\n", - "comments": "

The refdb will be used for all reference related operations involving this repository.

\n\n

The repository will keep a reference to the refdb; the user must still free the refdb object after setting it to the repository, or it will leak.

\n", - "group": "repository" - }, - "git_repository_set_index": { - "type": "function", - "file": "sys/repository.h", - "line": 123, - "lineto": 123, - "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": "A repository object" - }, - { - "name": "index", - "type": "git_index *", - "comment": "An index object" - } - ], - "argline": "git_repository *repo, git_index *index", - "sig": "git_repository *::git_index *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Set the index file for this repository

\n", - "comments": "

This index will be used for all index-related operations involving this repository.

\n\n

The repository will keep a reference to the index file; the user must still free the index after setting it to the repository, or it will leak.

\n", - "group": "repository" - }, - "git_repository_set_bare": { - "type": "function", - "file": "sys/repository.h", - "line": 136, - "lineto": 136, - "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": "Repo to make bare" - } - ], - "argline": "git_repository *repo", - "sig": "git_repository *", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 on failure" - }, - "description": "

Set a repository to be bare.

\n", - "comments": "

Clear the working directory and set core.bare to true. You may also want to call git_repository_set_index(repo, NULL) since a bare repo typically does not have an index, but this function will not do that for you.

\n", - "group": "repository" - }, - "git_repository_submodule_cache_all": { - "type": "function", - "file": "sys/repository.h", - "line": 149, - "lineto": 150, - "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": "the repository whose submodules will be cached." - } - ], - "argline": "git_repository *repo", - "sig": "git_repository *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Load and cache all submodules.

\n", - "comments": "

Because the .gitmodules file is unstructured, loading submodules is an O(N) operation. Any operation (such as git_rebase_init) that requires accessing all submodules is O(N^2) in the number of submodules, if it has to look each one up individually. This function loads all submodules and caches them so that subsequent calls to git_submodule_lookup are O(1).

\n", - "group": "repository" - }, - "git_repository_submodule_cache_clear": { - "type": "function", - "file": "sys/repository.h", - "line": 164, - "lineto": 165, - "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": "the repository whose submodule cache will be cleared" - } - ], - "argline": "git_repository *repo", - "sig": "git_repository *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Clear the submodule cache.

\n", - "comments": "

Clear the submodule cache populated by git_repository_submodule_cache_all. If there is no cache, do nothing.

\n\n

The cache incorporates data from the repository's configuration, as well as the state of the working tree, the index, and HEAD. So any time any of these has changed, the cache might become invalid.

\n", - "group": "repository" - }, - "git_stream_register_tls": { - "type": "function", - "file": "sys/stream.h", - "line": 54, - "lineto": 54, - "args": [ - { - "name": "ctor", - "type": "git_stream_cb", - "comment": "the constructor to use" - } - ], - "argline": "git_stream_cb ctor", - "sig": "git_stream_cb", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Register a TLS stream constructor for the library to use

\n", - "comments": "

If a constructor is already set, it will be overwritten. Pass NULL in order to deregister the current constructor.

\n", - "group": "stream" - }, - "git_time_monotonic": { - "type": "function", - "file": "sys/time.h", - "line": 27, - "lineto": 27, - "args": [], - "argline": "", - "sig": "", - "return": { - "type": "double", - "comment": null - }, - "description": "

Return a monotonic time value, useful for measuring running time\n and setting up timeouts.

\n", - "comments": "

The returned value is an arbitrary point in time -- it can only be used when comparing it to another git_time_monotonic call.

\n\n

The time is returned in seconds, with a decimal fraction that differs on accuracy based on the underlying system, but should be least accurate to Nanoseconds.

\n\n

This function cannot fail.

\n", - "group": "time" - }, - "git_transport_init": { - "type": "function", - "file": "sys/transport.h", - "line": 119, - "lineto": 121, - "args": [ - { - "name": "opts", - "type": "git_transport *", - "comment": "the `git_transport` struct to initialize" - }, - { - "name": "version", - "type": "unsigned int", - "comment": "Version of struct; pass `GIT_TRANSPORT_VERSION`" - } - ], - "argline": "git_transport *opts, unsigned int version", - "sig": "git_transport *::unsigned int", - "return": { - "type": "int", - "comment": " Zero on success; -1 on failure." - }, - "description": "

Initializes a git_transport with default values. Equivalent to\n creating an instance with GIT_TRANSPORT_INIT.

\n", - "comments": "", - "group": "transport" - }, - "git_transport_new": { - "type": "function", - "file": "sys/transport.h", - "line": 133, - "lineto": 133, - "args": [ - { - "name": "out", - "type": "git_transport **", - "comment": "The newly created transport (out)" - }, - { - "name": "owner", - "type": "git_remote *", - "comment": "The git_remote which will own this transport" - }, - { - "name": "url", - "type": "const char *", - "comment": "The URL to connect to" - } - ], - "argline": "git_transport **out, git_remote *owner, const char *url", - "sig": "git_transport **::git_remote *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Function to use to create a transport from a URL. The transport database\n is scanned to find a transport that implements the scheme of the URI (i.e.\n git:// or http://) and a transport object is returned to the caller.

\n", - "comments": "", - "group": "transport" - }, - "git_transport_ssh_with_paths": { - "type": "function", - "file": "sys/transport.h", - "line": 149, - "lineto": 149, - "args": [ - { - "name": "out", - "type": "git_transport **", - "comment": "the resulting transport" - }, - { - "name": "owner", - "type": "git_remote *", - "comment": "the owning remote" - }, - { - "name": "payload", - "type": "void *", - "comment": "a strarray with the paths" - } - ], - "argline": "git_transport **out, git_remote *owner, void *payload", - "sig": "git_transport **::git_remote *::void *", + "argline": "git_submodule *submodule", + "sig": "git_submodule *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "git_submodule_update_t", + "comment": " The current git_submodule_update_t value that will be used\n for this submodule." }, - "description": "

Create an ssh transport with custom git command paths

\n", - "comments": "

This is a factory function suitable for setting as the transport callback in a remote (or for a clone in the options).

\n\n

The payload argument must be a strarray pointer with the paths for the git-upload-pack and git-receive-pack at index 0 and 1.

\n", - "group": "transport" + "description": "

Get the update rule that will be used for the submodule.

\n", + "comments": "

This value controls the behavior of the git submodule update command. There are four useful values documented with git_submodule_update_t.

\n", + "group": "submodule" }, - "git_transport_register": { + "git_submodule_set_update": { "type": "function", - "file": "sys/transport.h", - "line": 164, - "lineto": 167, + "file": "git2/submodule.h", + "line": 492, + "lineto": 495, "args": [ { - "name": "prefix", - "type": "const char *", - "comment": "The scheme (ending in \"://\") to match, i.e. \"git://\"" + "name": "repo", + "type": "git_repository *", + "comment": "the repository to affect" }, { - "name": "cb", - "type": "git_transport_cb", - "comment": "The callback used to create an instance of the transport" + "name": "name", + "type": "const char *", + "comment": "the name of the submodule to configure" }, { - "name": "param", - "type": "void *", - "comment": "A fixed parameter to pass to cb at creation time" + "name": "update", + "type": "git_submodule_update_t", + "comment": "The new value to use" } ], - "argline": "const char *prefix, git_transport_cb cb, void *param", - "sig": "const char *::git_transport_cb::void *", + "argline": "git_repository *repo, const char *name, git_submodule_update_t update", + "sig": "git_repository *::const char *::git_submodule_update_t", "return": { "type": "int", "comment": " 0 or an error code" }, - "description": "

Add a custom transport definition, to be used in addition to the built-in\n set of transports that come with libgit2.

\n", - "comments": "

The caller is responsible for synchronizing calls to git_transport_register and git_transport_unregister with other calls to the library that instantiate transports.

\n", - "group": "transport" + "description": "

Set the update rule for the submodule in the configuration

\n", + "comments": "

This setting won't affect any existing instances.

\n", + "group": "submodule" }, - "git_transport_unregister": { + "git_submodule_fetch_recurse_submodules": { "type": "function", - "file": "sys/transport.h", - "line": 177, - "lineto": 178, + "file": "git2/submodule.h", + "line": 508, + "lineto": 509, "args": [ { - "name": "prefix", - "type": "const char *", - "comment": "From the previous call to git_transport_register" + "name": "submodule", + "type": "git_submodule *", + "comment": null } ], - "argline": "const char *prefix", - "sig": "const char *", + "argline": "git_submodule *submodule", + "sig": "git_submodule *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "git_submodule_recurse_t", + "comment": " 0 if fetchRecurseSubmodules is false, 1 if true" }, - "description": "

Unregister a custom transport definition which was previously registered\n with git_transport_register.

\n", - "comments": "", - "group": "transport" + "description": "

Read the fetchRecurseSubmodules rule for a submodule.

\n", + "comments": "

This accesses the submodule..fetchRecurseSubmodules value for the submodule that controls fetching behavior for the submodule.

\n\n

Note that at this time, libgit2 does not honor this setting and the fetch functionality current ignores submodules.

\n", + "group": "submodule" }, - "git_transport_dummy": { + "git_submodule_set_fetch_recurse_submodules": { "type": "function", - "file": "sys/transport.h", - "line": 191, - "lineto": 194, + "file": "git2/submodule.h", + "line": 521, + "lineto": 524, "args": [ { - "name": "out", - "type": "git_transport **", - "comment": "The newly created transport (out)" + "name": "repo", + "type": "git_repository *", + "comment": "the repository to affect" }, { - "name": "owner", - "type": "git_remote *", - "comment": "The git_remote which will own this transport" + "name": "name", + "type": "const char *", + "comment": "the submodule to configure" }, { - "name": "payload", - "type": "void *", - "comment": "You must pass NULL for this parameter." + "name": "fetch_recurse_submodules", + "type": "git_submodule_recurse_t", + "comment": "Boolean value" } ], - "argline": "git_transport **out, git_remote *owner, void *payload", - "sig": "git_transport **::git_remote *::void *", + "argline": "git_repository *repo, const char *name, git_submodule_recurse_t fetch_recurse_submodules", + "sig": "git_repository *::const char *::git_submodule_recurse_t", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " old value for fetchRecurseSubmodules" }, - "description": "

Create an instance of the dummy transport.

\n", - "comments": "", - "group": "transport" + "description": "

Set the fetchRecurseSubmodules rule for a submodule in the configuration

\n", + "comments": "

This setting won't affect any existing instances.

\n", + "group": "submodule" }, - "git_transport_local": { + "git_submodule_init": { "type": "function", - "file": "sys/transport.h", - "line": 204, - "lineto": 207, + "file": "git2/submodule.h", + "line": 539, + "lineto": 539, "args": [ { - "name": "out", - "type": "git_transport **", - "comment": "The newly created transport (out)" - }, - { - "name": "owner", - "type": "git_remote *", - "comment": "The git_remote which will own this transport" + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule to write into the superproject config" }, { - "name": "payload", - "type": "void *", - "comment": "You must pass NULL for this parameter." + "name": "overwrite", + "type": "int", + "comment": "By default, existing entries will not be overwritten,\n but setting this to true forces them to be updated." } ], - "argline": "git_transport **out, git_remote *owner, void *payload", - "sig": "git_transport **::git_remote *::void *", + "argline": "git_submodule *submodule, int overwrite", + "sig": "git_submodule *::int", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, \n<\n0 on failure." }, - "description": "

Create an instance of the local transport.

\n", - "comments": "", - "group": "transport" + "description": "

Copy submodule info into ".git/config" file.

\n", + "comments": "

Just like "git submodule init", this copies information about the submodule into ".git/config". You can use the accessor functions above to alter the in-memory git_submodule object and control what is written to the config, overriding what is in .gitmodules.

\n", + "group": "submodule" }, - "git_transport_smart": { + "git_submodule_repo_init": { "type": "function", - "file": "sys/transport.h", - "line": 217, - "lineto": 220, + "file": "git2/submodule.h", + "line": 554, + "lineto": 557, "args": [ { "name": "out", - "type": "git_transport **", - "comment": "The newly created transport (out)" + "type": "git_repository **", + "comment": "Output pointer to the created git repository." }, { - "name": "owner", - "type": "git_remote *", - "comment": "The git_remote which will own this transport" + "name": "sm", + "type": "const git_submodule *", + "comment": "The submodule to create a new subrepository from." }, { - "name": "payload", - "type": "void *", - "comment": "A pointer to a git_smart_subtransport_definition" + "name": "use_gitlink", + "type": "int", + "comment": "Should the workdir contain a gitlink to\n the repo in .git/modules vs. repo directly in workdir." } ], - "argline": "git_transport **out, git_remote *owner, void *payload", - "sig": "git_transport **::git_remote *::void *", + "argline": "git_repository **out, const git_submodule *sm, int use_gitlink", + "sig": "git_repository **::const git_submodule *::int", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, \n<\n0 on failure." }, - "description": "

Create an instance of the smart transport.

\n", - "comments": "", - "group": "transport" + "description": "

Set up the subrepository for a submodule in preparation for clone.

\n", + "comments": "

This function can be called to init and set up a submodule repository from a submodule in preparation to clone it from its remote.

\n", + "group": "submodule" }, - "git_transport_smart_certificate_check": { + "git_submodule_sync": { "type": "function", - "file": "sys/transport.h", - "line": 231, - "lineto": 231, + "file": "git2/submodule.h", + "line": 567, + "lineto": 567, "args": [ { - "name": "transport", - "type": "git_transport *", - "comment": "a smart transport" - }, - { - "name": "cert", - "type": "git_cert *", - "comment": "the certificate to pass to the caller" - }, - { - "name": "valid", - "type": "int", - "comment": "whether we believe the certificate is valid" - }, - { - "name": "hostname", - "type": "const char *", - "comment": "the hostname we connected to" + "name": "submodule", + "type": "git_submodule *", + "comment": null } ], - "argline": "git_transport *transport, git_cert *cert, int valid, const char *hostname", - "sig": "git_transport *::git_cert *::int::const char *", + "argline": "git_submodule *submodule", + "sig": "git_submodule *", "return": { "type": "int", - "comment": " the return value of the callback" + "comment": null }, - "description": "

Call the certificate check for this transport.

\n", - "comments": "", - "group": "transport" + "description": "

Copy submodule remote info into submodule repo.

\n", + "comments": "

This copies the information about the submodules URL into the checked out submodule config, acting like "git submodule sync". This is useful if you have altered the URL for the submodule (or it has been altered by a fetch of upstream changes) and you need to update your local repo.

\n", + "group": "submodule" }, - "git_transport_smart_credentials": { + "git_submodule_open": { "type": "function", - "file": "sys/transport.h", - "line": 242, - "lineto": 242, + "file": "git2/submodule.h", + "line": 581, + "lineto": 583, "args": [ { - "name": "out", - "type": "git_cred **", - "comment": "the pointer where the creds are to be stored" - }, - { - "name": "transport", - "type": "git_transport *", - "comment": "a smart transport" - }, - { - "name": "user", - "type": "const char *", - "comment": "the user we saw on the url (if any)" + "name": "repo", + "type": "git_repository **", + "comment": "Pointer to the submodule repo which was opened" }, { - "name": "methods", - "type": "int", - "comment": "available methods for authentication" + "name": "submodule", + "type": "git_submodule *", + "comment": "Submodule to be opened" } ], - "argline": "git_cred **out, git_transport *transport, const char *user, int methods", - "sig": "git_cred **::git_transport *::const char *::int", + "argline": "git_repository **repo, git_submodule *submodule", + "sig": "git_repository **::git_submodule *", "return": { "type": "int", - "comment": " the return value of the callback" + "comment": " 0 on success, \n<\n0 if submodule repo could not be opened." }, - "description": "

Call the credentials callback for this transport

\n", - "comments": "", - "group": "transport" + "description": "

Open the repository for a submodule.

\n", + "comments": "

This is a newly opened repository object. The caller is responsible for calling git_repository_free() on it when done. Multiple calls to this function will return distinct git_repository objects. This will only work if the submodule is checked out into the working directory.

\n", + "group": "submodule" }, - "git_transport_smart_proxy_options": { + "git_submodule_reload": { "type": "function", - "file": "sys/transport.h", - "line": 252, - "lineto": 252, + "file": "git2/submodule.h", + "line": 595, + "lineto": 595, "args": [ { - "name": "out", - "type": "git_proxy_options *", - "comment": "options struct to fill" + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule to reload" }, { - "name": "transport", - "type": "git_transport *", - "comment": "the transport to extract the data from." + "name": "force", + "type": "int", + "comment": "Force reload even if the data doesn't seem out of date" } ], - "argline": "git_proxy_options *out, git_transport *transport", - "sig": "git_proxy_options *::git_transport *", + "argline": "git_submodule *submodule, int force", + "sig": "git_submodule *::int", "return": { "type": "int", - "comment": null + "comment": " 0 on success, \n<\n0 on error" }, - "description": "

Get a copy of the proxy options

\n", - "comments": "

The url is copied and must be freed by the caller.

\n", - "group": "transport" + "description": "

Reread submodule info from config, index, and HEAD.

\n", + "comments": "

Call this to reread cached submodule information for this submodule if you have reason to believe that it has changed.

\n", + "group": "submodule" }, - "git_smart_subtransport_http": { + "git_submodule_status": { "type": "function", - "file": "sys/transport.h", - "line": 362, - "lineto": 365, + "file": "git2/submodule.h", + "line": 611, + "lineto": 615, "args": [ { - "name": "out", - "type": "git_smart_subtransport **", - "comment": "The newly created subtransport" - }, - { - "name": "owner", - "type": "git_transport *", - "comment": "The smart transport to own this subtransport" + "name": "status", + "type": "unsigned int *", + "comment": "Combination of `GIT_SUBMODULE_STATUS` flags" }, { - "name": "param", - "type": "void *", - "comment": null - } - ], - "argline": "git_smart_subtransport **out, git_transport *owner, void *param", - "sig": "git_smart_subtransport **::git_transport *::void *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Create an instance of the http subtransport. This subtransport\n also supports https. On Win32, this subtransport may be implemented\n using the WinHTTP library.

\n", - "comments": "", - "group": "smart" - }, - "git_smart_subtransport_git": { - "type": "function", - "file": "sys/transport.h", - "line": 374, - "lineto": 377, - "args": [ - { - "name": "out", - "type": "git_smart_subtransport **", - "comment": "The newly created subtransport" + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to look" }, { - "name": "owner", - "type": "git_transport *", - "comment": "The smart transport to own this subtransport" + "name": "name", + "type": "const char *", + "comment": "name of the submodule" }, { - "name": "param", - "type": "void *", - "comment": null + "name": "ignore", + "type": "git_submodule_ignore_t", + "comment": "the ignore rules to follow" } ], - "argline": "git_smart_subtransport **out, git_transport *owner, void *param", - "sig": "git_smart_subtransport **::git_transport *::void *", + "argline": "unsigned int *status, git_repository *repo, const char *name, git_submodule_ignore_t ignore", + "sig": "unsigned int *::git_repository *::const char *::git_submodule_ignore_t", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, \n<\n0 on error" }, - "description": "

Create an instance of the git subtransport.

\n", - "comments": "", - "group": "smart" + "description": "

Get the status for a submodule.

\n", + "comments": "

This looks at a submodule and tries to determine the status. It will return a combination of the GIT_SUBMODULE_STATUS values above. How deeply it examines the working directory to do this will depend on the git_submodule_ignore_t value for the submodule.

\n", + "group": "submodule", + "examples": { + "status.c": [ + "ex/HEAD/status.html#git_submodule_status-22" + ] + } }, - "git_smart_subtransport_ssh": { + "git_submodule_location": { "type": "function", - "file": "sys/transport.h", - "line": 386, - "lineto": 389, + "file": "git2/submodule.h", + "line": 631, + "lineto": 633, "args": [ { - "name": "out", - "type": "git_smart_subtransport **", - "comment": "The newly created subtransport" - }, - { - "name": "owner", - "type": "git_transport *", - "comment": "The smart transport to own this subtransport" + "name": "location_status", + "type": "unsigned int *", + "comment": "Combination of first four `GIT_SUBMODULE_STATUS` flags" }, { - "name": "param", - "type": "void *", - "comment": null + "name": "submodule", + "type": "git_submodule *", + "comment": "Submodule for which to get status" } ], - "argline": "git_smart_subtransport **out, git_transport *owner, void *param", - "sig": "git_smart_subtransport **::git_transport *::void *", + "argline": "unsigned int *location_status, git_submodule *submodule", + "sig": "unsigned int *::git_submodule *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, \n<\n0 on error" }, - "description": "

Create an instance of the ssh subtransport.

\n", - "comments": "", - "group": "smart" + "description": "

Get the locations of submodule information.

\n", + "comments": "

This is a bit like a very lightweight version of git_submodule_status. It just returns a made of the first four submodule status values (i.e. the ones like GIT_SUBMODULE_STATUS_IN_HEAD, etc) that tell you where the submodule data comes from (i.e. the HEAD commit, gitmodules file, etc.). This can be useful if you want to know if the submodule is present in the working directory at this point in time, etc.

\n", + "group": "submodule" }, "git_tag_lookup": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 33, "lineto": 34, "args": [ @@ -22887,7 +22175,7 @@ }, "git_tag_lookup_prefix": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 48, "lineto": 49, "args": [ @@ -22924,7 +22212,7 @@ }, "git_tag_free": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 61, "lineto": 61, "args": [ @@ -22951,7 +22239,7 @@ }, "git_tag_id": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 69, "lineto": 69, "args": [ @@ -22973,7 +22261,7 @@ }, "git_tag_owner": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 77, "lineto": 77, "args": [ @@ -22995,7 +22283,7 @@ }, "git_tag_target": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 89, "lineto": 89, "args": [ @@ -23027,7 +22315,7 @@ }, "git_tag_target_id": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 97, "lineto": 97, "args": [ @@ -23048,13 +22336,13 @@ "group": "tag", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tag_target_id-35" + "ex/HEAD/cat-file.html#git_tag_target_id-31" ] } }, "git_tag_target_type": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 105, "lineto": 105, "args": [ @@ -23067,7 +22355,7 @@ "argline": "const git_tag *tag", "sig": "const git_tag *", "return": { - "type": "git_otype", + "type": "git_object_t", "comment": " type of the tagged object" }, "description": "

Get the type of a tag's tagged object

\n", @@ -23075,7 +22363,7 @@ "group": "tag", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tag_target_type-36" + "ex/HEAD/cat-file.html#git_tag_target_type-32" ], "general.c": [ "ex/HEAD/general.html#git_tag_target_type-87" @@ -23084,7 +22372,7 @@ }, "git_tag_name": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 113, "lineto": 113, "args": [ @@ -23105,19 +22393,19 @@ "group": "tag", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tag_name-37" + "ex/HEAD/cat-file.html#git_tag_name-33" ], "general.c": [ "ex/HEAD/general.html#git_tag_name-88" ], "tag.c": [ - "ex/HEAD/tag.html#git_tag_name-20" + "ex/HEAD/tag.html#git_tag_name-16" ] } }, "git_tag_tagger": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 121, "lineto": 121, "args": [ @@ -23138,13 +22426,13 @@ "group": "tag", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tag_tagger-38" + "ex/HEAD/cat-file.html#git_tag_tagger-34" ] } }, "git_tag_message": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 129, "lineto": 129, "args": [ @@ -23165,20 +22453,20 @@ "group": "tag", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tag_message-39", - "ex/HEAD/cat-file.html#git_tag_message-40" + "ex/HEAD/cat-file.html#git_tag_message-35", + "ex/HEAD/cat-file.html#git_tag_message-36" ], "general.c": [ "ex/HEAD/general.html#git_tag_message-89" ], "tag.c": [ - "ex/HEAD/tag.html#git_tag_message-21" + "ex/HEAD/tag.html#git_tag_message-17" ] } }, "git_tag_create": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 171, "lineto": 178, "args": [ @@ -23229,13 +22517,13 @@ "group": "tag", "examples": { "tag.c": [ - "ex/HEAD/tag.html#git_tag_create-22" + "ex/HEAD/tag.html#git_tag_create-18" ] } }, "git_tag_annotation_create": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 203, "lineto": 209, "args": [ @@ -23280,9 +22568,9 @@ "comments": "

The message will not be cleaned up. This can be achieved through git_message_prettify().

\n", "group": "tag" }, - "git_tag_create_frombuffer": { + "git_tag_create_from_buffer": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 220, "lineto": 224, "args": [ @@ -23319,7 +22607,7 @@ }, "git_tag_create_lightweight": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 256, "lineto": 261, "args": [ @@ -23360,13 +22648,13 @@ "group": "tag", "examples": { "tag.c": [ - "ex/HEAD/tag.html#git_tag_create_lightweight-23" + "ex/HEAD/tag.html#git_tag_create_lightweight-19" ] } }, "git_tag_delete": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 276, "lineto": 278, "args": [ @@ -23392,13 +22680,13 @@ "group": "tag", "examples": { "tag.c": [ - "ex/HEAD/tag.html#git_tag_delete-24" + "ex/HEAD/tag.html#git_tag_delete-20" ] } }, "git_tag_list": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 293, "lineto": 295, "args": [ @@ -23425,7 +22713,7 @@ }, "git_tag_list_match": { "type": "function", - "file": "tag.h", + "file": "git2/tag.h", "line": 315, "lineto": 318, "args": [ @@ -23456,15 +22744,15 @@ "group": "tag", "examples": { "tag.c": [ - "ex/HEAD/tag.html#git_tag_list_match-25" + "ex/HEAD/tag.html#git_tag_list_match-21" ] } }, "git_tag_foreach": { "type": "function", - "file": "tag.h", - "line": 330, - "lineto": 333, + "file": "git2/tag.h", + "line": 339, + "lineto": 342, "args": [ { "name": "repo", @@ -23494,9 +22782,9 @@ }, "git_tag_peel": { "type": "function", - "file": "tag.h", - "line": 346, - "lineto": 348, + "file": "git2/tag.h", + "line": 355, + "lineto": 357, "args": [ { "name": "tag_target_out", @@ -23521,9 +22809,9 @@ }, "git_tag_dup": { "type": "function", - "file": "tag.h", - "line": 357, - "lineto": 357, + "file": "git2/tag.h", + "line": 366, + "lineto": 366, "args": [ { "name": "out", @@ -23548,7 +22836,7 @@ }, "git_trace_set": { "type": "function", - "file": "trace.h", + "file": "git2/trace.h", "line": 63, "lineto": 63, "args": [ @@ -23559,12 +22847,12 @@ }, { "name": "cb", - "type": "git_trace_callback", + "type": "git_trace_cb", "comment": "Function to call with trace data" } ], - "argline": "git_trace_level_t level, git_trace_callback cb", - "sig": "git_trace_level_t::git_trace_callback", + "argline": "git_trace_level_t level, git_trace_cb cb", + "sig": "git_trace_level_t::git_trace_cb", "return": { "type": "int", "comment": " 0 or an error code" @@ -23573,11 +22861,252 @@ "comments": "", "group": "trace" }, + "git_transaction_new": { + "type": "function", + "file": "git2/transaction.h", + "line": 32, + "lineto": 32, + "args": [ + { + "name": "out", + "type": "git_transaction **", + "comment": "the resulting transaction" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to lock" + } + ], + "argline": "git_transaction **out, git_repository *repo", + "sig": "git_transaction **::git_repository *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create a new transaction object

\n", + "comments": "

This does not lock anything, but sets up the transaction object to know from which repository to lock.

\n", + "group": "transaction" + }, + "git_transaction_lock_ref": { + "type": "function", + "file": "git2/transaction.h", + "line": 44, + "lineto": 44, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference to lock" + } + ], + "argline": "git_transaction *tx, const char *refname", + "sig": "git_transaction *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error message" + }, + "description": "

Lock a reference

\n", + "comments": "

Lock the specified reference. This is the first step to updating a reference.

\n", + "group": "transaction" + }, + "git_transaction_set_target": { + "type": "function", + "file": "git2/transaction.h", + "line": 59, + "lineto": 59, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + }, + { + "name": "refname", + "type": "const char *", + "comment": "reference to update" + }, + { + "name": "target", + "type": "const git_oid *", + "comment": "target to set the reference to" + }, + { + "name": "sig", + "type": "const git_signature *", + "comment": "signature to use in the reflog; pass NULL to read the identity from the config" + }, + { + "name": "msg", + "type": "const char *", + "comment": "message to use in the reflog" + } + ], + "argline": "git_transaction *tx, const char *refname, const git_oid *target, const git_signature *sig, const char *msg", + "sig": "git_transaction *::const char *::const git_oid *::const git_signature *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code" + }, + "description": "

Set the target of a reference

\n", + "comments": "

Set the target of the specified reference. This reference must be locked.

\n", + "group": "transaction" + }, + "git_transaction_set_symbolic_target": { + "type": "function", + "file": "git2/transaction.h", + "line": 74, + "lineto": 74, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + }, + { + "name": "refname", + "type": "const char *", + "comment": "reference to update" + }, + { + "name": "target", + "type": "const char *", + "comment": "target to set the reference to" + }, + { + "name": "sig", + "type": "const git_signature *", + "comment": "signature to use in the reflog; pass NULL to read the identity from the config" + }, + { + "name": "msg", + "type": "const char *", + "comment": "message to use in the reflog" + } + ], + "argline": "git_transaction *tx, const char *refname, const char *target, const git_signature *sig, const char *msg", + "sig": "git_transaction *::const char *::const char *::const git_signature *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code" + }, + "description": "

Set the target of a reference

\n", + "comments": "

Set the target of the specified reference. This reference must be locked.

\n", + "group": "transaction" + }, + "git_transaction_set_reflog": { + "type": "function", + "file": "git2/transaction.h", + "line": 87, + "lineto": 87, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference whose reflog to set" + }, + { + "name": "reflog", + "type": "const git_reflog *", + "comment": "the reflog as it should be written out" + } + ], + "argline": "git_transaction *tx, const char *refname, const git_reflog *reflog", + "sig": "git_transaction *::const char *::const git_reflog *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code" + }, + "description": "

Set the reflog of a reference

\n", + "comments": "

Set the specified reference's reflog. If this is combined with setting the target, that update won't be written to the reflog.

\n", + "group": "transaction" + }, + "git_transaction_remove": { + "type": "function", + "file": "git2/transaction.h", + "line": 96, + "lineto": 96, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference to remove" + } + ], + "argline": "git_transaction *tx, const char *refname", + "sig": "git_transaction *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code" + }, + "description": "

Remove a reference

\n", + "comments": "", + "group": "transaction" + }, + "git_transaction_commit": { + "type": "function", + "file": "git2/transaction.h", + "line": 107, + "lineto": 107, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + } + ], + "argline": "git_transaction *tx", + "sig": "git_transaction *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Commit the changes from the transaction

\n", + "comments": "

Perform the changes that have been queued. The updates will be made one by one, and the first failure will stop the processing.

\n", + "group": "transaction" + }, + "git_transaction_free": { + "type": "function", + "file": "git2/transaction.h", + "line": 117, + "lineto": 117, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + } + ], + "argline": "git_transaction *tx", + "sig": "git_transaction *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the resources allocated by this transaction

\n", + "comments": "

If any references remain locked, they will be unlocked without any changes made to them.

\n", + "group": "transaction" + }, "git_cred_has_username": { "type": "function", - "file": "transport.h", - "line": 190, - "lineto": 190, + "file": "git2/transport.h", + "line": 233, + "lineto": 233, "args": [ { "name": "cred", @@ -23597,9 +23126,9 @@ }, "git_cred_userpass_plaintext_new": { "type": "function", - "file": "transport.h", - "line": 201, - "lineto": 204, + "file": "git2/transport.h", + "line": 244, + "lineto": 247, "args": [ { "name": "out", @@ -23629,9 +23158,9 @@ }, "git_cred_ssh_key_new": { "type": "function", - "file": "transport.h", - "line": 217, - "lineto": 222, + "file": "git2/transport.h", + "line": 260, + "lineto": 265, "args": [ { "name": "out", @@ -23671,9 +23200,9 @@ }, "git_cred_ssh_interactive_new": { "type": "function", - "file": "transport.h", - "line": 233, - "lineto": 237, + "file": "git2/transport.h", + "line": 276, + "lineto": 280, "args": [ { "name": "out", @@ -23687,7 +23216,7 @@ }, { "name": "prompt_callback", - "type": "git_cred_ssh_interactive_callback", + "type": "git_cred_ssh_interactive_cb", "comment": "The callback method used for prompts." }, { @@ -23696,8 +23225,8 @@ "comment": "Additional data to pass to the callback." } ], - "argline": "git_cred **out, const char *username, git_cred_ssh_interactive_callback prompt_callback, void *payload", - "sig": "git_cred **::const char *::git_cred_ssh_interactive_callback::void *", + "argline": "git_cred **out, const char *username, git_cred_ssh_interactive_cb prompt_callback, void *payload", + "sig": "git_cred **::const char *::git_cred_ssh_interactive_cb::void *", "return": { "type": "int", "comment": " 0 for success or an error code for failure." @@ -23708,9 +23237,9 @@ }, "git_cred_ssh_key_from_agent": { "type": "function", - "file": "transport.h", - "line": 247, - "lineto": 249, + "file": "git2/transport.h", + "line": 290, + "lineto": 292, "args": [ { "name": "out", @@ -23735,9 +23264,9 @@ }, "git_cred_ssh_custom_new": { "type": "function", - "file": "transport.h", - "line": 269, - "lineto": 275, + "file": "git2/transport.h", + "line": 312, + "lineto": 318, "args": [ { "name": "out", @@ -23761,7 +23290,7 @@ }, { "name": "sign_callback", - "type": "git_cred_sign_callback", + "type": "git_cred_sign_cb", "comment": "The callback method to sign the data during the challenge." }, { @@ -23770,8 +23299,8 @@ "comment": "Additional data to pass to the callback." } ], - "argline": "git_cred **out, const char *username, const char *publickey, size_t publickey_len, git_cred_sign_callback sign_callback, void *payload", - "sig": "git_cred **::const char *::const char *::size_t::git_cred_sign_callback::void *", + "argline": "git_cred **out, const char *username, const char *publickey, size_t publickey_len, git_cred_sign_cb sign_callback, void *payload", + "sig": "git_cred **::const char *::const char *::size_t::git_cred_sign_cb::void *", "return": { "type": "int", "comment": " 0 for success or an error code for failure" @@ -23782,9 +23311,9 @@ }, "git_cred_default_new": { "type": "function", - "file": "transport.h", - "line": 283, - "lineto": 283, + "file": "git2/transport.h", + "line": 326, + "lineto": 326, "args": [ { "name": "out", @@ -23804,9 +23333,9 @@ }, "git_cred_username_new": { "type": "function", - "file": "transport.h", - "line": 291, - "lineto": 291, + "file": "git2/transport.h", + "line": 334, + "lineto": 334, "args": [ { "name": "cred", @@ -23831,9 +23360,9 @@ }, "git_cred_ssh_key_memory_new": { "type": "function", - "file": "transport.h", - "line": 303, - "lineto": 308, + "file": "git2/transport.h", + "line": 346, + "lineto": 351, "args": [ { "name": "out", @@ -23873,9 +23402,9 @@ }, "git_cred_free": { "type": "function", - "file": "transport.h", - "line": 319, - "lineto": 319, + "file": "git2/transport.h", + "line": 362, + "lineto": 362, "args": [ { "name": "cred", @@ -23895,7 +23424,7 @@ }, "git_tree_lookup": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 32, "lineto": 33, "args": [ @@ -23930,16 +23459,16 @@ "ex/HEAD/general.html#git_tree_lookup-91" ], "init.c": [ - "ex/HEAD/init.html#git_tree_lookup-14" + "ex/HEAD/init.html#git_tree_lookup-12" ], "merge.c": [ - "ex/HEAD/merge.html#git_tree_lookup-46" + "ex/HEAD/merge.html#git_tree_lookup-37" ] } }, "git_tree_lookup_prefix": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 47, "lineto": 51, "args": [ @@ -23976,7 +23505,7 @@ }, "git_tree_free": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 63, "lineto": 63, "args": [ @@ -23997,28 +23526,28 @@ "group": "tree", "examples": { "diff.c": [ - "ex/HEAD/diff.html#git_tree_free-17", - "ex/HEAD/diff.html#git_tree_free-18" + "ex/HEAD/diff.html#git_tree_free-13", + "ex/HEAD/diff.html#git_tree_free-14" ], "general.c": [ "ex/HEAD/general.html#git_tree_free-92", "ex/HEAD/general.html#git_tree_free-93" ], "init.c": [ - "ex/HEAD/init.html#git_tree_free-15" + "ex/HEAD/init.html#git_tree_free-13" ], "log.c": [ - "ex/HEAD/log.html#git_tree_free-59", - "ex/HEAD/log.html#git_tree_free-60", - "ex/HEAD/log.html#git_tree_free-61", - "ex/HEAD/log.html#git_tree_free-62", - "ex/HEAD/log.html#git_tree_free-63" + "ex/HEAD/log.html#git_tree_free-55", + "ex/HEAD/log.html#git_tree_free-56", + "ex/HEAD/log.html#git_tree_free-57", + "ex/HEAD/log.html#git_tree_free-58", + "ex/HEAD/log.html#git_tree_free-59" ] } }, "git_tree_id": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 71, "lineto": 71, "args": [ @@ -24040,7 +23569,7 @@ }, "git_tree_owner": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 79, "lineto": 79, "args": [ @@ -24062,7 +23591,7 @@ }, "git_tree_entrycount": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 87, "lineto": 87, "args": [ @@ -24083,7 +23612,7 @@ "group": "tree", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tree_entrycount-41" + "ex/HEAD/cat-file.html#git_tree_entrycount-37" ], "general.c": [ "ex/HEAD/general.html#git_tree_entrycount-94" @@ -24092,7 +23621,7 @@ }, "git_tree_entry_byname": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 99, "lineto": 100, "args": [ @@ -24124,7 +23653,7 @@ }, "git_tree_entry_byindex": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 112, "lineto": 113, "args": [ @@ -24150,7 +23679,7 @@ "group": "tree", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tree_entry_byindex-42" + "ex/HEAD/cat-file.html#git_tree_entry_byindex-38" ], "general.c": [ "ex/HEAD/general.html#git_tree_entry_byindex-96" @@ -24159,7 +23688,7 @@ }, "git_tree_entry_byid": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 127, "lineto": 128, "args": [ @@ -24186,7 +23715,7 @@ }, "git_tree_entry_bypath": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 142, "lineto": 145, "args": [ @@ -24218,7 +23747,7 @@ }, "git_tree_entry_dup": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 157, "lineto": 157, "args": [ @@ -24245,7 +23774,7 @@ }, "git_tree_entry_free": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 168, "lineto": 168, "args": [ @@ -24267,7 +23796,7 @@ }, "git_tree_entry_name": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 176, "lineto": 176, "args": [ @@ -24288,7 +23817,7 @@ "group": "tree", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tree_entry_name-43" + "ex/HEAD/cat-file.html#git_tree_entry_name-39" ], "general.c": [ "ex/HEAD/general.html#git_tree_entry_name-97", @@ -24298,7 +23827,7 @@ }, "git_tree_entry_id": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 184, "lineto": 184, "args": [ @@ -24319,13 +23848,13 @@ "group": "tree", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tree_entry_id-44" + "ex/HEAD/cat-file.html#git_tree_entry_id-40" ] } }, "git_tree_entry_type": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 192, "lineto": 192, "args": [ @@ -24338,7 +23867,7 @@ "argline": "const git_tree_entry *entry", "sig": "const git_tree_entry *", "return": { - "type": "git_otype", + "type": "git_object_t", "comment": " the type of the pointed object" }, "description": "

Get the type of the object pointed by the entry

\n", @@ -24346,13 +23875,13 @@ "group": "tree", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tree_entry_type-45" + "ex/HEAD/cat-file.html#git_tree_entry_type-41" ] } }, "git_tree_entry_filemode": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 200, "lineto": 200, "args": [ @@ -24373,13 +23902,13 @@ "group": "tree", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tree_entry_filemode-46" + "ex/HEAD/cat-file.html#git_tree_entry_filemode-42" ] } }, "git_tree_entry_filemode_raw": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 212, "lineto": 212, "args": [ @@ -24401,7 +23930,7 @@ }, "git_tree_entry_cmp": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 220, "lineto": 220, "args": [ @@ -24428,7 +23957,7 @@ }, "git_tree_entry_to_object": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 232, "lineto": 235, "args": [ @@ -24465,7 +23994,7 @@ }, "git_treebuilder_new": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 254, "lineto": 255, "args": [ @@ -24497,7 +24026,7 @@ }, "git_treebuilder_clear": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 262, "lineto": 262, "args": [ @@ -24519,7 +24048,7 @@ }, "git_treebuilder_entrycount": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 270, "lineto": 270, "args": [ @@ -24532,7 +24061,7 @@ "argline": "git_treebuilder *bld", "sig": "git_treebuilder *", "return": { - "type": "unsigned int", + "type": "size_t", "comment": " the number of entries in the treebuilder" }, "description": "

Get the number of entries listed in a treebuilder

\n", @@ -24541,7 +24070,7 @@ }, "git_treebuilder_free": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 281, "lineto": 281, "args": [ @@ -24563,7 +24092,7 @@ }, "git_treebuilder_get": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 293, "lineto": 294, "args": [ @@ -24590,7 +24119,7 @@ }, "git_treebuilder_insert": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 324, "lineto": 329, "args": [ @@ -24632,7 +24161,7 @@ }, "git_treebuilder_remove": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 337, "lineto": 338, "args": [ @@ -24659,7 +24188,7 @@ }, "git_treebuilder_filter": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 361, "lineto": 364, "args": [ @@ -24691,7 +24220,7 @@ }, "git_treebuilder_write": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 376, "lineto": 377, "args": [ @@ -24718,7 +24247,7 @@ }, "git_treebuilder_write_with_buffer": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 390, "lineto": 391, "args": [ @@ -24750,7 +24279,7 @@ }, "git_tree_walk": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 420, "lineto": 424, "args": [ @@ -24787,7 +24316,7 @@ }, "git_tree_dup": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 433, "lineto": 433, "args": [ @@ -24814,7 +24343,7 @@ }, "git_tree_create_updated": { "type": "function", - "file": "tree.h", + "file": "git2/tree.h", "line": 479, "lineto": 479, "args": [ @@ -24856,7 +24385,7 @@ }, "git_worktree_list": { "type": "function", - "file": "worktree.h", + "file": "git2/worktree.h", "line": 34, "lineto": 34, "args": [ @@ -24883,7 +24412,7 @@ }, "git_worktree_lookup": { "type": "function", - "file": "worktree.h", + "file": "git2/worktree.h", "line": 44, "lineto": 44, "args": [ @@ -24915,7 +24444,7 @@ }, "git_worktree_open_from_repository": { "type": "function", - "file": "worktree.h", + "file": "git2/worktree.h", "line": 56, "lineto": 56, "args": [ @@ -24942,7 +24471,7 @@ }, "git_worktree_free": { "type": "function", - "file": "worktree.h", + "file": "git2/worktree.h", "line": 63, "lineto": 63, "args": [ @@ -24964,7 +24493,7 @@ }, "git_worktree_validate": { "type": "function", - "file": "worktree.h", + "file": "git2/worktree.h", "line": 75, "lineto": 75, "args": [ @@ -24984,21 +24513,21 @@ "comments": "

A valid worktree requires both the git data structures inside the linked parent repository and the linked working copy to be present.

\n", "group": "worktree" }, - "git_worktree_add_init_options": { + "git_worktree_add_options_init": { "type": "function", - "file": "worktree.h", - "line": 95, - "lineto": 96, + "file": "git2/worktree.h", + "line": 104, + "lineto": 105, "args": [ { "name": "opts", "type": "git_worktree_add_options *", - "comment": "the struct to initialize" + "comment": "The `git_worktree_add_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Verison of struct; pass `GIT_WORKTREE_ADD_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_WORKTREE_ADD_OPTIONS_VERSION`." } ], "argline": "git_worktree_add_options *opts, unsigned int version", @@ -25007,15 +24536,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_worktree_add_options with default vaules.\n Equivalent to creating an instance with\n GIT_WORKTREE_ADD_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_worktree_add_options structure

\n", + "comments": "

Initializes a git_worktree_add_options with default values. Equivalent to creating an instance with GIT_WORKTREE_ADD_OPTIONS_INIT.

\n", "group": "worktree" }, "git_worktree_add": { "type": "function", - "file": "worktree.h", - "line": 112, - "lineto": 114, + "file": "git2/worktree.h", + "line": 121, + "lineto": 123, "args": [ { "name": "out", @@ -25055,9 +24584,9 @@ }, "git_worktree_lock": { "type": "function", - "file": "worktree.h", - "line": 126, - "lineto": 126, + "file": "git2/worktree.h", + "line": 135, + "lineto": 135, "args": [ { "name": "wt", @@ -25082,9 +24611,9 @@ }, "git_worktree_unlock": { "type": "function", - "file": "worktree.h", - "line": 135, - "lineto": 135, + "file": "git2/worktree.h", + "line": 144, + "lineto": 144, "args": [ { "name": "wt", @@ -25104,9 +24633,9 @@ }, "git_worktree_is_locked": { "type": "function", - "file": "worktree.h", - "line": 149, - "lineto": 149, + "file": "git2/worktree.h", + "line": 158, + "lineto": 158, "args": [ { "name": "reason", @@ -25129,21 +24658,65 @@ "comments": "

A worktree may be locked if the linked working tree is stored on a portable device which is not available.

\n", "group": "worktree" }, - "git_worktree_prune_init_options": { + "git_worktree_name": { "type": "function", - "file": "worktree.h", - "line": 182, - "lineto": 184, + "file": "git2/worktree.h", + "line": 167, + "lineto": 167, + "args": [ + { + "name": "wt", + "type": "const git_worktree *", + "comment": "Worktree to get the name for" + } + ], + "argline": "const git_worktree *wt", + "sig": "const git_worktree *", + "return": { + "type": "const char *", + "comment": " The worktree's name. The pointer returned is valid for the\n lifetime of the git_worktree" + }, + "description": "

Retrieve the name of the worktree

\n", + "comments": "", + "group": "worktree" + }, + "git_worktree_path": { + "type": "function", + "file": "git2/worktree.h", + "line": 176, + "lineto": 176, + "args": [ + { + "name": "wt", + "type": "const git_worktree *", + "comment": "Worktree to get the path for" + } + ], + "argline": "const git_worktree *wt", + "sig": "const git_worktree *", + "return": { + "type": "const char *", + "comment": " The worktree's filesystem path. The pointer returned\n is valid for the lifetime of the git_worktree." + }, + "description": "

Retrieve the filesystem path for the worktree

\n", + "comments": "", + "group": "worktree" + }, + "git_worktree_prune_options_init": { + "type": "function", + "file": "git2/worktree.h", + "line": 217, + "lineto": 219, "args": [ { "name": "opts", "type": "git_worktree_prune_options *", - "comment": "the struct to initialize" + "comment": "The `git_worktree_prune_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Verison of struct; pass `GIT_WORKTREE_PRUNE_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_WORKTREE_PRUNE_OPTIONS_VERSION`." } ], "argline": "git_worktree_prune_options *opts, unsigned int version", @@ -25152,15 +24725,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_worktree_prune_options with default vaules.\n Equivalent to creating an instance with\n GIT_WORKTREE_PRUNE_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_worktree_prune_options structure

\n", + "comments": "

Initializes a git_worktree_prune_options with default values. Equivalent to creating an instance with GIT_WORKTREE_PRUNE_OPTIONS_INIT.

\n", "group": "worktree" }, "git_worktree_is_prunable": { "type": "function", - "file": "worktree.h", - "line": 200, - "lineto": 201, + "file": "git2/worktree.h", + "line": 235, + "lineto": 236, "args": [ { "name": "wt", @@ -25185,9 +24758,9 @@ }, "git_worktree_prune": { "type": "function", - "file": "worktree.h", - "line": 215, - "lineto": 216, + "file": "git2/worktree.h", + "line": 250, + "lineto": 251, "args": [ { "name": "wt", @@ -25212,11 +24785,94 @@ } }, "callbacks": { + "git_apply_delta_cb": { + "type": "callback", + "file": "git2/apply.h", + "line": 36, + "lineto": 38, + "args": [ + { + "name": "delta", + "type": "const git_diff_delta *", + "comment": "The delta to be applied" + }, + { + "name": "payload", + "type": "void *", + "comment": "User-specified payload" + } + ], + "argline": "const git_diff_delta *delta, void *payload", + "sig": "const git_diff_delta *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

When applying a patch, callback that will be made per delta (file).

\n", + "comments": "

When the callback: - returns < 0, the apply process will be aborted. - returns > 0, the delta will not be applied, but the apply process continues - returns 0, the delta is applied, and the apply process continues.

\n" + }, + "git_apply_hunk_cb": { + "type": "callback", + "file": "git2/apply.h", + "line": 52, + "lineto": 54, + "args": [ + { + "name": "hunk", + "type": "const git_diff_hunk *", + "comment": "The hunk to be applied" + }, + { + "name": "payload", + "type": "void *", + "comment": "User-specified payload" + } + ], + "argline": "const git_diff_hunk *hunk, void *payload", + "sig": "const git_diff_hunk *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

When applying a patch, callback that will be made per hunk.

\n", + "comments": "

When the callback: - returns < 0, the apply process will be aborted. - returns > 0, the hunk will not be applied, but the apply process continues - returns 0, the hunk is applied, and the apply process continues.

\n" + }, + "git_attr_foreach_cb": { + "type": "callback", + "file": "git2/attr.h", + "line": 205, + "lineto": 205, + "args": [ + { + "name": "name", + "type": "const char *", + "comment": "The attribute name." + }, + { + "name": "value", + "type": "const char *", + "comment": "The attribute value. May be NULL if the attribute is explicitly\n set to UNSPECIFIED using the '!' sign." + }, + { + "name": "payload", + "type": "void *", + "comment": "A user-specified pointer." + } + ], + "argline": "const char *name, const char *value, void *payload", + "sig": "const char *::const char *::void *", + "return": { + "type": "int", + "comment": " 0 to continue looping, non-zero to stop. This value will be returned\n from git_attr_foreach." + }, + "description": "

The callback used with git_attr_foreach.

\n", + "comments": "

This callback will be invoked only once per attribute name, even if there are multiple rules for a given file. The highest priority rule will be used.

\n" + }, "git_checkout_notify_cb": { "type": "callback", - "file": "checkout.h", - "line": 223, - "lineto": 229, + "file": "git2/checkout.h", + "line": 236, + "lineto": 242, "args": [ { "name": "why", @@ -25260,9 +24916,9 @@ }, "git_checkout_progress_cb": { "type": "callback", - "file": "checkout.h", - "line": 232, - "lineto": 236, + "file": "git2/checkout.h", + "line": 245, + "lineto": 249, "args": [ { "name": "path", @@ -25296,9 +24952,9 @@ }, "git_checkout_perfdata_cb": { "type": "callback", - "file": "checkout.h", - "line": 239, - "lineto": 241, + "file": "git2/checkout.h", + "line": 252, + "lineto": 254, "args": [ { "name": "perfdata", @@ -25322,7 +24978,7 @@ }, "git_remote_create_cb": { "type": "callback", - "file": "clone.h", + "file": "git2/clone.h", "line": 69, "lineto": 74, "args": [ @@ -25363,7 +25019,7 @@ }, "git_repository_create_cb": { "type": "callback", - "file": "clone.h", + "file": "git2/clone.h", "line": 90, "lineto": 94, "args": [ @@ -25397,11 +25053,63 @@ "description": "

The signature of a function matchin git_repository_init, with an\n aditional void * as callback payload.

\n", "comments": "

Callers of git_clone my provide a function matching this signature to override the repository creation and customization process during a clone operation.

\n" }, + "git_config_foreach_cb": { + "type": "callback", + "file": "git2/config.h", + "line": 84, + "lineto": 84, + "args": [ + { + "name": "entry", + "type": "const git_config_entry *", + "comment": "the entry currently being enumerated" + }, + { + "name": "payload", + "type": "void *", + "comment": "a user-specified pointer" + } + ], + "argline": "const git_config_entry *entry, void *payload", + "sig": "const git_config_entry *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

A config enumeration callback

\n", + "comments": "" + }, + "git_headlist_cb": { + "type": "callback", + "file": "git2/deprecated.h", + "line": 423, + "lineto": 423, + "args": [ + { + "name": "rhead", + "type": "git_remote_head *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "git_remote_head *rhead, void *payload", + "sig": "git_remote_head *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Callback for listing the remote heads

\n", + "comments": "" + }, "git_diff_notify_cb": { "type": "callback", - "file": "diff.h", - "line": 359, - "lineto": 363, + "file": "git2/diff.h", + "line": 331, + "lineto": 335, "args": [ { "name": "diff_so_far", @@ -25431,13 +25139,13 @@ "comment": null }, "description": "

Diff notification callback function.

\n", - "comments": "

The callback will be called for each file, just before the git_delta_t gets inserted into the diff.

\n\n

When the callback: - returns < 0, the diff process will be aborted. - returns > 0, the delta will not be inserted into the diff, but the diff process continues. - returns 0, the delta is inserted into the diff, and the diff process continues.

\n" + "comments": "

The callback will be called for each file, just before the git_diff_delta gets inserted into the diff.

\n\n

When the callback: - returns < 0, the diff process will be aborted. - returns > 0, the delta will not be inserted into the diff, but the diff process continues. - returns 0, the delta is inserted into the diff, and the diff process continues.

\n" }, "git_diff_progress_cb": { "type": "callback", - "file": "diff.h", - "line": 375, - "lineto": 379, + "file": "git2/diff.h", + "line": 347, + "lineto": 351, "args": [ { "name": "diff_so_far", @@ -25471,9 +25179,9 @@ }, "git_diff_file_cb": { "type": "callback", - "file": "diff.h", - "line": 458, - "lineto": 461, + "file": "git2/diff.h", + "line": 465, + "lineto": 468, "args": [ { "name": "delta", @@ -25502,9 +25210,9 @@ }, "git_diff_binary_cb": { "type": "callback", - "file": "diff.h", - "line": 515, - "lineto": 518, + "file": "git2/diff.h", + "line": 531, + "lineto": 534, "args": [ { "name": "delta", @@ -25533,9 +25241,9 @@ }, "git_diff_hunk_cb": { "type": "callback", - "file": "diff.h", - "line": 535, - "lineto": 538, + "file": "git2/diff.h", + "line": 557, + "lineto": 560, "args": [ { "name": "delta", @@ -25564,9 +25272,9 @@ }, "git_diff_line_cb": { "type": "callback", - "file": "diff.h", - "line": 588, - "lineto": 592, + "file": "git2/diff.h", + "line": 618, + "lineto": 622, "args": [ { "name": "delta", @@ -25600,9 +25308,9 @@ }, "git_index_matched_path_cb": { "type": "callback", - "file": "index.h", - "line": 146, - "lineto": 147, + "file": "git2/index.h", + "line": 135, + "lineto": 136, "args": [ { "name": "path", @@ -25629,35 +25337,35 @@ "description": "

Callback for APIs that add/remove/update files matching pathspec

\n", "comments": "" }, - "git_headlist_cb": { + "git_indexer_progress_cb": { "type": "callback", - "file": "net.h", - "line": 55, - "lineto": 55, + "file": "git2/indexer.h", + "line": 57, + "lineto": 57, "args": [ { - "name": "rhead", - "type": "git_remote_head *", - "comment": null + "name": "stats", + "type": "const git_indexer_progress *", + "comment": "Structure containing information about the state of the tran sfer" }, { "name": "payload", "type": "void *", - "comment": null + "comment": "Payload provided by caller" } ], - "argline": "git_remote_head *rhead, void *payload", - "sig": "git_remote_head *::void *", + "argline": "const git_indexer_progress *stats, void *payload", + "sig": "const git_indexer_progress *::void *", "return": { "type": "int", "comment": null }, - "description": "

Callback for listing the remote heads

\n", + "description": "

Type for progress callbacks during indexing. Return a value less\n than zero to cancel the indexing or download.

\n", "comments": "" }, "git_note_foreach_cb": { "type": "callback", - "file": "notes.h", + "file": "git2/notes.h", "line": 29, "lineto": 30, "args": [ @@ -25688,9 +25396,9 @@ }, "git_odb_foreach_cb": { "type": "callback", - "file": "odb.h", - "line": 27, - "lineto": 27, + "file": "git2/odb.h", + "line": 28, + "lineto": 28, "args": [ { "name": "id", @@ -25712,11 +25420,42 @@ "description": "

Function type for callbacks from git_odb_foreach.

\n", "comments": "" }, + "git_packbuilder_foreach_cb": { + "type": "callback", + "file": "git2/pack.h", + "line": 192, + "lineto": 192, + "args": [ + { + "name": "buf", + "type": "void *", + "comment": "A pointer to the object's data" + }, + { + "name": "size", + "type": "size_t", + "comment": "The size of the underlying object" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_packbuilder_foreach" + } + ], + "argline": "void *buf, size_t size, void *payload", + "sig": "void *::size_t::void *", + "return": { + "type": "int", + "comment": " non-zero to terminate the iteration" + }, + "description": "

Callback used to iterate over packed objects

\n", + "comments": "" + }, "git_packbuilder_progress": { "type": "callback", - "file": "pack.h", - "line": 210, - "lineto": 214, + "file": "git2/pack.h", + "line": 221, + "lineto": 225, "args": [ { "name": "stage", @@ -25748,11 +25487,63 @@ "description": "

Packbuilder progress notification function

\n", "comments": "" }, - "git_push_transfer_progress": { + "git_reference_foreach_cb": { + "type": "callback", + "file": "git2/refs.h", + "line": 434, + "lineto": 434, + "args": [ + { + "name": "reference", + "type": "git_reference *", + "comment": "The reference object" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_reference_foreach" + } + ], + "argline": "git_reference *reference, void *payload", + "sig": "git_reference *::void *", + "return": { + "type": "int", + "comment": " non-zero to terminate the iteration" + }, + "description": "

Callback used to iterate over references

\n", + "comments": "" + }, + "git_reference_foreach_name_cb": { "type": "callback", - "file": "remote.h", - "line": 351, - "lineto": 355, + "file": "git2/refs.h", + "line": 445, + "lineto": 445, + "args": [ + { + "name": "name", + "type": "const char *", + "comment": "The reference name" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_reference_foreach_name" + } + ], + "argline": "const char *name, void *payload", + "sig": "const char *::void *", + "return": { + "type": "int", + "comment": " non-zero to terminate the iteration" + }, + "description": "

Callback used to iterate over reference names

\n", + "comments": "" + }, + "git_push_transfer_progress_cb": { + "type": "callback", + "file": "git2/remote.h", + "line": 425, + "lineto": 429, "args": [ { "name": "current", @@ -25786,9 +25577,9 @@ }, "git_push_negotiation": { "type": "callback", - "file": "remote.h", - "line": 386, - "lineto": 386, + "file": "git2/remote.h", + "line": 461, + "lineto": 461, "args": [ { "name": "updates", @@ -25817,9 +25608,9 @@ }, "git_push_update_reference_cb": { "type": "callback", - "file": "remote.h", - "line": 400, - "lineto": 400, + "file": "git2/remote.h", + "line": 475, + "lineto": 475, "args": [ { "name": "refname", @@ -25846,9 +25637,112 @@ "description": "

Callback used to inform of the update status from the remote.

\n", "comments": "

Called for each updated reference on push. If status is not NULL, the update was rejected by the remote server and status contains the reason given.

\n" }, + "git_url_resolve_cb": { + "type": "callback", + "file": "git2/remote.h", + "line": 489, + "lineto": 489, + "args": [ + { + "name": "url_resolved", + "type": "git_buf *", + "comment": "The buffer to write the resolved URL to" + }, + { + "name": "url", + "type": "const char *", + "comment": "The URL to resolve" + }, + { + "name": "direction", + "type": "int", + "comment": "GIT_DIRECTION_FETCH or GIT_DIRECTION_PUSH" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by the caller" + } + ], + "argline": "git_buf *url_resolved, const char *url, int direction, void *payload", + "sig": "git_buf *::const char *::int::void *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_PASSTHROUGH or an error" + }, + "description": "

Callback to resolve URLs before connecting to remote

\n", + "comments": "

If you return GIT_PASSTHROUGH, you don't need to write anything to url_resolved.

\n" + }, + "git_repository_fetchhead_foreach_cb": { + "type": "callback", + "file": "git2/repository.h", + "line": 656, + "lineto": 660, + "args": [ + { + "name": "ref_name", + "type": "const char *", + "comment": "The reference name" + }, + { + "name": "remote_url", + "type": "const char *", + "comment": "The remote URL" + }, + { + "name": "oid", + "type": "const git_oid *", + "comment": "The reference target OID" + }, + { + "name": "is_merge", + "type": "unsigned int", + "comment": "Was the reference the result of a merge" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_repository_fetchhead_foreach" + } + ], + "argline": "const char *ref_name, const char *remote_url, const git_oid *oid, unsigned int is_merge, void *payload", + "sig": "const char *::const char *::const git_oid *::unsigned int::void *", + "return": { + "type": "int", + "comment": " non-zero to terminate the iteration" + }, + "description": "

Callback used to iterate over each FETCH_HEAD entry

\n", + "comments": "" + }, + "git_repository_mergehead_foreach_cb": { + "type": "callback", + "file": "git2/repository.h", + "line": 687, + "lineto": 688, + "args": [ + { + "name": "oid", + "type": "const git_oid *", + "comment": "The merge OID" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_repository_mergehead_foreach" + } + ], + "argline": "const git_oid *oid, void *payload", + "sig": "const git_oid *::void *", + "return": { + "type": "int", + "comment": " non-zero to terminate the iteration" + }, + "description": "

Callback used to iterate over each MERGE_HEAD entry

\n", + "comments": "" + }, "git_revwalk_hide_cb": { "type": "callback", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 277, "lineto": 279, "args": [ @@ -25874,9 +25768,9 @@ }, "git_stash_apply_progress_cb": { "type": "callback", - "file": "stash.h", - "line": 113, - "lineto": 115, + "file": "git2/stash.h", + "line": 115, + "lineto": 117, "args": [ { "name": "progress", @@ -25900,9 +25794,9 @@ }, "git_stash_cb": { "type": "callback", - "file": "stash.h", - "line": 198, - "lineto": 202, + "file": "git2/stash.h", + "line": 201, + "lineto": 205, "args": [ { "name": "index", @@ -25916,7 +25810,7 @@ }, { "name": "stash_id", - "type": "const int *", + "type": "const git_oid *", "comment": "The commit oid of the stashed state." }, { @@ -25925,8 +25819,8 @@ "comment": "Extra parameter to callback function." } ], - "argline": "size_t index, const char *message, const int *stash_id, void *payload", - "sig": "size_t::const char *::const int *::void *", + "argline": "size_t index, const char *message, const git_oid *stash_id, void *payload", + "sig": "size_t::const char *::const git_oid *::void *", "return": { "type": "int", "comment": " 0 to continue iterating or non-zero to stop." @@ -25936,9 +25830,9 @@ }, "git_status_cb": { "type": "callback", - "file": "status.h", - "line": 61, - "lineto": 62, + "file": "git2/status.h", + "line": 63, + "lineto": 64, "args": [ { "name": "path", @@ -25967,7 +25861,7 @@ }, "git_submodule_cb": { "type": "callback", - "file": "submodule.h", + "file": "git2/submodule.h", "line": 118, "lineto": 119, "args": [ @@ -25996,242 +25890,40 @@ "description": "

Function pointer to receive each submodule

\n", "comments": "" }, - "git_filter_init_fn": { + "git_tag_foreach_cb": { "type": "callback", - "file": "sys/filter.h", - "line": 141, - "lineto": 141, - "args": [ - { - "name": "self", - "type": "git_filter *", - "comment": null - } - ], - "argline": "git_filter *self", - "sig": "git_filter *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Initialize callback on filter

\n", - "comments": "

Specified as filter.initialize, this is an optional callback invoked before a filter is first used. It will be called once at most.

\n\n

If non-NULL, the filter's initialize callback will be invoked right before the first use of the filter, so you can defer expensive initialization operations (in case libgit2 is being used in a way that doesn't need the filter).

\n" - }, - "git_filter_shutdown_fn": { - "type": "callback", - "file": "sys/filter.h", - "line": 153, - "lineto": 153, - "args": [ - { - "name": "self", - "type": "git_filter *", - "comment": null - } - ], - "argline": "git_filter *self", - "sig": "git_filter *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Shutdown callback on filter

\n", - "comments": "

Specified as filter.shutdown, this is an optional callback invoked when the filter is unregistered or when libgit2 is shutting down. It will be called once at most and should release resources as needed. This may be called even if the initialize callback was not made.

\n\n

Typically this function will free the git_filter object itself.

\n" - }, - "git_filter_check_fn": { - "type": "callback", - "file": "sys/filter.h", - "line": 175, - "lineto": 179, - "args": [ - { - "name": "self", - "type": "git_filter *", - "comment": null - }, - { - "name": "payload", - "type": "void **", - "comment": null - }, - { - "name": "src", - "type": "const git_filter_source *", - "comment": null - }, - { - "name": "attr_values", - "type": "const char **", - "comment": null - } - ], - "argline": "git_filter *self, void **payload, const git_filter_source *src, const char **attr_values", - "sig": "git_filter *::void **::const git_filter_source *::const char **", - "return": { - "type": "int", - "comment": null - }, - "description": "

Callback to decide if a given source needs this filter

\n", - "comments": "

Specified as filter.check, this is an optional callback that checks if filtering is needed for a given source.

\n\n

It should return 0 if the filter should be applied (i.e. success), GIT_PASSTHROUGH if the filter should not be applied, or an error code to fail out of the filter processing pipeline and return to the caller.

\n\n

The attr_values will be set to the values of any attributes given in the filter definition. See git_filter below for more detail.

\n\n

The payload will be a pointer to a reference payload for the filter. This will start as NULL, but check can assign to this pointer for later use by the apply callback. Note that the value should be heap allocated (not stack), so that it doesn't go away before the apply callback can use it. If a filter allocates and assigns a value to the payload, it will need a cleanup callback to free the payload.

\n" - }, - "git_filter_apply_fn": { - "type": "callback", - "file": "sys/filter.h", - "line": 193, - "lineto": 198, + "file": "git2/tag.h", + "line": 330, + "lineto": 330, "args": [ { - "name": "self", - "type": "git_filter *", - "comment": null - }, - { - "name": "payload", - "type": "void **", - "comment": null - }, - { - "name": "to", - "type": "git_buf *", - "comment": null - }, - { - "name": "from", - "type": "const git_buf *", - "comment": null + "name": "name", + "type": "const char *", + "comment": "The tag name" }, { - "name": "src", - "type": "const git_filter_source *", - "comment": null - } - ], - "argline": "git_filter *self, void **payload, git_buf *to, const git_buf *from, const git_filter_source *src", - "sig": "git_filter *::void **::git_buf *::const git_buf *::const git_filter_source *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Callback to actually perform the data filtering

\n", - "comments": "

Specified as filter.apply, this is the callback that actually filters data. If it successfully writes the output, it should return 0. Like check, it can return GIT_PASSTHROUGH to indicate that the filter doesn't want to run. Other error codes will stop filter processing and return to the caller.

\n\n

The payload value will refer to any payload that was set by the check callback. It may be read from or written to as needed.

\n" - }, - "git_filter_cleanup_fn": { - "type": "callback", - "file": "sys/filter.h", - "line": 215, - "lineto": 217, - "args": [ - { - "name": "self", - "type": "git_filter *", - "comment": null + "name": "oid", + "type": "git_oid *", + "comment": "The tag's OID" }, { "name": "payload", "type": "void *", - "comment": null - } - ], - "argline": "git_filter *self, void *payload", - "sig": "git_filter *::void *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Callback to clean up after filtering has been applied

\n", - "comments": "

Specified as filter.cleanup, this is an optional callback invoked after the filter has been applied. If the check or apply callbacks allocated a payload to keep per-source filter state, use this callback to free that payload and release resources as required.

\n" - }, - "git_merge_driver_init_fn": { - "type": "callback", - "file": "sys/merge.h", - "line": 71, - "lineto": 71, - "args": [ - { - "name": "self", - "type": "int *", - "comment": null + "comment": "Payload passed to git_tag_foreach" } ], - "argline": "int *self", - "sig": "int *", + "argline": "const char *name, git_oid *oid, void *payload", + "sig": "const char *::git_oid *::void *", "return": { "type": "int", - "comment": null - }, - "description": "

Initialize callback on merge driver

\n", - "comments": "

Specified as driver.initialize, this is an optional callback invoked before a merge driver is first used. It will be called once at most per library lifetime.

\n\n

If non-NULL, the merge driver's initialize callback will be invoked right before the first use of the driver, so you can defer expensive initialization operations (in case libgit2 is being used in a way that doesn't need the merge driver).

\n" - }, - "git_merge_driver_shutdown_fn": { - "type": "callback", - "file": "sys/merge.h", - "line": 83, - "lineto": 83, - "args": [ - { - "name": "self", - "type": "int *", - "comment": null - } - ], - "argline": "int *self", - "sig": "int *", - "return": { - "type": "void", - "comment": null + "comment": " non-zero to terminate the iteration" }, - "description": "

Shutdown callback on merge driver

\n", - "comments": "

Specified as driver.shutdown, this is an optional callback invoked when the merge driver is unregistered or when libgit2 is shutting down. It will be called once at most and should release resources as needed. This may be called even if the initialize callback was not made.

\n\n

Typically this function will free the git_merge_driver object itself.

\n" - }, - "git_merge_driver_apply_fn": { - "type": "callback", - "file": "sys/merge.h", - "line": 103, - "lineto": 109, - "args": [ - { - "name": "self", - "type": "int *", - "comment": null - }, - { - "name": "path_out", - "type": "const char **", - "comment": null - }, - { - "name": "mode_out", - "type": "int *", - "comment": null - }, - { - "name": "merged_out", - "type": "int *", - "comment": null - }, - { - "name": "filter_name", - "type": "const char *", - "comment": null - }, - { - "name": "src", - "type": "const git_merge_driver_source *", - "comment": null - } - ], - "argline": "int *self, const char **path_out, int *mode_out, int *merged_out, const char *filter_name, const git_merge_driver_source *src", - "sig": "int *::const char **::int *::int *::const char *::const git_merge_driver_source *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Callback to perform the merge.

\n", - "comments": "

Specified as driver.apply, this is the callback that actually does the merge. If it can successfully perform a merge, it should populate path_out with a pointer to the filename to accept, mode_out with the resultant mode, and merged_out with the buffer of the merged file and then return 0. If the driver returns GIT_PASSTHROUGH, then the default merge driver should instead be run. It can also return GIT_EMERGECONFLICT if the driver is not able to produce a merge result, and the file will remain conflicted. Any other errors will fail and return to the caller.

\n\n

The filter_name contains the name of the filter that was invoked, as specified by the file's attributes.

\n\n

The src contains the data about the file to be merged.

\n" + "description": "

Callback used to iterate over tag names

\n", + "comments": "" }, - "git_trace_callback": { + "git_trace_cb": { "type": "callback", - "file": "trace.h", + "file": "git2/trace.h", "line": 52, "lineto": 52, "args": [ @@ -26257,7 +25949,7 @@ }, "git_transport_cb": { "type": "callback", - "file": "transport.h", + "file": "git2/transport.h", "line": 24, "lineto": 24, "args": [ @@ -26288,9 +25980,9 @@ }, "git_cred_acquire_cb": { "type": "callback", - "file": "transport.h", - "line": 333, - "lineto": 338, + "file": "git2/transport.h", + "line": 376, + "lineto": 381, "args": [ { "name": "cred", @@ -26329,7 +26021,7 @@ }, "git_treebuilder_filter_cb": { "type": "callback", - "file": "tree.h", + "file": "git2/tree.h", "line": 347, "lineto": 348, "args": [ @@ -26355,7 +26047,7 @@ }, "git_treewalk_cb": { "type": "callback", - "file": "tree.h", + "file": "git2/tree.h", "line": 394, "lineto": 395, "args": [ @@ -26384,37 +26076,11 @@ "description": "

Callback for the tree traversal method

\n", "comments": "" }, - "git_transfer_progress_cb": { - "type": "callback", - "file": "types.h", - "line": 274, - "lineto": 274, - "args": [ - { - "name": "stats", - "type": "const git_transfer_progress *", - "comment": "Structure containing information about the state of the transfer" - }, - { - "name": "payload", - "type": "void *", - "comment": "Payload provided by caller" - } - ], - "argline": "const git_transfer_progress *stats, void *payload", - "sig": "const git_transfer_progress *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Type for progress callbacks during indexing. Return a value less than zero\n to cancel the transfer.

\n", - "comments": "" - }, "git_transport_message_cb": { "type": "callback", - "file": "types.h", - "line": 284, - "lineto": 284, + "file": "git2/types.h", + "line": 255, + "lineto": 255, "args": [ { "name": "str", @@ -26443,9 +26109,9 @@ }, "git_transport_certificate_check_cb": { "type": "callback", - "file": "types.h", - "line": 334, - "lineto": 334, + "file": "git2/types.h", + "line": 308, + "lineto": 308, "args": [ { "name": "cert", @@ -26472,7 +26138,7 @@ "sig": "git_cert *::int::const char *::void *", "return": { "type": "int", - "comment": null + "comment": " 0 to proceed with the connection, \n<\n 0 to fail the connection\n or > 0 to indicate that the callback refused to act and that\n the existing validity determination should be honored" }, "description": "

Callback for the user's custom certificate checks.

\n", "comments": "" @@ -26486,9 +26152,9 @@ "decl": "git_annotated_commit", "type": "struct", "value": "git_annotated_commit", - "file": "types.h", - "line": 182, - "lineto": 182, + "file": "git2/types.h", + "line": 186, + "lineto": 186, "tdef": "typedef", "description": " Annotated commits, the input to merge and rebase. ", "comments": "", @@ -26501,9 +26167,11 @@ "git_annotated_commit_from_revspec", "git_annotated_commit_id", "git_annotated_commit_lookup", + "git_annotated_commit_ref", "git_branch_create_from_annotated", "git_merge", "git_merge_analysis", + "git_merge_analysis_for_ref", "git_rebase_init", "git_repository_set_head_detached_from_annotated", "git_reset_from_annotated" @@ -26512,44 +26180,137 @@ } ], [ - "git_attr_t", + "git_apply_location_t", + { + "decl": [ + "GIT_APPLY_LOCATION_WORKDIR", + "GIT_APPLY_LOCATION_INDEX", + "GIT_APPLY_LOCATION_BOTH" + ], + "type": "enum", + "file": "git2/apply.h", + "line": 100, + "lineto": 118, + "block": "GIT_APPLY_LOCATION_WORKDIR\nGIT_APPLY_LOCATION_INDEX\nGIT_APPLY_LOCATION_BOTH", + "tdef": "typedef", + "description": " Possible application locations for git_apply ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_APPLY_LOCATION_WORKDIR", + "comments": "

Apply the patch to the workdir, leaving the index untouched.\n This is the equivalent of git apply with no location argument.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_APPLY_LOCATION_INDEX", + "comments": "

Apply the patch to the index, leaving the working directory\n untouched. This is the equivalent of git apply --cached.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_APPLY_LOCATION_BOTH", + "comments": "

Apply the patch to both the working directory and the index.\n This is the equivalent of git apply --index.

\n", + "value": 2 + } + ], + "used": { + "returns": [], + "needs": [ + "git_apply" + ] + } + } + ], + [ + "git_apply_options", { "decl": [ - "GIT_ATTR_UNSPECIFIED_T", - "GIT_ATTR_TRUE_T", - "GIT_ATTR_FALSE_T", - "GIT_ATTR_VALUE_T" + "unsigned int version", + "git_apply_delta_cb delta_cb", + "git_apply_hunk_cb hunk_cb", + "void * payload" + ], + "type": "struct", + "value": "git_apply_options", + "file": "git2/apply.h", + "line": 64, + "lineto": 75, + "block": "unsigned int version\ngit_apply_delta_cb delta_cb\ngit_apply_hunk_cb hunk_cb\nvoid * payload", + "tdef": "typedef", + "description": " Apply options structure", + "comments": "

Initialize with GIT_APPLY_OPTIONS_INIT. Alternatively, you can use git_apply_options_init.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " The version " + }, + { + "type": "git_apply_delta_cb", + "name": "delta_cb", + "comments": " When applying a patch, callback that will be made per delta (file). " + }, + { + "type": "git_apply_hunk_cb", + "name": "hunk_cb", + "comments": " When applying a patch, callback that will be made per hunk. " + }, + { + "type": "void *", + "name": "payload", + "comments": " Payload passed to both delta_cb \n&\n hunk_cb. " + } + ], + "used": { + "returns": [], + "needs": [ + "git_apply", + "git_apply_to_tree" + ] + } + } + ], + [ + "git_attr_value_t", + { + "decl": [ + "GIT_ATTR_VALUE_UNSPECIFIED", + "GIT_ATTR_VALUE_TRUE", + "GIT_ATTR_VALUE_FALSE", + "GIT_ATTR_VALUE_STRING" ], "type": "enum", - "file": "attr.h", + "file": "git2/attr.h", "line": 82, "lineto": 87, - "block": "GIT_ATTR_UNSPECIFIED_T\nGIT_ATTR_TRUE_T\nGIT_ATTR_FALSE_T\nGIT_ATTR_VALUE_T", + "block": "GIT_ATTR_VALUE_UNSPECIFIED\nGIT_ATTR_VALUE_TRUE\nGIT_ATTR_VALUE_FALSE\nGIT_ATTR_VALUE_STRING", "tdef": "typedef", "description": " Possible states for an attribute", "comments": "", "fields": [ { "type": "int", - "name": "GIT_ATTR_UNSPECIFIED_T", + "name": "GIT_ATTR_VALUE_UNSPECIFIED", "comments": "

The attribute has been left unspecified

\n", "value": 0 }, { "type": "int", - "name": "GIT_ATTR_TRUE_T", + "name": "GIT_ATTR_VALUE_TRUE", "comments": "

The attribute has been set

\n", "value": 1 }, { "type": "int", - "name": "GIT_ATTR_FALSE_T", + "name": "GIT_ATTR_VALUE_FALSE", "comments": "

The attribute has been unset

\n", "value": 2 }, { "type": "int", - "name": "GIT_ATTR_VALUE_T", + "name": "GIT_ATTR_VALUE_STRING", "comments": "

This attribute has a value

\n", "value": 3 } @@ -26562,6 +26323,36 @@ } } ], + [ + "git_blame", + { + "decl": "git_blame", + "type": "struct", + "value": "git_blame", + "file": "git2/blame.h", + "line": 149, + "lineto": 149, + "tdef": "typedef", + "description": " Opaque structure to hold blame results ", + "comments": "", + "used": { + "returns": [ + "git_blame_get_hunk_byindex", + "git_blame_get_hunk_byline" + ], + "needs": [ + "git_blame_buffer", + "git_blame_file", + "git_blame_free", + "git_blame_get_hunk_byindex", + "git_blame_get_hunk_byline", + "git_blame_get_hunk_count", + "git_blame_init_options", + "git_blame_options_init" + ] + } + } + ], [ "git_blame_flag_t", { @@ -26571,13 +26362,14 @@ "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES", "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES", "GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES", - "GIT_BLAME_FIRST_PARENT" + "GIT_BLAME_FIRST_PARENT", + "GIT_BLAME_USE_MAILMAP" ], "type": "enum", - "file": "blame.h", + "file": "git2/blame.h", "line": 26, - "lineto": 46, - "block": "GIT_BLAME_NORMAL\nGIT_BLAME_TRACK_COPIES_SAME_FILE\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES\nGIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES\nGIT_BLAME_FIRST_PARENT", + "lineto": 50, + "block": "GIT_BLAME_NORMAL\nGIT_BLAME_TRACK_COPIES_SAME_FILE\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES\nGIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES\nGIT_BLAME_FIRST_PARENT\nGIT_BLAME_USE_MAILMAP", "tdef": "typedef", "description": " Flags for indicating option behavior for git_blame APIs.", "comments": "", @@ -26617,6 +26409,12 @@ "name": "GIT_BLAME_FIRST_PARENT", "comments": "

Restrict the search of commits to those reachable following only the\n first parents.

\n", "value": 16 + }, + { + "type": "int", + "name": "GIT_BLAME_USE_MAILMAP", + "comments": "

Use mailmap file to map author and committer names and email addresses\n to canonical real names and email addresses. The mailmap will be read\n from the working directory, or HEAD in a bare repository.

\n", + "value": 32 } ], "used": { @@ -26641,13 +26439,13 @@ ], "type": "struct", "value": "git_blame_hunk", - "file": "blame.h", - "line": 115, - "lineto": 128, + "file": "git2/blame.h", + "line": 132, + "lineto": 145, "block": "size_t lines_in_hunk\ngit_oid final_commit_id\nsize_t final_start_line_number\ngit_signature * final_signature\ngit_oid orig_commit_id\nconst char * orig_path\nsize_t orig_start_line_number\ngit_signature * orig_signature\nchar boundary", "tdef": "typedef", "description": " Structure that represents a blame hunk.", - "comments": "\n", + "comments": "\n", "fields": [ { "type": "size_t", @@ -26718,13 +26516,13 @@ ], "type": "struct", "value": "git_blame_options", - "file": "blame.h", - "line": 70, - "lineto": 79, + "file": "git2/blame.h", + "line": 59, + "lineto": 88, "block": "unsigned int version\nuint32_t flags\nuint16_t min_match_characters\ngit_oid newest_commit\ngit_oid oldest_commit\nsize_t min_line\nsize_t max_line", "tdef": "typedef", "description": " Blame options structure", - "comments": "

Use zeros to indicate default settings. It's easiest to use the GIT_BLAME_OPTIONS_INIT macro: git_blame_options opts = GIT_BLAME_OPTIONS_INIT;

\n\n\n", + "comments": "

Initialize with GIT_BLAME_OPTIONS_INIT. Alternatively, you can use git_blame_options_init.

\n", "fields": [ { "type": "unsigned int", @@ -26734,39 +26532,40 @@ { "type": "uint32_t", "name": "flags", - "comments": "" + "comments": " A combination of `git_blame_flag_t` " }, { "type": "uint16_t", "name": "min_match_characters", - "comments": "" + "comments": " The lower bound on the number of alphanumeric\n characters that must be detected as moving/copying within a file for it to\n associate those lines with the parent commit. The default value is 20.\n This value only takes effect if any of the `GIT_BLAME_TRACK_COPIES_*`\n flags are specified." }, { "type": "git_oid", "name": "newest_commit", - "comments": "" + "comments": " The id of the newest commit to consider. The default is HEAD. " }, { "type": "git_oid", "name": "oldest_commit", - "comments": "" + "comments": " The id of the oldest commit to consider.\n The default is the first commit encountered with a NULL parent." }, { "type": "size_t", "name": "min_line", - "comments": "" + "comments": " The first line in the file to blame.\n The default is 1 (line numbers start with 1)." }, { "type": "size_t", "name": "max_line", - "comments": "" + "comments": " The last line in the file to blame.\n The default is the last line of the file." } ], "used": { "returns": [], "needs": [ "git_blame_file", - "git_blame_init_options" + "git_blame_init_options", + "git_blame_options_init" ] } } @@ -26777,9 +26576,9 @@ "decl": "git_blob", "type": "struct", "value": "git_blob", - "file": "types.h", - "line": 120, - "lineto": 120, + "file": "git2/types.h", + "line": 121, + "lineto": 121, "tdef": "typedef", "description": " In-memory representation of a blob object. ", "comments": "", @@ -26813,7 +26612,7 @@ "decl": "git_branch_iterator", "type": "struct", "value": "git_branch_iterator", - "file": "branch.h", + "file": "git2/branch.h", "line": 88, "lineto": 88, "tdef": "typedef", @@ -26838,9 +26637,9 @@ "GIT_BRANCH_ALL" ], "type": "enum", - "file": "types.h", - "line": 202, - "lineto": 206, + "file": "git2/types.h", + "line": 203, + "lineto": 207, "block": "GIT_BRANCH_LOCAL\nGIT_BRANCH_REMOTE\nGIT_BRANCH_ALL", "tdef": "typedef", "description": " Basic type of any Git branch. ", @@ -26885,35 +26684,39 @@ ], "type": "struct", "value": "git_buf", - "file": "buffer.h", - "line": 52, - "lineto": 55, + "file": "git2/buffer.h", + "line": 39, + "lineto": 61, "block": "char * ptr\nsize_t asize\nsize_t size", "tdef": "typedef", "description": " A data buffer for exporting data from libgit2", - "comments": "

Sometimes libgit2 wants to return an allocated data buffer to the caller and have the caller take responsibility for freeing that memory. This can be awkward if the caller does not have easy access to the same allocation functions that libgit2 is using. In those cases, libgit2 will fill in a git_buf and the caller can use git_buf_free() to release it when they are done.

\n\n

A git_buf may also be used for the caller to pass in a reference to a block of memory they hold. In this case, libgit2 will not resize or free the memory, but will read from it as needed.

\n\n

A git_buf is a public structure with three fields:

\n\n\n\n

Some APIs may occasionally do something slightly unusual with a buffer, such as setting ptr to a value that was passed in by the user. In those cases, the behavior will be clearly documented by the API.

\n", + "comments": "

Sometimes libgit2 wants to return an allocated data buffer to the caller and have the caller take responsibility for freeing that memory. This can be awkward if the caller does not have easy access to the same allocation functions that libgit2 is using. In those cases, libgit2 will fill in a git_buf and the caller can use git_buf_dispose() to release it when they are done.

\n\n

A git_buf may also be used for the caller to pass in a reference to a block of memory they hold. In this case, libgit2 will not resize or free the memory, but will read from it as needed.

\n\n

Some APIs may occasionally do something slightly unusual with a buffer, such as setting ptr to a value that was passed in by the user. In those cases, the behavior will be clearly documented by the API.

\n", "fields": [ { "type": "char *", "name": "ptr", - "comments": "" + "comments": " The buffer contents.\n\n `ptr` points to the start of the allocated memory. If it is NULL,\n then the `git_buf` is considered empty and libgit2 will feel free\n to overwrite it with new data." }, { "type": "size_t", "name": "asize", - "comments": "" + "comments": " `asize` holds the known total amount of allocated memory if the `ptr`\n was allocated by libgit2. It may be larger than `size`. If `ptr`\n was not allocated by libgit2 and should not be resized and/or freed,\n then `asize` will be set to zero." }, { "type": "size_t", "name": "size", - "comments": "" + "comments": " `size` holds the size (in bytes) of the data that is actually used." } ], "used": { "returns": [], "needs": [ "git_blob_filtered_content", + "git_branch_remote_name", + "git_branch_upstream_name", + "git_branch_upstream_remote", "git_buf_contains_nul", + "git_buf_dispose", "git_buf_free", "git_buf_grow", "git_buf_is_binary", @@ -26933,14 +26736,14 @@ "git_diff_format_email", "git_diff_stats_to_buf", "git_diff_to_buf", - "git_filter_apply_fn", "git_filter_list_apply_to_blob", "git_filter_list_apply_to_data", "git_filter_list_apply_to_file", "git_filter_list_stream_data", - "git_mempack_dump", "git_message_prettify", + "git_note_default_ref", "git_object_short_id", + "git_packbuilder_write_buf", "git_patch_to_buf", "git_refspec_rtransform", "git_refspec_transform", @@ -26950,6 +26753,7 @@ "git_repository_message", "git_submodule_resolve_url", "git_treebuilder_write_with_buffer", + "git_url_resolve_cb", "git_worktree_is_locked" ] } @@ -26963,9 +26767,9 @@ ], "type": "struct", "value": "git_cert", - "file": "types.h", - "line": 318, - "lineto": 323, + "file": "git2/types.h", + "line": 289, + "lineto": 294, "block": "git_cert_t cert_type", "tdef": "typedef", "description": " Parent type for `git_cert_hostkey` and `git_cert_x509`.", @@ -26980,8 +26784,7 @@ "used": { "returns": [], "needs": [ - "git_transport_certificate_check_cb", - "git_transport_smart_certificate_check" + "git_transport_certificate_check_cb" ] } } @@ -26997,7 +26800,7 @@ ], "type": "struct", "value": "git_cert_hostkey", - "file": "transport.h", + "file": "git2/transport.h", "line": 39, "lineto": 59, "block": "git_cert parent\ngit_cert_ssh_t type\nunsigned char [16] hash_md5\nunsigned char [20] hash_sha1", @@ -27008,7 +26811,7 @@ { "type": "git_cert", "name": "parent", - "comments": "" + "comments": " The parent cert " }, { "type": "git_cert_ssh_t", @@ -27040,7 +26843,7 @@ "GIT_CERT_SSH_SHA1" ], "type": "enum", - "file": "transport.h", + "file": "git2/transport.h", "line": 29, "lineto": 34, "block": "GIT_CERT_SSH_MD5\nGIT_CERT_SSH_SHA1", @@ -27077,9 +26880,9 @@ "GIT_CERT_STRARRAY" ], "type": "enum", - "file": "types.h", - "line": 290, - "lineto": 313, + "file": "git2/types.h", + "line": 261, + "lineto": 284, "block": "GIT_CERT_NONE\nGIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2\nGIT_CERT_STRARRAY\nGIT_CERT_NONE\nGIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2\nGIT_CERT_STRARRAY", "tdef": "typedef", "description": " Type of host certificate structure that is passed to the check callback", @@ -27126,9 +26929,9 @@ ], "type": "struct", "value": "git_cert_x509", - "file": "transport.h", + "file": "git2/transport.h", "line": 64, - "lineto": 74, + "lineto": 76, "block": "git_cert parent\nvoid * data\nsize_t len", "tdef": "typedef", "description": " X.509 certificate information", @@ -27137,7 +26940,7 @@ { "type": "git_cert", "name": "parent", - "comments": "" + "comments": " The parent cert " }, { "type": "void *", @@ -27169,9 +26972,9 @@ "GIT_CHECKOUT_NOTIFY_ALL" ], "type": "enum", - "file": "checkout.h", - "line": 205, - "lineto": 214, + "file": "git2/checkout.h", + "line": 217, + "lineto": 226, "block": "GIT_CHECKOUT_NOTIFY_NONE\nGIT_CHECKOUT_NOTIFY_CONFLICT\nGIT_CHECKOUT_NOTIFY_DIRTY\nGIT_CHECKOUT_NOTIFY_UPDATED\nGIT_CHECKOUT_NOTIFY_UNTRACKED\nGIT_CHECKOUT_NOTIFY_IGNORED\nGIT_CHECKOUT_NOTIFY_ALL", "tdef": "typedef", "description": " Checkout notification flags", @@ -27255,23 +27058,23 @@ ], "type": "struct", "value": "git_checkout_options", - "file": "checkout.h", - "line": 251, - "lineto": 295, + "file": "git2/checkout.h", + "line": 263, + "lineto": 326, "block": "unsigned int version\nunsigned int checkout_strategy\nint disable_filters\nunsigned int dir_mode\nunsigned int file_mode\nint file_open_flags\nunsigned int notify_flags\ngit_checkout_notify_cb notify_cb\nvoid * notify_payload\ngit_checkout_progress_cb progress_cb\nvoid * progress_payload\ngit_strarray paths\ngit_tree * baseline\ngit_index * baseline_index\nconst char * target_directory\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_checkout_perfdata_cb perfdata_cb\nvoid * perfdata_payload", "tdef": "typedef", "description": " Checkout options structure", - "comments": "

Zero out for defaults. Initialize with GIT_CHECKOUT_OPTIONS_INIT macro to correctly set the version field. E.g.

\n\n
    git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;\n
\n", + "comments": "

Initialize with GIT_CHECKOUT_OPTIONS_INIT. Alternatively, you can use git_checkout_options_init.

\n", "fields": [ { "type": "unsigned int", "name": "version", - "comments": "" + "comments": " The version " }, { "type": "unsigned int", "name": "checkout_strategy", - "comments": " default will be a dry run " + "comments": " default will be a safe checkout " }, { "type": "int", @@ -27301,12 +27104,12 @@ { "type": "git_checkout_notify_cb", "name": "notify_cb", - "comments": "" + "comments": " Optional callback to get notifications on specific file states.\n " }, { "type": "void *", "name": "notify_payload", - "comments": "" + "comments": " Payload passed to notify_cb " }, { "type": "git_checkout_progress_cb", @@ -27316,22 +27119,22 @@ { "type": "void *", "name": "progress_payload", - "comments": "" + "comments": " Payload passed to progress_cb " }, { "type": "git_strarray", "name": "paths", - "comments": " When not zeroed out, array of fnmatch patterns specifying which\n paths should be taken into account, otherwise all files. Use\n GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH to treat as simple list." + "comments": " A list of wildmatch patterns or paths.\n\n By default, all paths are processed. If you pass an array of wildmatch\n patterns, those will be used to filter which paths should be taken into\n account.\n\n Use GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH to treat as a simple list." }, { "type": "git_tree *", "name": "baseline", - "comments": " The expected content of the working directory; defaults to HEAD.\n If the working directory does not match this baseline information,\n that will produce a checkout conflict." + "comments": " The expected content of the working directory; defaults to HEAD.\n\n If the working directory does not match this baseline information,\n that will produce a checkout conflict." }, { "type": "git_index *", "name": "baseline_index", - "comments": " expected content of workdir, expressed as an index. " + "comments": " Like `baseline` above, though expressed as an index. This\n option overrides `baseline`." }, { "type": "const char *", @@ -27361,7 +27164,7 @@ { "type": "void *", "name": "perfdata_payload", - "comments": "" + "comments": " Payload passed to perfdata_cb " } ], "used": { @@ -27369,7 +27172,7 @@ "needs": [ "git_checkout_head", "git_checkout_index", - "git_checkout_init_options", + "git_checkout_options_init", "git_checkout_tree", "git_merge", "git_reset", @@ -27378,6 +27181,48 @@ } } ], + [ + "git_checkout_perfdata", + { + "decl": [ + "size_t mkdir_calls", + "size_t stat_calls", + "size_t chmod_calls" + ], + "type": "struct", + "value": "git_checkout_perfdata", + "file": "git2/checkout.h", + "line": 229, + "lineto": 233, + "block": "size_t mkdir_calls\nsize_t stat_calls\nsize_t chmod_calls", + "tdef": "typedef", + "description": " Checkout performance-reporting structure ", + "comments": "", + "fields": [ + { + "type": "size_t", + "name": "mkdir_calls", + "comments": "" + }, + { + "type": "size_t", + "name": "stat_calls", + "comments": "" + }, + { + "type": "size_t", + "name": "chmod_calls", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_checkout_perfdata_cb" + ] + } + } + ], [ "git_checkout_strategy_t", { @@ -27406,13 +27251,13 @@ "GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED" ], "type": "enum", - "file": "checkout.h", + "file": "git2/checkout.h", "line": 106, - "lineto": 177, + "lineto": 189, "block": "GIT_CHECKOUT_NONE\nGIT_CHECKOUT_SAFE\nGIT_CHECKOUT_FORCE\nGIT_CHECKOUT_RECREATE_MISSING\nGIT_CHECKOUT_ALLOW_CONFLICTS\nGIT_CHECKOUT_REMOVE_UNTRACKED\nGIT_CHECKOUT_REMOVE_IGNORED\nGIT_CHECKOUT_UPDATE_ONLY\nGIT_CHECKOUT_DONT_UPDATE_INDEX\nGIT_CHECKOUT_NO_REFRESH\nGIT_CHECKOUT_SKIP_UNMERGED\nGIT_CHECKOUT_USE_OURS\nGIT_CHECKOUT_USE_THEIRS\nGIT_CHECKOUT_DISABLE_PATHSPEC_MATCH\nGIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES\nGIT_CHECKOUT_DONT_OVERWRITE_IGNORED\nGIT_CHECKOUT_CONFLICT_STYLE_MERGE\nGIT_CHECKOUT_CONFLICT_STYLE_DIFF3\nGIT_CHECKOUT_DONT_REMOVE_EXISTING\nGIT_CHECKOUT_DONT_WRITE_INDEX\nGIT_CHECKOUT_UPDATE_SUBMODULES\nGIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED", "tdef": "typedef", "description": " Checkout behavior flags", - "comments": "

In libgit2, checkout is used to update the working directory and index to match a target tree. Unlike git checkout, it does not move the HEAD commit for you - use git_repository_set_head or the like to do that.

\n\n

Checkout looks at (up to) four things: the "target" tree you want to check out, the "baseline" tree of what was checked out previously, the working directory for actual files, and the index for staged changes.

\n\n

You give checkout one of three strategies for update:

\n\n\n\n

To emulate git checkout, use GIT_CHECKOUT_SAFE with a checkout notification callback (see below) that displays information about dirty files. The default behavior will cancel checkout on conflicts.

\n\n

To emulate git checkout-index, use GIT_CHECKOUT_SAFE with a notification callback that cancels the operation if a dirty-but-existing file is found in the working directory. This core git command isn't quite "force" but is sensitive about some types of changes.

\n\n

To emulate git checkout -f, use GIT_CHECKOUT_FORCE.

\n\n

There are some additional flags to modified the behavior of checkout:

\n\n\n", + "comments": "

In libgit2, checkout is used to update the working directory and index to match a target tree. Unlike git checkout, it does not move the HEAD commit for you - use git_repository_set_head or the like to do that.

\n\n

Checkout looks at (up to) four things: the "target" tree you want to check out, the "baseline" tree of what was checked out previously, the working directory for actual files, and the index for staged changes.

\n\n

You give checkout one of three strategies for update:

\n\n\n\n

To emulate git checkout, use GIT_CHECKOUT_SAFE with a checkout notification callback (see below) that displays information about dirty files. The default behavior will cancel checkout on conflicts.

\n\n

To emulate git checkout-index, use GIT_CHECKOUT_SAFE with a notification callback that cancels the operation if a dirty-but-existing file is found in the working directory. This core git command isn't quite "force" but is sensitive about some types of changes.

\n\n

To emulate git checkout -f, use GIT_CHECKOUT_FORCE.

\n\n

There are some additional flags to modify the behavior of checkout:

\n\n\n", "fields": [ { "type": "int", @@ -27423,13 +27268,13 @@ { "type": "int", "name": "GIT_CHECKOUT_SAFE", - "comments": "

Allow safe updates that cannot overwrite uncommitted data

\n", + "comments": "

Allow safe updates that cannot overwrite uncommitted data.\n If the uncommitted changes don't conflict with the checked out files,\n the checkout will still proceed, leaving the changes intact.

\n\n

Mutually exclusive with GIT_CHECKOUT_FORCE.\n GIT_CHECKOUT_FORCE takes precedence over GIT_CHECKOUT_SAFE.

\n", "value": 1 }, { "type": "int", "name": "GIT_CHECKOUT_FORCE", - "comments": "

Allow all updates to force working directory to look like index

\n", + "comments": "

Allow all updates to force working directory to look like index.

\n\n

Mutually exclusive with GIT_CHECKOUT_SAFE.\n GIT_CHECKOUT_FORCE takes precedence over GIT_CHECKOUT_SAFE.

\n", "value": 2 }, { @@ -27564,7 +27409,7 @@ ], "type": "struct", "value": "git_cherrypick_options", - "file": "cherrypick.h", + "file": "git2/cherrypick.h", "line": 26, "lineto": 34, "block": "unsigned int version\nunsigned int mainline\ngit_merge_options merge_opts\ngit_checkout_options checkout_opts", @@ -27597,7 +27442,7 @@ "returns": [], "needs": [ "git_cherrypick", - "git_cherrypick_init_options" + "git_cherrypick_options_init" ] } } @@ -27612,7 +27457,7 @@ "GIT_CLONE_LOCAL_NO_LINKS" ], "type": "enum", - "file": "clone.h", + "file": "git2/clone.h", "line": 33, "lineto": 53, "block": "GIT_CLONE_LOCAL_AUTO\nGIT_CLONE_LOCAL\nGIT_CLONE_NO_LOCAL\nGIT_CLONE_LOCAL_NO_LINKS", @@ -27668,13 +27513,13 @@ ], "type": "struct", "value": "git_clone_options", - "file": "clone.h", + "file": "git2/clone.h", "line": 103, "lineto": 164, "block": "unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nint bare\ngit_clone_local_t local\nconst char * checkout_branch\ngit_repository_create_cb repository_cb\nvoid * repository_cb_payload\ngit_remote_create_cb remote_cb\nvoid * remote_cb_payload", "tdef": "typedef", "description": " Clone options structure", - "comments": "

Use the GIT_CLONE_OPTIONS_INIT to get the default settings, like this:

\n\n
    git_clone_options opts = GIT_CLONE_OPTIONS_INIT;\n
\n", + "comments": "

Initialize with GIT_CLONE_OPTIONS_INIT. Alternatively, you can use git_clone_options_init.

\n", "fields": [ { "type": "unsigned int", @@ -27731,7 +27576,7 @@ "returns": [], "needs": [ "git_clone", - "git_clone_init_options" + "git_clone_options_init" ] } } @@ -27742,9 +27587,9 @@ "decl": "git_commit", "type": "struct", "value": "git_commit", - "file": "types.h", - "line": 123, - "lineto": 123, + "file": "git2/types.h", + "line": 124, + "lineto": 124, "tdef": "typedef", "description": " Parsed representation of a commit object. ", "comments": "", @@ -27756,11 +27601,12 @@ "git_cherrypick_commit", "git_commit_amend", "git_commit_author", + "git_commit_author_with_mailmap", "git_commit_body", "git_commit_committer", + "git_commit_committer_with_mailmap", "git_commit_create", "git_commit_create_buffer", - "git_commit_create_from_callback", "git_commit_dup", "git_commit_free", "git_commit_header_field", @@ -27799,22 +27645,22 @@ "decl": "git_config", "type": "struct", "value": "git_config", - "file": "types.h", - "line": 141, - "lineto": 141, + "file": "git2/types.h", + "line": 145, + "lineto": 145, "tdef": "typedef", "description": " Memory representation of a set of config files ", "comments": "", "used": { "returns": [], "needs": [ - "git_config_add_backend", "git_config_add_file_ondisk", "git_config_backend_foreach_match", "git_config_delete_entry", "git_config_delete_multivar", "git_config_entry_free", "git_config_foreach", + "git_config_foreach_cb", "git_config_foreach_match", "git_config_free", "git_config_get_bool", @@ -27826,11 +27672,11 @@ "git_config_get_path", "git_config_get_string", "git_config_get_string_buf", - "git_config_init_backend", "git_config_iterator_free", "git_config_iterator_glob_new", "git_config_iterator_new", "git_config_lock", + "git_config_lookup_map_value", "git_config_multivar_iterator_new", "git_config_new", "git_config_next", @@ -27845,8 +27691,7 @@ "git_config_set_string", "git_config_snapshot", "git_repository_config", - "git_repository_config_snapshot", - "git_repository_set_config" + "git_repository_config_snapshot" ] } } @@ -27857,91 +27702,16 @@ "decl": "git_config_backend", "type": "struct", "value": "git_config_backend", - "file": "types.h", - "line": 144, - "lineto": 144, - "block": "unsigned int version\nint readonly\nstruct git_config * cfg\nint (*)(struct git_config_backend *, git_config_level_t, const git_repository *) open\nint (*)(struct git_config_backend *, const char *, git_config_entry **) get\nint (*)(struct git_config_backend *, const char *, const char *) set\nint (*)(git_config_backend *, const char *, const char *, const char *) set_multivar\nint (*)(struct git_config_backend *, const char *) del\nint (*)(struct git_config_backend *, const char *, const char *) del_multivar\nint (*)(git_config_iterator **, struct git_config_backend *) iterator\nint (*)(struct git_config_backend **, struct git_config_backend *) snapshot\nint (*)(struct git_config_backend *) lock\nint (*)(struct git_config_backend *, int) unlock\nvoid (*)(struct git_config_backend *) free", + "file": "git2/types.h", + "line": 148, + "lineto": 148, "tdef": "typedef", "description": " Interface to access a configuration file ", "comments": "", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, - { - "type": "int", - "name": "readonly", - "comments": " True if this backend is for a snapshot " - }, - { - "type": "struct git_config *", - "name": "cfg", - "comments": "" - }, - { - "type": "int (*)(struct git_config_backend *, git_config_level_t, const git_repository *)", - "name": "open", - "comments": "" - }, - { - "type": "int (*)(struct git_config_backend *, const char *, git_config_entry **)", - "name": "get", - "comments": "" - }, - { - "type": "int (*)(struct git_config_backend *, const char *, const char *)", - "name": "set", - "comments": "" - }, - { - "type": "int (*)(git_config_backend *, const char *, const char *, const char *)", - "name": "set_multivar", - "comments": "" - }, - { - "type": "int (*)(struct git_config_backend *, const char *)", - "name": "del", - "comments": "" - }, - { - "type": "int (*)(struct git_config_backend *, const char *, const char *)", - "name": "del_multivar", - "comments": "" - }, - { - "type": "int (*)(git_config_iterator **, struct git_config_backend *)", - "name": "iterator", - "comments": "" - }, - { - "type": "int (*)(struct git_config_backend **, struct git_config_backend *)", - "name": "snapshot", - "comments": " Produce a read-only version of this backend " - }, - { - "type": "int (*)(struct git_config_backend *)", - "name": "lock", - "comments": " Lock this backend.\n\n Prevent any writes to the data store backing this\n backend. Any updates must not be visible to any other\n readers." - }, - { - "type": "int (*)(struct git_config_backend *, int)", - "name": "unlock", - "comments": " Unlock the data store backing this backend. If success is\n true, the changes should be committed, otherwise rolled\n back." - }, - { - "type": "void (*)(struct git_config_backend *)", - "name": "free", - "comments": "" - } - ], "used": { "returns": [], "needs": [ - "git_config_add_backend", - "git_config_backend_foreach_match", - "git_config_init_backend" + "git_config_backend_foreach_match" ] } } @@ -27952,16 +27722,17 @@ "decl": [ "const char * name", "const char * value", + "unsigned int include_depth", "git_config_level_t level", "void (*)(struct git_config_entry *) free", "void * payload" ], "type": "struct", "value": "git_config_entry", - "file": "config.h", + "file": "git2/config.h", "line": 64, - "lineto": 70, - "block": "const char * name\nconst char * value\ngit_config_level_t level\nvoid (*)(struct git_config_entry *) free\nvoid * payload", + "lineto": 71, + "block": "const char * name\nconst char * value\nunsigned int include_depth\ngit_config_level_t level\nvoid (*)(struct git_config_entry *) free\nvoid * payload", "tdef": "typedef", "description": " An entry in a configuration file", "comments": "", @@ -27976,6 +27747,11 @@ "name": "value", "comments": " String value of the entry " }, + { + "type": "unsigned int", + "name": "include_depth", + "comments": " Depth of includes where this variable was found " + }, { "type": "git_config_level_t", "name": "level", @@ -27984,7 +27760,7 @@ { "type": "void (*)(struct git_config_entry *)", "name": "free", - "comments": " Free function for this entry " + "comments": "" }, { "type": "void *", @@ -27996,6 +27772,7 @@ "returns": [], "needs": [ "git_config_entry_free", + "git_config_foreach_cb", "git_config_get_entry", "git_config_next" ] @@ -28005,43 +27782,15 @@ [ "git_config_iterator", { - "decl": [ - "git_config_backend * backend", - "unsigned int flags", - "int (*)(git_config_entry **, git_config_iterator *) next", - "void (*)(git_config_iterator *) free" - ], + "decl": "git_config_iterator", "type": "struct", "value": "git_config_iterator", - "file": "sys/config.h", - "line": 34, - "lineto": 48, - "block": "git_config_backend * backend\nunsigned int flags\nint (*)(git_config_entry **, git_config_iterator *) next\nvoid (*)(git_config_iterator *) free", - "tdef": null, - "description": " Every iterator must have this struct as its first element, so the\n API can talk to it. You'd define your iterator as", - "comments": "
 struct my_iterator {             git_config_iterator parent;             ...     }\n
\n\n

and assign iter->parent.backend to your git_config_backend.

\n", - "fields": [ - { - "type": "git_config_backend *", - "name": "backend", - "comments": "" - }, - { - "type": "unsigned int", - "name": "flags", - "comments": "" - }, - { - "type": "int (*)(git_config_entry **, git_config_iterator *)", - "name": "next", - "comments": " Return the current entry and advance the iterator. The\n memory belongs to the library." - }, - { - "type": "void (*)(git_config_iterator *)", - "name": "free", - "comments": " Free the iterator" - } - ], + "file": "git2/config.h", + "line": 89, + "lineto": 89, + "tdef": "typedef", + "description": " An opaque structure for a configuration iterator", + "comments": "", "used": { "returns": [], "needs": [ @@ -28067,7 +27816,7 @@ "GIT_CONFIG_HIGHEST_LEVEL" ], "type": "enum", - "file": "config.h", + "file": "git2/config.h", "line": 31, "lineto": 59, "block": "GIT_CONFIG_LEVEL_PROGRAMDATA\nGIT_CONFIG_LEVEL_SYSTEM\nGIT_CONFIG_LEVEL_XDG\nGIT_CONFIG_LEVEL_GLOBAL\nGIT_CONFIG_LEVEL_LOCAL\nGIT_CONFIG_LEVEL_APP\nGIT_CONFIG_HIGHEST_LEVEL", @@ -28121,22 +27870,160 @@ "used": { "returns": [], "needs": [ - "git_config_add_backend", "git_config_add_file_ondisk", "git_config_open_level" ] } } ], + [ + "git_configmap", + { + "decl": [ + "git_configmap_t type", + "const char * str_match", + "int map_value" + ], + "type": "struct", + "value": "git_configmap", + "file": "git2/config.h", + "line": 104, + "lineto": 108, + "tdef": "typedef", + "description": " Mapping from config variables to values.", + "comments": "", + "fields": [ + { + "type": "git_configmap_t", + "name": "type", + "comments": "" + }, + { + "type": "const char *", + "name": "str_match", + "comments": "" + }, + { + "type": "int", + "name": "map_value", + "comments": "" + } + ], + "block": "git_configmap_t type\nconst char * str_match\nint map_value", + "used": { + "returns": [], + "needs": [ + "git_config_get_mapped", + "git_config_lookup_map_value" + ] + } + } + ], + [ + "git_configmap_t", + { + "decl": [ + "GIT_CONFIGMAP_FALSE", + "GIT_CONFIGMAP_TRUE", + "GIT_CONFIGMAP_INT32", + "GIT_CONFIGMAP_STRING" + ], + "type": "enum", + "file": "git2/config.h", + "line": 94, + "lineto": 99, + "tdef": "typedef", + "description": " Config var type", + "comments": "", + "used": { + "returns": [], + "needs": [] + }, + "block": "GIT_CONFIGMAP_FALSE\nGIT_CONFIGMAP_TRUE\nGIT_CONFIGMAP_INT32\nGIT_CONFIGMAP_STRING", + "fields": [ + { + "type": "int", + "name": "GIT_CONFIGMAP_FALSE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_CONFIGMAP_TRUE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CONFIGMAP_INT32", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CONFIGMAP_STRING", + "comments": "", + "value": 3 + } + ] + } + ], + [ + "git_cred", + { + "decl": [ + "git_credtype_t credtype", + "void (*)(git_cred *) free" + ], + "type": "struct", + "value": "git_cred", + "file": "git2/transport.h", + "line": 147, + "lineto": 152, + "block": "git_credtype_t credtype\nvoid (*)(git_cred *) free", + "tdef": null, + "description": " The base structure for all credential types", + "comments": "", + "fields": [ + { + "type": "git_credtype_t", + "name": "credtype", + "comments": " A type of credential " + }, + { + "type": "void (*)(git_cred *)", + "name": "free", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_cred_acquire_cb", + "git_cred_default_new", + "git_cred_free", + "git_cred_has_username", + "git_cred_ssh_custom_new", + "git_cred_ssh_interactive_new", + "git_cred_ssh_key_from_agent", + "git_cred_ssh_key_memory_new", + "git_cred_ssh_key_new", + "git_cred_username_new", + "git_cred_userpass", + "git_cred_userpass_plaintext_new" + ] + } + } + ], [ "git_cred_default", { "decl": "git_cred_default", "type": "struct", "value": "git_cred_default", - "file": "transport.h", - "line": 176, - "lineto": 176, + "file": "git2/transport.h", + "line": 219, + "lineto": 219, "tdef": "typedef", "description": " A key for NTLM/Kerberos \"default\" credentials ", "comments": "", @@ -28154,15 +28041,15 @@ "char * username", "char * publickey", "size_t publickey_len", - "git_cred_sign_callback sign_callback", + "git_cred_sign_cb sign_callback", "void * payload" ], "type": "struct", "value": "git_cred_ssh_custom", - "file": "transport.h", - "line": 166, - "lineto": 173, - "block": "git_cred parent\nchar * username\nchar * publickey\nsize_t publickey_len\ngit_cred_sign_callback sign_callback\nvoid * payload", + "file": "git2/transport.h", + "line": 204, + "lineto": 216, + "block": "git_cred parent\nchar * username\nchar * publickey\nsize_t publickey_len\ngit_cred_sign_cb sign_callback\nvoid * payload", "tdef": "typedef", "description": " A key with a custom signature function", "comments": "", @@ -28170,32 +28057,32 @@ { "type": "git_cred", "name": "parent", - "comments": "" + "comments": " The parent cred " }, { "type": "char *", "name": "username", - "comments": "" + "comments": " The username to authenticate as " }, { "type": "char *", "name": "publickey", - "comments": "" + "comments": " The public key data " }, { "type": "size_t", "name": "publickey_len", - "comments": "" + "comments": " Length of the public key " }, { - "type": "git_cred_sign_callback", + "type": "git_cred_sign_cb", "name": "sign_callback", - "comments": "" + "comments": " Callback used to sign the data." }, { "type": "void *", "name": "payload", - "comments": "" + "comments": " Payload passed to prompt_callback " } ], "used": { @@ -28210,15 +28097,15 @@ "decl": [ "git_cred parent", "char * username", - "git_cred_ssh_interactive_callback prompt_callback", + "git_cred_ssh_interactive_cb prompt_callback", "void * payload" ], "type": "struct", "value": "git_cred_ssh_interactive", - "file": "transport.h", - "line": 156, - "lineto": 161, - "block": "git_cred parent\nchar * username\ngit_cred_ssh_interactive_callback prompt_callback\nvoid * payload", + "file": "git2/transport.h", + "line": 189, + "lineto": 199, + "block": "git_cred parent\nchar * username\ngit_cred_ssh_interactive_cb prompt_callback\nvoid * payload", "tdef": "typedef", "description": " Keyboard-interactive based ssh authentication", "comments": "", @@ -28226,22 +28113,22 @@ { "type": "git_cred", "name": "parent", - "comments": "" + "comments": " The parent cred " }, { "type": "char *", "name": "username", - "comments": "" + "comments": " The username to authenticate as " }, { - "type": "git_cred_ssh_interactive_callback", + "type": "git_cred_ssh_interactive_cb", "name": "prompt_callback", - "comments": "" + "comments": " Callback used for authentication." }, { "type": "void *", "name": "payload", - "comments": "" + "comments": " Payload passed to prompt_callback " } ], "used": { @@ -28264,9 +28151,9 @@ ], "type": "struct", "value": "git_cred_ssh_key", - "file": "transport.h", - "line": 145, - "lineto": 151, + "file": "git2/transport.h", + "line": 178, + "lineto": 184, "block": "git_cred parent\nchar * username\nchar * publickey\nchar * privatekey\nchar * passphrase", "tdef": "typedef", "description": " A ssh key from disk", @@ -28275,27 +28162,27 @@ { "type": "git_cred", "name": "parent", - "comments": "" + "comments": " The parent cred " }, { "type": "char *", "name": "username", - "comments": "" + "comments": " The username to authenticate as " }, { "type": "char *", "name": "publickey", - "comments": "" + "comments": " The path to a public key " }, { "type": "char *", "name": "privatekey", - "comments": "" + "comments": " The path to a private key " }, { "type": "char *", "name": "passphrase", - "comments": "" + "comments": " Passphrase used to decrypt the private key " } ], "used": { @@ -28313,9 +28200,9 @@ ], "type": "struct", "value": "git_cred_username", - "file": "transport.h", - "line": 179, - "lineto": 182, + "file": "git2/transport.h", + "line": 222, + "lineto": 225, "block": "git_cred parent\nchar [1] username", "tdef": "typedef", "description": " Username-only credential information ", @@ -28324,12 +28211,12 @@ { "type": "git_cred", "name": "parent", - "comments": "" + "comments": " The parent cred " }, { "type": "char [1]", "name": "username", - "comments": "" + "comments": " The username to authenticate as " } ], "used": { @@ -28346,8 +28233,7 @@ "const char * password" ], "type": "struct", - "value": "git_cred_userpass_payload", - "file": "cred_helpers.h", + "file": "git2/cred_helpers.h", "line": 24, "lineto": 27, "block": "const char * username\nconst char * password", @@ -28369,7 +28255,8 @@ "used": { "returns": [], "needs": [] - } + }, + "value": "git_cred_userpass_payload" } ], [ @@ -28382,9 +28269,9 @@ ], "type": "struct", "value": "git_cred_userpass_plaintext", - "file": "transport.h", - "line": 122, - "lineto": 126, + "file": "git2/transport.h", + "line": 155, + "lineto": 159, "block": "git_cred parent\nchar * username\nchar * password", "tdef": "typedef", "description": " A plaintext username and password ", @@ -28393,17 +28280,17 @@ { "type": "git_cred", "name": "parent", - "comments": "" + "comments": " The parent cred " }, { "type": "char *", "name": "username", - "comments": "" + "comments": " The username to authenticate as " }, { "type": "char *", "name": "password", - "comments": "" + "comments": " The password to use " } ], "used": { @@ -28425,54 +28312,54 @@ "GIT_CREDTYPE_SSH_MEMORY" ], "type": "enum", - "file": "transport.h", - "line": 81, - "lineto": 111, + "file": "git2/transport.h", + "line": 88, + "lineto": 140, "block": "GIT_CREDTYPE_USERPASS_PLAINTEXT\nGIT_CREDTYPE_SSH_KEY\nGIT_CREDTYPE_SSH_CUSTOM\nGIT_CREDTYPE_DEFAULT\nGIT_CREDTYPE_SSH_INTERACTIVE\nGIT_CREDTYPE_USERNAME\nGIT_CREDTYPE_SSH_MEMORY", "tdef": "typedef", - "description": " Authentication type requested ", - "comments": "", + "description": " Supported credential types", + "comments": "

This represents the various types of authentication methods supported by the library.

\n", "fields": [ { "type": "int", "name": "GIT_CREDTYPE_USERPASS_PLAINTEXT", - "comments": "", + "comments": "

A vanilla user/password request

\n", "value": 1 }, { "type": "int", "name": "GIT_CREDTYPE_SSH_KEY", - "comments": "", + "comments": "

An SSH key-based authentication request

\n", "value": 2 }, { "type": "int", "name": "GIT_CREDTYPE_SSH_CUSTOM", - "comments": "", + "comments": "

An SSH key-based authentication request, with a custom signature

\n", "value": 4 }, { "type": "int", "name": "GIT_CREDTYPE_DEFAULT", - "comments": "", + "comments": "

An NTLM/Negotiate-based authentication request.

\n", "value": 8 }, { "type": "int", "name": "GIT_CREDTYPE_SSH_INTERACTIVE", - "comments": "", + "comments": "

An SSH interactive authentication request

\n", "value": 16 }, { "type": "int", "name": "GIT_CREDTYPE_USERNAME", - "comments": "

Username-only information

\n\n

If the SSH transport does not know which username to use,\n it will ask via this credential type.

\n", + "comments": "

Username-only authentication request

\n\n

Used as a pre-authentication step if the underlying transport\n (eg. SSH, with no username in its URL) does not know which username\n to use.

\n", "value": 32 }, { "type": "int", "name": "GIT_CREDTYPE_SSH_MEMORY", - "comments": "

Credentials read from memory.

\n\n

Only available for libssh2+OpenSSL for now.

\n", + "comments": "

An SSH key-based authentication request

\n\n

Allows credentials to be read from memory instead of files.\n Note that because of differences in crypto backend support, it might\n not be functional.

\n", "value": 64 } ], @@ -28482,98 +28369,6 @@ } } ], - [ - "git_cvar_map", - { - "decl": [ - "git_cvar_t cvar_type", - "const char * str_match", - "int map_value" - ], - "type": "struct", - "value": "git_cvar_map", - "file": "config.h", - "line": 93, - "lineto": 97, - "block": "git_cvar_t cvar_type\nconst char * str_match\nint map_value", - "tdef": "typedef", - "description": " Mapping from config variables to values.", - "comments": "", - "fields": [ - { - "type": "git_cvar_t", - "name": "cvar_type", - "comments": "" - }, - { - "type": "const char *", - "name": "str_match", - "comments": "" - }, - { - "type": "int", - "name": "map_value", - "comments": "" - } - ], - "used": { - "returns": [], - "needs": [ - "git_config_get_mapped", - "git_config_lookup_map_value" - ] - } - } - ], - [ - "git_cvar_t", - { - "decl": [ - "GIT_CVAR_FALSE", - "GIT_CVAR_TRUE", - "GIT_CVAR_INT32", - "GIT_CVAR_STRING" - ], - "type": "enum", - "file": "config.h", - "line": 83, - "lineto": 88, - "block": "GIT_CVAR_FALSE\nGIT_CVAR_TRUE\nGIT_CVAR_INT32\nGIT_CVAR_STRING", - "tdef": "typedef", - "description": " Config var type", - "comments": "", - "fields": [ - { - "type": "int", - "name": "GIT_CVAR_FALSE", - "comments": "", - "value": 0 - }, - { - "type": "int", - "name": "GIT_CVAR_TRUE", - "comments": "", - "value": 1 - }, - { - "type": "int", - "name": "GIT_CVAR_INT32", - "comments": "", - "value": 2 - }, - { - "type": "int", - "name": "GIT_CVAR_STRING", - "comments": "", - "value": 3 - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], [ "git_delta_t", { @@ -28591,9 +28386,9 @@ "GIT_DELTA_CONFLICTED" ], "type": "enum", - "file": "diff.h", - "line": 252, - "lineto": 264, + "file": "git2/diff.h", + "line": 220, + "lineto": 232, "block": "GIT_DELTA_UNMODIFIED\nGIT_DELTA_ADDED\nGIT_DELTA_DELETED\nGIT_DELTA_MODIFIED\nGIT_DELTA_RENAMED\nGIT_DELTA_COPIED\nGIT_DELTA_IGNORED\nGIT_DELTA_UNTRACKED\nGIT_DELTA_TYPECHANGE\nGIT_DELTA_UNREADABLE\nGIT_DELTA_CONFLICTED", "tdef": "typedef", "description": " What type of change is described by a git_diff_delta?", @@ -28686,13 +28481,13 @@ ], "type": "struct", "value": "git_describe_format_options", - "file": "describe.h", - "line": 78, - "lineto": 98, + "file": "git2/describe.h", + "line": 91, + "lineto": 111, "block": "unsigned int version\nunsigned int abbreviated_size\nint always_use_long_format\nconst char * dirty_suffix", "tdef": "typedef", - "description": " Options for formatting the describe string", - "comments": "", + "description": " Describe format options structure", + "comments": "

Initialize with GIT_DESCRIBE_FORMAT_OPTIONS_INIT. Alternatively, you can use git_describe_format_options_init.

\n", "fields": [ { "type": "unsigned int", @@ -28718,7 +28513,8 @@ "used": { "returns": [], "needs": [ - "git_describe_format" + "git_describe_format", + "git_describe_format_options_init" ] } } @@ -28736,13 +28532,13 @@ ], "type": "struct", "value": "git_describe_options", - "file": "describe.h", - "line": 44, - "lineto": 62, + "file": "git2/describe.h", + "line": 43, + "lineto": 61, "block": "unsigned int version\nunsigned int max_candidates_tags\nunsigned int describe_strategy\nconst char * pattern\nint only_follow_first_parent\nint show_commit_oid_as_fallback", "tdef": "typedef", "description": " Describe options structure", - "comments": "

Initialize with GIT_DESCRIBE_OPTIONS_INIT macro to correctly set the version field. E.g.

\n\n
    git_describe_options opts = GIT_DESCRIBE_OPTIONS_INIT;\n
\n", + "comments": "

Initialize with GIT_DESCRIBE_OPTIONS_INIT. Alternatively, you can use git_describe_options_init.

\n", "fields": [ { "type": "unsigned int", @@ -28779,6 +28575,7 @@ "returns": [], "needs": [ "git_describe_commit", + "git_describe_options_init", "git_describe_workdir" ] } @@ -28790,9 +28587,9 @@ "decl": "git_describe_result", "type": "struct", "value": "git_describe_result", - "file": "describe.h", - "line": 111, - "lineto": 111, + "file": "git2/describe.h", + "line": 134, + "lineto": 134, "tdef": "typedef", "description": " A struct that stores the result of a describe operation.", "comments": "", @@ -28816,7 +28613,7 @@ "GIT_DESCRIBE_ALL" ], "type": "enum", - "file": "describe.h", + "file": "git2/describe.h", "line": 30, "lineto": 34, "block": "GIT_DESCRIBE_DEFAULT\nGIT_DESCRIBE_TAGS\nGIT_DESCRIBE_ALL", @@ -28855,12 +28652,12 @@ "decl": "git_diff", "type": "struct", "value": "git_diff", - "file": "diff.h", - "line": 225, - "lineto": 225, + "file": "git2/diff.h", + "line": 193, + "lineto": 193, "tdef": "typedef", "description": " The diff object that contains all individual file deltas.", - "comments": "

This is an opaque structure which will be allocated by one of the diff generator functions below (such as git_diff_tree_to_tree). You are responsible for releasing the object memory when done, using the git_diff_free() function.

\n", + "comments": "

A diff represents the cumulative list of differences between two snapshots of a repository (possibly filtered by a set of file name patterns).

\n\n

Calculating diffs is generally done in two phases: building a list of diffs then traversing it. This makes is easier to share logic across the various types of diffs (tree vs tree, workdir vs index, etc.), and also allows you to insert optional diff post-processing phases, such as rename detection, in between the steps. When you are done with a diff object, it must be freed.

\n\n

This is an opaque structure which will be allocated by one of the diff generator functions below (such as git_diff_tree_to_tree). You are responsible for releasing the object memory when done, using the git_diff_free() function.

\n", "used": { "returns": [ "git_diff_get_delta", @@ -28868,6 +28665,10 @@ "git_pathspec_match_list_diff_entry" ], "needs": [ + "git_apply", + "git_apply_delta_cb", + "git_apply_hunk_cb", + "git_apply_to_tree", "git_checkout_notify_cb", "git_diff_binary_cb", "git_diff_blob_to_buffer", @@ -28875,31 +28676,28 @@ "git_diff_buffers", "git_diff_commit_as_email", "git_diff_file_cb", - "git_diff_find_init_options", + "git_diff_find_options_init", "git_diff_find_similar", "git_diff_foreach", "git_diff_format_email", - "git_diff_format_email_init_options", + "git_diff_format_email_options_init", "git_diff_free", "git_diff_from_buffer", "git_diff_get_delta", - "git_diff_get_perfdata", "git_diff_get_stats", "git_diff_hunk_cb", "git_diff_index_to_index", "git_diff_index_to_workdir", - "git_diff_init_options", "git_diff_is_sorted_icase", "git_diff_line_cb", "git_diff_merge", "git_diff_notify_cb", "git_diff_num_deltas", "git_diff_num_deltas_of_type", + "git_diff_options_init", "git_diff_patchid", - "git_diff_patchid_init_options", + "git_diff_patchid_options_init", "git_diff_print", - "git_diff_print_callback__to_buf", - "git_diff_print_callback__to_file_handle", "git_diff_progress_cb", "git_diff_stats_deletions", "git_diff_stats_files_changed", @@ -28918,8 +28716,7 @@ "git_patch_get_hunk", "git_patch_get_line_in_hunk", "git_patch_print", - "git_pathspec_match_diff", - "git_status_list_get_perfdata" + "git_pathspec_match_diff" ] } } @@ -28934,18 +28731,18 @@ ], "type": "struct", "value": "git_diff_binary", - "file": "diff.h", - "line": 498, - "lineto": 509, + "file": "git2/diff.h", + "line": 513, + "lineto": 525, "block": "unsigned int contains_data\ngit_diff_binary_file old_file\ngit_diff_binary_file new_file", "tdef": "typedef", - "description": " Structure describing the binary contents of a diff. ", - "comments": "", + "description": " Structure describing the binary contents of a diff.", + "comments": "

A binary file / delta is a file (or pair) for which no text diffs should be generated. A diff can contain delta entries that are binary, but no diff content will be output for those files. There is a base heuristic for binary detection and you can further tune the behavior with git attributes or diff flags and option settings.

\n", "fields": [ { "type": "unsigned int", "name": "contains_data", - "comments": " Whether there is data in this binary structure or not. If this\n is `1`, then this was produced and included binary content. If\n this is `0` then this was generated knowing only that a binary\n file changed but without providing the data, probably from a patch\n that said `Binary files a/file.txt and b/file.txt differ`." + "comments": " Whether there is data in this binary structure or not.\n\n If this is `1`, then this was produced and included binary content.\n If this is `0` then this was generated knowing only that a binary\n file changed but without providing the data, probably from a patch\n that said `Binary files a/file.txt and b/file.txt differ`." }, { "type": "git_diff_binary_file", @@ -28981,9 +28778,9 @@ ], "type": "struct", "value": "git_diff_binary_file", - "file": "diff.h", - "line": 483, - "lineto": 495, + "file": "git2/diff.h", + "line": 490, + "lineto": 502, "block": "git_diff_binary_t type\nconst char * data\nsize_t datalen\nsize_t inflatedlen", "tdef": "typedef", "description": " The contents of one of the files in a binary diff. ", @@ -29025,9 +28822,9 @@ "GIT_DIFF_BINARY_DELTA" ], "type": "enum", - "file": "diff.h", - "line": 471, - "lineto": 480, + "file": "git2/diff.h", + "line": 478, + "lineto": 487, "block": "GIT_DIFF_BINARY_NONE\nGIT_DIFF_BINARY_LITERAL\nGIT_DIFF_BINARY_DELTA", "tdef": "typedef", "description": " When producing a binary diff, the binary data returned will be\n either the deflated full (\"literal\") contents of the file, or\n the deflated binary delta between the two sides (whichever is\n smaller).", @@ -29071,13 +28868,13 @@ ], "type": "struct", "value": "git_diff_delta", - "file": "diff.h", - "line": 337, - "lineto": 344, + "file": "git2/diff.h", + "line": 309, + "lineto": 316, "block": "git_delta_t status\nuint32_t flags\nuint16_t similarity\nuint16_t nfiles\ngit_diff_file old_file\ngit_diff_file new_file", "tdef": "typedef", "description": " Description of changes to one entry.", - "comments": "

When iterating over a diff, this will be passed to most callbacks and you can use the contents to understand exactly what has changed.

\n\n

The old_file represents the "from" side of the diff and the new_file represents to "to" side of the diff. What those means depend on the function that was used to generate the diff and will be documented below. You can also use the GIT_DIFF_REVERSE flag to flip it around.

\n\n

Although the two sides of the delta are named "old_file" and "new_file", they actually may correspond to entries that represent a file, a symbolic link, a submodule commit id, or even a tree (if you are tracking type changes or ignored/untracked directories).

\n\n

Under some circumstances, in the name of efficiency, not all fields will be filled in, but we generally try to fill in as much as possible. One example is that the "flags" field may not have either the BINARY or the NOT_BINARY flag set to avoid examining file contents if you do not pass in hunk and/or line callbacks to the diff foreach iteration function. It will just use the git attributes for those files.

\n\n

The similarity score is zero unless you call git_diff_find_similar() which does a similarity analysis of files in the diff. Use that function to do rename and copy detection, and to split heavily modified files in add/delete pairs. After that call, deltas with a status of GIT_DELTA_RENAMED or GIT_DELTA_COPIED will have a similarity score between 0 and 100 indicating how similar the old and new sides are.

\n\n

If you ask git_diff_find_similar to find heavily modified files to break, but to not actually break the records, then GIT_DELTA_MODIFIED records may have a non-zero similarity score if the self-similarity is below the split threshold. To display this value like core Git, invert the score (a la printf("M%03d", 100 - delta->similarity)).

\n", + "comments": "

A delta is a file pair with an old and new revision. The old version may be absent if the file was just created and the new version may be absent if the file was deleted. A diff is mostly just a list of deltas.

\n\n

When iterating over a diff, this will be passed to most callbacks and you can use the contents to understand exactly what has changed.

\n\n

The old_file represents the "from" side of the diff and the new_file represents to "to" side of the diff. What those means depend on the function that was used to generate the diff and will be documented below. You can also use the GIT_DIFF_REVERSE flag to flip it around.

\n\n

Although the two sides of the delta are named "old_file" and "new_file", they actually may correspond to entries that represent a file, a symbolic link, a submodule commit id, or even a tree (if you are tracking type changes or ignored/untracked directories).

\n\n

Under some circumstances, in the name of efficiency, not all fields will be filled in, but we generally try to fill in as much as possible. One example is that the "flags" field may not have either the BINARY or the NOT_BINARY flag set to avoid examining file contents if you do not pass in hunk and/or line callbacks to the diff foreach iteration function. It will just use the git attributes for those files.

\n\n

The similarity score is zero unless you call git_diff_find_similar() which does a similarity analysis of files in the diff. Use that function to do rename and copy detection, and to split heavily modified files in add/delete pairs. After that call, deltas with a status of GIT_DELTA_RENAMED or GIT_DELTA_COPIED will have a similarity score between 0 and 100 indicating how similar the old and new sides are.

\n\n

If you ask git_diff_find_similar to find heavily modified files to break, but to not actually break the records, then GIT_DELTA_MODIFIED records may have a non-zero similarity score if the self-similarity is below the split threshold. To display this value like core Git, invert the score (a la printf("M%03d", 100 - delta->similarity)).

\n", "fields": [ { "type": "git_delta_t", @@ -29117,13 +28914,12 @@ "git_pathspec_match_list_diff_entry" ], "needs": [ + "git_apply_delta_cb", "git_diff_binary_cb", "git_diff_file_cb", "git_diff_hunk_cb", "git_diff_line_cb", - "git_diff_notify_cb", - "git_diff_print_callback__to_buf", - "git_diff_print_callback__to_file_handle" + "git_diff_notify_cb" ] } } @@ -29141,9 +28937,9 @@ ], "type": "struct", "value": "git_diff_file", - "file": "diff.h", - "line": 292, - "lineto": 299, + "file": "git2/diff.h", + "line": 260, + "lineto": 267, "block": "git_oid id\nconst char * path\ngit_off_t size\nuint32_t flags\nuint16_t mode\nuint16_t id_abbrev", "tdef": "typedef", "description": " Description of one side of a delta.", @@ -29207,13 +29003,13 @@ ], "type": "struct", "value": "git_diff_find_options", - "file": "diff.h", - "line": 703, - "lineto": 729, + "file": "git2/diff.h", + "line": 718, + "lineto": 772, "block": "unsigned int version\nuint32_t flags\nuint16_t rename_threshold\nuint16_t rename_from_rewrite_threshold\nuint16_t copy_threshold\nuint16_t break_rewrite_threshold\nsize_t rename_limit\ngit_diff_similarity_metric * metric", "tdef": "typedef", "description": " Control behavior of rename and copy detection", - "comments": "

These options mostly mimic parameters that can be passed to git-diff.

\n\n\n\n

The metric option allows you to plug in a custom similarity metric. Set it to NULL for the default internal metric which is based on sampling hashes of ranges of data in the file. The default metric is a pretty good similarity approximation that should work fairly well for both text and binary data, and is pretty fast with fixed memory overhead.

\n", + "comments": "

These options mostly mimic parameters that can be passed to git-diff.

\n", "fields": [ { "type": "unsigned int", @@ -29228,38 +29024,38 @@ { "type": "uint16_t", "name": "rename_threshold", - "comments": " Similarity to consider a file renamed (default 50) " + "comments": " Threshold above which similar files will be considered renames.\n This is equivalent to the -M option. Defaults to 50." }, { "type": "uint16_t", "name": "rename_from_rewrite_threshold", - "comments": " Similarity of modified to be eligible rename source (default 50) " + "comments": " Threshold below which similar files will be eligible to be a rename source.\n This is equivalent to the first part of the -B option. Defaults to 50." }, { "type": "uint16_t", "name": "copy_threshold", - "comments": " Similarity to consider a file a copy (default 50) " + "comments": " Threshold above which similar files will be considered copies.\n This is equivalent to the -C option. Defaults to 50." }, { "type": "uint16_t", "name": "break_rewrite_threshold", - "comments": " Similarity to split modify into delete/add pair (default 60) " + "comments": " Treshold below which similar files will be split into a delete/add pair.\n This is equivalent to the last part of the -B option. Defaults to 60." }, { "type": "size_t", "name": "rename_limit", - "comments": " Maximum similarity sources to examine for a file (somewhat like\n git-diff's `-l` option or `diff.renameLimit` config) (default 200)" + "comments": " Maximum number of matches to consider for a particular file.\n\n This is a little different from the `-l` option from Git because we\n will still process up to this many matches before abandoning the search.\n Defaults to 200." }, { "type": "git_diff_similarity_metric *", "name": "metric", - "comments": " Pluggable similarity metric; pass NULL to use internal metric " + "comments": " The `metric` option allows you to plug in a custom similarity metric.\n\n Set it to NULL to use the default internal metric.\n\n The default metric is based on sampling hashes of ranges of data in\n the file, which is a pretty good similarity approximation that should\n work fairly well for both text and binary data while still being\n pretty fast with a fixed memory overhead." } ], "used": { "returns": [], "needs": [ - "git_diff_find_init_options", + "git_diff_find_options_init", "git_diff_find_similar" ] } @@ -29287,9 +29083,9 @@ "GIT_DIFF_FIND_REMOVE_UNMODIFIED" ], "type": "enum", - "file": "diff.h", - "line": 597, - "lineto": 666, + "file": "git2/diff.h", + "line": 627, + "lineto": 696, "block": "GIT_DIFF_FIND_BY_CONFIG\nGIT_DIFF_FIND_RENAMES\nGIT_DIFF_FIND_RENAMES_FROM_REWRITES\nGIT_DIFF_FIND_COPIES\nGIT_DIFF_FIND_COPIES_FROM_UNMODIFIED\nGIT_DIFF_FIND_REWRITES\nGIT_DIFF_BREAK_REWRITES\nGIT_DIFF_FIND_AND_BREAK_REWRITES\nGIT_DIFF_FIND_FOR_UNTRACKED\nGIT_DIFF_FIND_ALL\nGIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE\nGIT_DIFF_FIND_IGNORE_WHITESPACE\nGIT_DIFF_FIND_DONT_IGNORE_WHITESPACE\nGIT_DIFF_FIND_EXACT_MATCH_ONLY\nGIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY\nGIT_DIFF_FIND_REMOVE_UNMODIFIED", "tdef": "typedef", "description": " Flags to control the behavior of diff rename/copy detection.", @@ -29408,9 +29204,9 @@ "GIT_DIFF_FLAG_EXISTS" ], "type": "enum", - "file": "diff.h", - "line": 235, - "lineto": 240, + "file": "git2/diff.h", + "line": 203, + "lineto": 208, "block": "GIT_DIFF_FLAG_BINARY\nGIT_DIFF_FLAG_NOT_BINARY\nGIT_DIFF_FLAG_VALID_ID\nGIT_DIFF_FLAG_EXISTS", "tdef": "typedef", "description": " Flags for the delta object and the file objects on each side.", @@ -29455,9 +29251,9 @@ "GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER" ], "type": "enum", - "file": "diff.h", - "line": 1321, - "lineto": 1328, + "file": "git2/diff.h", + "line": 1366, + "lineto": 1373, "block": "GIT_DIFF_FORMAT_EMAIL_NONE\nGIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER", "tdef": "typedef", "description": " Formatting options for diff e-mail generation", @@ -29499,9 +29295,9 @@ ], "type": "struct", "value": "git_diff_format_email_options", - "file": "diff.h", - "line": 1333, - "lineto": 1355, + "file": "git2/diff.h", + "line": 1378, + "lineto": 1400, "block": "unsigned int version\ngit_diff_format_email_flags_t flags\nsize_t patch_no\nsize_t total_patches\nconst git_oid * id\nconst char * summary\nconst char * body\nconst git_signature * author", "tdef": "typedef", "description": " Options for controlling the formatting of the generated e-mail.", @@ -29552,7 +29348,7 @@ "returns": [], "needs": [ "git_diff_format_email", - "git_diff_format_email_init_options" + "git_diff_format_email_options_init" ] } } @@ -29568,9 +29364,9 @@ "GIT_DIFF_FORMAT_NAME_STATUS" ], "type": "enum", - "file": "diff.h", - "line": 1045, - "lineto": 1051, + "file": "git2/diff.h", + "line": 1090, + "lineto": 1096, "block": "GIT_DIFF_FORMAT_PATCH\nGIT_DIFF_FORMAT_PATCH_HEADER\nGIT_DIFF_FORMAT_RAW\nGIT_DIFF_FORMAT_NAME_ONLY\nGIT_DIFF_FORMAT_NAME_STATUS", "tdef": "typedef", "description": " Possible output formats for diff data", @@ -29629,13 +29425,13 @@ ], "type": "struct", "value": "git_diff_hunk", - "file": "diff.h", - "line": 523, - "lineto": 530, + "file": "git2/diff.h", + "line": 545, + "lineto": 552, "block": "int old_start\nint old_lines\nint new_start\nint new_lines\nsize_t header_len\nchar [128] header", "tdef": "typedef", "description": " Structure describing a hunk of a diff.", - "comments": "", + "comments": "

A hunk is a span of modified lines in a delta along with some stable surrounding context. You can configure the amount of context and other properties of how hunks are generated. Each hunk also comes with a header that described where it starts and ends in both the old and new versions in the delta.

\n", "fields": [ { "type": "int", @@ -29671,14 +29467,13 @@ "used": { "returns": [], "needs": [ + "git_apply_hunk_cb", "git_diff_blob_to_buffer", "git_diff_blobs", "git_diff_buffers", "git_diff_foreach", "git_diff_hunk_cb", "git_diff_line_cb", - "git_diff_print_callback__to_buf", - "git_diff_print_callback__to_file_handle", "git_patch_get_hunk" ] } @@ -29698,13 +29493,13 @@ ], "type": "struct", "value": "git_diff_line", - "file": "diff.h", - "line": 570, - "lineto": 578, + "file": "git2/diff.h", + "line": 600, + "lineto": 608, "block": "char origin\nint old_lineno\nint new_lineno\nint num_lines\nsize_t content_len\ngit_off_t content_offset\nconst char * content", "tdef": "typedef", "description": " Structure describing a line (or data span) of a diff.", - "comments": "", + "comments": "

A line is a range of characters inside a hunk. It could be a context line (i.e. in both old and new versions), an added line (i.e. only in the new version), or a removed line (i.e. only in the old version). Unfortunately, we don't know anything about the encoding of data in the file being diffed, so we cannot tell you much about the line content. Line data will not be NUL-byte terminated, however, because it will be just a span of bytes inside the larger file.

\n", "fields": [ { "type": "char", @@ -29751,8 +29546,6 @@ "git_diff_foreach", "git_diff_line_cb", "git_diff_print", - "git_diff_print_callback__to_buf", - "git_diff_print_callback__to_file_handle", "git_patch_get_line_in_hunk", "git_patch_print" ] @@ -29774,9 +29567,9 @@ "GIT_DIFF_LINE_BINARY" ], "type": "enum", - "file": "diff.h", - "line": 549, - "lineto": 565, + "file": "git2/diff.h", + "line": 571, + "lineto": 587, "block": "GIT_DIFF_LINE_CONTEXT\nGIT_DIFF_LINE_ADDITION\nGIT_DIFF_LINE_DELETION\nGIT_DIFF_LINE_CONTEXT_EOFNL\nGIT_DIFF_LINE_ADD_EOFNL\nGIT_DIFF_LINE_DEL_EOFNL\nGIT_DIFF_LINE_FILE_HDR\nGIT_DIFF_LINE_HUNK_HDR\nGIT_DIFF_LINE_BINARY", "tdef": "typedef", "description": " Line origin constants.", @@ -29866,6 +29659,7 @@ "GIT_DIFF_UPDATE_INDEX", "GIT_DIFF_INCLUDE_UNREADABLE", "GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED", + "GIT_DIFF_INDENT_HEURISTIC", "GIT_DIFF_FORCE_TEXT", "GIT_DIFF_FORCE_BINARY", "GIT_DIFF_IGNORE_WHITESPACE", @@ -29875,14 +29669,13 @@ "GIT_DIFF_SHOW_UNMODIFIED", "GIT_DIFF_PATIENCE", "GIT_DIFF_MINIMAL", - "GIT_DIFF_SHOW_BINARY", - "GIT_DIFF_INDENT_HEURISTIC" + "GIT_DIFF_SHOW_BINARY" ], "type": "enum", - "file": "diff.h", - "line": 72, - "lineto": 215, - "block": "GIT_DIFF_NORMAL\nGIT_DIFF_REVERSE\nGIT_DIFF_INCLUDE_IGNORED\nGIT_DIFF_RECURSE_IGNORED_DIRS\nGIT_DIFF_INCLUDE_UNTRACKED\nGIT_DIFF_RECURSE_UNTRACKED_DIRS\nGIT_DIFF_INCLUDE_UNMODIFIED\nGIT_DIFF_INCLUDE_TYPECHANGE\nGIT_DIFF_INCLUDE_TYPECHANGE_TREES\nGIT_DIFF_IGNORE_FILEMODE\nGIT_DIFF_IGNORE_SUBMODULES\nGIT_DIFF_IGNORE_CASE\nGIT_DIFF_INCLUDE_CASECHANGE\nGIT_DIFF_DISABLE_PATHSPEC_MATCH\nGIT_DIFF_SKIP_BINARY_CHECK\nGIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS\nGIT_DIFF_UPDATE_INDEX\nGIT_DIFF_INCLUDE_UNREADABLE\nGIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED\nGIT_DIFF_FORCE_TEXT\nGIT_DIFF_FORCE_BINARY\nGIT_DIFF_IGNORE_WHITESPACE\nGIT_DIFF_IGNORE_WHITESPACE_CHANGE\nGIT_DIFF_IGNORE_WHITESPACE_EOL\nGIT_DIFF_SHOW_UNTRACKED_CONTENT\nGIT_DIFF_SHOW_UNMODIFIED\nGIT_DIFF_PATIENCE\nGIT_DIFF_MINIMAL\nGIT_DIFF_SHOW_BINARY\nGIT_DIFF_INDENT_HEURISTIC", + "file": "git2/diff.h", + "line": 28, + "lineto": 171, + "block": "GIT_DIFF_NORMAL\nGIT_DIFF_REVERSE\nGIT_DIFF_INCLUDE_IGNORED\nGIT_DIFF_RECURSE_IGNORED_DIRS\nGIT_DIFF_INCLUDE_UNTRACKED\nGIT_DIFF_RECURSE_UNTRACKED_DIRS\nGIT_DIFF_INCLUDE_UNMODIFIED\nGIT_DIFF_INCLUDE_TYPECHANGE\nGIT_DIFF_INCLUDE_TYPECHANGE_TREES\nGIT_DIFF_IGNORE_FILEMODE\nGIT_DIFF_IGNORE_SUBMODULES\nGIT_DIFF_IGNORE_CASE\nGIT_DIFF_INCLUDE_CASECHANGE\nGIT_DIFF_DISABLE_PATHSPEC_MATCH\nGIT_DIFF_SKIP_BINARY_CHECK\nGIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS\nGIT_DIFF_UPDATE_INDEX\nGIT_DIFF_INCLUDE_UNREADABLE\nGIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED\nGIT_DIFF_INDENT_HEURISTIC\nGIT_DIFF_FORCE_TEXT\nGIT_DIFF_FORCE_BINARY\nGIT_DIFF_IGNORE_WHITESPACE\nGIT_DIFF_IGNORE_WHITESPACE_CHANGE\nGIT_DIFF_IGNORE_WHITESPACE_EOL\nGIT_DIFF_SHOW_UNTRACKED_CONTENT\nGIT_DIFF_SHOW_UNMODIFIED\nGIT_DIFF_PATIENCE\nGIT_DIFF_MINIMAL\nGIT_DIFF_SHOW_BINARY", "tdef": "typedef", "description": " Flags for diff options. A combination of these flags can be passed\n in via the `flags` value in the `git_diff_options`.", "comments": "", @@ -30001,6 +29794,12 @@ "comments": "

Include unreadable files in the diff

\n", "value": 131072 }, + { + "type": "int", + "name": "GIT_DIFF_INDENT_HEURISTIC", + "comments": "

Use a heuristic that takes indentation and whitespace into account\n which generally can produce better diffs when dealing with ambiguous\n diff hunks.

\n", + "value": 262144 + }, { "type": "int", "name": "GIT_DIFF_FORCE_TEXT", @@ -30060,12 +29859,6 @@ "name": "GIT_DIFF_SHOW_BINARY", "comments": "

Include the necessary deflate / delta information so that git-apply\n can apply given diff information to binary files.

\n", "value": 1073741824 - }, - { - "type": "unsigned int", - "name": "GIT_DIFF_INDENT_HEURISTIC", - "comments": "

Use a heuristic that takes indentation and whitespace into account\n which generally can produce better diffs when dealing with ambiguous\n diff hunks.

\n", - "value": -2147483648 } ], "used": { @@ -30094,13 +29887,13 @@ ], "type": "struct", "value": "git_diff_options", - "file": "diff.h", - "line": 408, - "lineto": 428, + "file": "git2/diff.h", + "line": 361, + "lineto": 433, "block": "unsigned int version\nuint32_t flags\ngit_submodule_ignore_t ignore_submodules\ngit_strarray pathspec\ngit_diff_notify_cb notify_cb\ngit_diff_progress_cb progress_cb\nvoid * payload\nuint32_t context_lines\nuint32_t interhunk_lines\nuint16_t id_abbrev\ngit_off_t max_size\nconst char * old_prefix\nconst char * new_prefix", "tdef": "typedef", "description": " Structure describing options about how the diff should be executed.", - "comments": "

Setting all values of the structure to zero will yield the default values. Similarly, passing NULL for the options structure will give the defaults. The default values are marked below.

\n\n\n", + "comments": "

Setting all values of the structure to zero will yield the default values. Similarly, passing NULL for the options structure will give the defaults. The default values are marked below.

\n", "fields": [ { "type": "unsigned int", @@ -30110,62 +29903,62 @@ { "type": "uint32_t", "name": "flags", - "comments": " defaults to GIT_DIFF_NORMAL " + "comments": " A combination of `git_diff_option_t` values above.\n Defaults to GIT_DIFF_NORMAL" }, { "type": "git_submodule_ignore_t", "name": "ignore_submodules", - "comments": " submodule ignore rule " + "comments": " Overrides the submodule ignore setting for all submodules in the diff. " }, { "type": "git_strarray", "name": "pathspec", - "comments": " defaults to include all paths " + "comments": " An array of paths / fnmatch patterns to constrain diff.\n All paths are included by default." }, { "type": "git_diff_notify_cb", "name": "notify_cb", - "comments": "" + "comments": " An optional callback function, notifying the consumer of changes to\n the diff as new deltas are added." }, { "type": "git_diff_progress_cb", "name": "progress_cb", - "comments": "" + "comments": " An optional callback function, notifying the consumer of which files\n are being examined as the diff is generated." }, { "type": "void *", "name": "payload", - "comments": "" + "comments": " The payload to pass to the callback functions. " }, { "type": "uint32_t", "name": "context_lines", - "comments": " defaults to 3 " + "comments": " The number of unchanged lines that define the boundary of a hunk\n (and to display before and after). Defaults to 3." }, { "type": "uint32_t", "name": "interhunk_lines", - "comments": " defaults to 0 " + "comments": " The maximum number of unchanged lines between hunk boundaries before\n the hunks will be merged into one. Defaults to 0." }, { "type": "uint16_t", "name": "id_abbrev", - "comments": " default 'core.abbrev' or 7 if unset " + "comments": " The abbreviation length to use when formatting object ids.\n Defaults to the value of 'core.abbrev' from the config, or 7 if unset." }, { "type": "git_off_t", "name": "max_size", - "comments": " defaults to 512MB " + "comments": " A size (in bytes) above which a blob will be marked as binary\n automatically; pass a negative value to disable.\n Defaults to 512MB." }, { "type": "const char *", "name": "old_prefix", - "comments": " defaults to \"a\" " + "comments": " The virtual \"directory\" prefix for old file names in hunk headers.\n Default is \"a\"." }, { "type": "const char *", "name": "new_prefix", - "comments": " defaults to \"b\" " + "comments": " The virtual \"directory\" prefix for new file names in hunk headers.\n Defaults to \"b\"." } ], "used": { @@ -30177,7 +29970,7 @@ "git_diff_commit_as_email", "git_diff_index_to_index", "git_diff_index_to_workdir", - "git_diff_init_options", + "git_diff_options_init", "git_diff_tree_to_index", "git_diff_tree_to_tree", "git_diff_tree_to_workdir", @@ -30197,13 +29990,13 @@ ], "type": "struct", "value": "git_diff_patchid_options", - "file": "diff.h", - "line": 1415, - "lineto": 1417, + "file": "git2/diff.h", + "line": 1462, + "lineto": 1464, "block": "unsigned int version", "tdef": "typedef", "description": " Patch ID options structure", - "comments": "

Initialize with GIT_DIFF_PATCHID_OPTIONS_INIT macro to correctly set the default values and version.

\n", + "comments": "

Initialize with GIT_PATCHID_OPTIONS_INIT. Alternatively, you can use git_diff_patchid_options_init.

\n", "fields": [ { "type": "unsigned int", @@ -30215,50 +30008,7 @@ "returns": [], "needs": [ "git_diff_patchid", - "git_diff_patchid_init_options" - ] - } - } - ], - [ - "git_diff_perfdata", - { - "decl": [ - "unsigned int version", - "size_t stat_calls", - "size_t oid_calculations" - ], - "type": "struct", - "value": "git_diff_perfdata", - "file": "sys/diff.h", - "line": 67, - "lineto": 71, - "block": "unsigned int version\nsize_t stat_calls\nsize_t oid_calculations", - "tdef": "typedef", - "description": " Performance data from diffing", - "comments": "", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, - { - "type": "size_t", - "name": "stat_calls", - "comments": " Number of stat() calls performed " - }, - { - "type": "size_t", - "name": "oid_calculations", - "comments": " Number of ID calculations " - } - ], - "used": { - "returns": [], - "needs": [ - "git_diff_get_perfdata", - "git_status_list_get_perfdata" + "git_diff_patchid_options_init" ] } } @@ -30275,9 +30025,9 @@ ], "type": "struct", "value": "git_diff_similarity_metric", - "file": "diff.h", - "line": 671, - "lineto": 681, + "file": "git2/diff.h", + "line": 701, + "lineto": 711, "block": "int (*)(void **, const git_diff_file *, const char *, void *) file_signature\nint (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature\nvoid (*)(void *, void *) free_signature\nint (*)(int *, void *, void *, void *) similarity\nvoid * payload", "tdef": "typedef", "description": " Pluggable similarity metric", @@ -30321,9 +30071,9 @@ "decl": "git_diff_stats", "type": "struct", "value": "git_diff_stats", - "file": "diff.h", - "line": 1235, - "lineto": 1235, + "file": "git2/diff.h", + "line": 1280, + "lineto": 1280, "tdef": "typedef", "description": " This is an opaque structure which is allocated by `git_diff_get_stats`.\n You are responsible for releasing the object memory when done, using the\n `git_diff_stats_free()` function.", "comments": "", @@ -30351,9 +30101,9 @@ "GIT_DIFF_STATS_INCLUDE_SUMMARY" ], "type": "enum", - "file": "diff.h", - "line": 1240, - "lineto": 1255, + "file": "git2/diff.h", + "line": 1285, + "lineto": 1300, "block": "GIT_DIFF_STATS_NONE\nGIT_DIFF_STATS_FULL\nGIT_DIFF_STATS_SHORT\nGIT_DIFF_STATS_NUMBER\nGIT_DIFF_STATS_INCLUDE_SUMMARY", "tdef": "typedef", "description": " Formatting options for diff stats", @@ -30406,7 +30156,7 @@ "GIT_DIRECTION_PUSH" ], "type": "enum", - "file": "net.h", + "file": "git2/net.h", "line": 31, "lineto": 34, "block": "GIT_DIRECTION_FETCH\nGIT_DIRECTION_PUSH", @@ -30446,9 +30196,9 @@ ], "type": "struct", "value": "git_error", - "file": "errors.h", - "line": 66, - "lineto": 69, + "file": "git2/errors.h", + "line": 69, + "lineto": 72, "block": "char * message\nint klass", "tdef": "typedef", "description": " Structure to store extra details of the last error that occurred.", @@ -30467,6 +30217,7 @@ ], "used": { "returns": [ + "git_error_last", "giterr_last" ], "needs": [] @@ -30504,13 +30255,15 @@ "GIT_PASSTHROUGH", "GIT_ITEROVER", "GIT_RETRY", - "GIT_EMISMATCH" + "GIT_EMISMATCH", + "GIT_EINDEXDIRTY", + "GIT_EAPPLYFAIL" ], "type": "enum", - "file": "errors.h", + "file": "git2/errors.h", "line": 21, - "lineto": 58, - "block": "GIT_OK\nGIT_ERROR\nGIT_ENOTFOUND\nGIT_EEXISTS\nGIT_EAMBIGUOUS\nGIT_EBUFS\nGIT_EUSER\nGIT_EBAREREPO\nGIT_EUNBORNBRANCH\nGIT_EUNMERGED\nGIT_ENONFASTFORWARD\nGIT_EINVALIDSPEC\nGIT_ECONFLICT\nGIT_ELOCKED\nGIT_EMODIFIED\nGIT_EAUTH\nGIT_ECERTIFICATE\nGIT_EAPPLIED\nGIT_EPEEL\nGIT_EEOF\nGIT_EINVALID\nGIT_EUNCOMMITTED\nGIT_EDIRECTORY\nGIT_EMERGECONFLICT\nGIT_PASSTHROUGH\nGIT_ITEROVER\nGIT_RETRY\nGIT_EMISMATCH", + "lineto": 61, + "block": "GIT_OK\nGIT_ERROR\nGIT_ENOTFOUND\nGIT_EEXISTS\nGIT_EAMBIGUOUS\nGIT_EBUFS\nGIT_EUSER\nGIT_EBAREREPO\nGIT_EUNBORNBRANCH\nGIT_EUNMERGED\nGIT_ENONFASTFORWARD\nGIT_EINVALIDSPEC\nGIT_ECONFLICT\nGIT_ELOCKED\nGIT_EMODIFIED\nGIT_EAUTH\nGIT_ECERTIFICATE\nGIT_EAPPLIED\nGIT_EPEEL\nGIT_EEOF\nGIT_EINVALID\nGIT_EUNCOMMITTED\nGIT_EDIRECTORY\nGIT_EMERGECONFLICT\nGIT_PASSTHROUGH\nGIT_ITEROVER\nGIT_RETRY\nGIT_EMISMATCH\nGIT_EINDEXDIRTY\nGIT_EAPPLYFAIL", "tdef": "typedef", "description": " Generic return codes ", "comments": "", @@ -30554,7 +30307,7 @@ { "type": "int", "name": "GIT_EUSER", - "comments": "", + "comments": "

GIT_EUSER is a special error that is never generated by libgit2\n code. You can return it from a callback (e.g to stop an iteration)\n to know that it was generated by the callback and not by libgit2.

\n", "value": -7 }, { @@ -30662,7 +30415,7 @@ { "type": "int", "name": "GIT_PASSTHROUGH", - "comments": "

Internal only

\n", + "comments": "

A user-configured callback refused to act

\n", "value": -30 }, { @@ -30682,6 +30435,18 @@ "name": "GIT_EMISMATCH", "comments": "

Hashsum mismatch in object

\n", "value": -33 + }, + { + "type": "int", + "name": "GIT_EINDEXDIRTY", + "comments": "

Unsaved changes in the index would be overwritten

\n", + "value": -34 + }, + { + "type": "int", + "name": "GIT_EAPPLYFAIL", + "comments": "

Patch application failed

\n", + "value": -35 } ], "used": { @@ -30694,251 +30459,251 @@ "git_error_t", { "decl": [ - "GITERR_NONE", - "GITERR_NOMEMORY", - "GITERR_OS", - "GITERR_INVALID", - "GITERR_REFERENCE", - "GITERR_ZLIB", - "GITERR_REPOSITORY", - "GITERR_CONFIG", - "GITERR_REGEX", - "GITERR_ODB", - "GITERR_INDEX", - "GITERR_OBJECT", - "GITERR_NET", - "GITERR_TAG", - "GITERR_TREE", - "GITERR_INDEXER", - "GITERR_SSL", - "GITERR_SUBMODULE", - "GITERR_THREAD", - "GITERR_STASH", - "GITERR_CHECKOUT", - "GITERR_FETCHHEAD", - "GITERR_MERGE", - "GITERR_SSH", - "GITERR_FILTER", - "GITERR_REVERT", - "GITERR_CALLBACK", - "GITERR_CHERRYPICK", - "GITERR_DESCRIBE", - "GITERR_REBASE", - "GITERR_FILESYSTEM", - "GITERR_PATCH", - "GITERR_WORKTREE", - "GITERR_SHA1" + "GIT_ERROR_NONE", + "GIT_ERROR_NOMEMORY", + "GIT_ERROR_OS", + "GIT_ERROR_INVALID", + "GIT_ERROR_REFERENCE", + "GIT_ERROR_ZLIB", + "GIT_ERROR_REPOSITORY", + "GIT_ERROR_CONFIG", + "GIT_ERROR_REGEX", + "GIT_ERROR_ODB", + "GIT_ERROR_INDEX", + "GIT_ERROR_OBJECT", + "GIT_ERROR_NET", + "GIT_ERROR_TAG", + "GIT_ERROR_TREE", + "GIT_ERROR_INDEXER", + "GIT_ERROR_SSL", + "GIT_ERROR_SUBMODULE", + "GIT_ERROR_THREAD", + "GIT_ERROR_STASH", + "GIT_ERROR_CHECKOUT", + "GIT_ERROR_FETCHHEAD", + "GIT_ERROR_MERGE", + "GIT_ERROR_SSH", + "GIT_ERROR_FILTER", + "GIT_ERROR_REVERT", + "GIT_ERROR_CALLBACK", + "GIT_ERROR_CHERRYPICK", + "GIT_ERROR_DESCRIBE", + "GIT_ERROR_REBASE", + "GIT_ERROR_FILESYSTEM", + "GIT_ERROR_PATCH", + "GIT_ERROR_WORKTREE", + "GIT_ERROR_SHA1" ], "type": "enum", - "file": "errors.h", - "line": 72, - "lineto": 107, - "block": "GITERR_NONE\nGITERR_NOMEMORY\nGITERR_OS\nGITERR_INVALID\nGITERR_REFERENCE\nGITERR_ZLIB\nGITERR_REPOSITORY\nGITERR_CONFIG\nGITERR_REGEX\nGITERR_ODB\nGITERR_INDEX\nGITERR_OBJECT\nGITERR_NET\nGITERR_TAG\nGITERR_TREE\nGITERR_INDEXER\nGITERR_SSL\nGITERR_SUBMODULE\nGITERR_THREAD\nGITERR_STASH\nGITERR_CHECKOUT\nGITERR_FETCHHEAD\nGITERR_MERGE\nGITERR_SSH\nGITERR_FILTER\nGITERR_REVERT\nGITERR_CALLBACK\nGITERR_CHERRYPICK\nGITERR_DESCRIBE\nGITERR_REBASE\nGITERR_FILESYSTEM\nGITERR_PATCH\nGITERR_WORKTREE\nGITERR_SHA1", + "file": "git2/errors.h", + "line": 75, + "lineto": 110, + "block": "GIT_ERROR_NONE\nGIT_ERROR_NOMEMORY\nGIT_ERROR_OS\nGIT_ERROR_INVALID\nGIT_ERROR_REFERENCE\nGIT_ERROR_ZLIB\nGIT_ERROR_REPOSITORY\nGIT_ERROR_CONFIG\nGIT_ERROR_REGEX\nGIT_ERROR_ODB\nGIT_ERROR_INDEX\nGIT_ERROR_OBJECT\nGIT_ERROR_NET\nGIT_ERROR_TAG\nGIT_ERROR_TREE\nGIT_ERROR_INDEXER\nGIT_ERROR_SSL\nGIT_ERROR_SUBMODULE\nGIT_ERROR_THREAD\nGIT_ERROR_STASH\nGIT_ERROR_CHECKOUT\nGIT_ERROR_FETCHHEAD\nGIT_ERROR_MERGE\nGIT_ERROR_SSH\nGIT_ERROR_FILTER\nGIT_ERROR_REVERT\nGIT_ERROR_CALLBACK\nGIT_ERROR_CHERRYPICK\nGIT_ERROR_DESCRIBE\nGIT_ERROR_REBASE\nGIT_ERROR_FILESYSTEM\nGIT_ERROR_PATCH\nGIT_ERROR_WORKTREE\nGIT_ERROR_SHA1", "tdef": "typedef", "description": " Error classes ", "comments": "", "fields": [ { "type": "int", - "name": "GITERR_NONE", + "name": "GIT_ERROR_NONE", "comments": "", "value": 0 }, { "type": "int", - "name": "GITERR_NOMEMORY", + "name": "GIT_ERROR_NOMEMORY", "comments": "", "value": 1 }, { "type": "int", - "name": "GITERR_OS", + "name": "GIT_ERROR_OS", "comments": "", "value": 2 }, { "type": "int", - "name": "GITERR_INVALID", + "name": "GIT_ERROR_INVALID", "comments": "", "value": 3 }, { "type": "int", - "name": "GITERR_REFERENCE", + "name": "GIT_ERROR_REFERENCE", "comments": "", "value": 4 }, { "type": "int", - "name": "GITERR_ZLIB", + "name": "GIT_ERROR_ZLIB", "comments": "", "value": 5 }, { "type": "int", - "name": "GITERR_REPOSITORY", + "name": "GIT_ERROR_REPOSITORY", "comments": "", "value": 6 }, { "type": "int", - "name": "GITERR_CONFIG", + "name": "GIT_ERROR_CONFIG", "comments": "", "value": 7 }, { "type": "int", - "name": "GITERR_REGEX", + "name": "GIT_ERROR_REGEX", "comments": "", "value": 8 }, { "type": "int", - "name": "GITERR_ODB", + "name": "GIT_ERROR_ODB", "comments": "", "value": 9 }, { "type": "int", - "name": "GITERR_INDEX", + "name": "GIT_ERROR_INDEX", "comments": "", "value": 10 }, { "type": "int", - "name": "GITERR_OBJECT", + "name": "GIT_ERROR_OBJECT", "comments": "", "value": 11 }, { "type": "int", - "name": "GITERR_NET", + "name": "GIT_ERROR_NET", "comments": "", "value": 12 }, { "type": "int", - "name": "GITERR_TAG", + "name": "GIT_ERROR_TAG", "comments": "", "value": 13 }, { "type": "int", - "name": "GITERR_TREE", + "name": "GIT_ERROR_TREE", "comments": "", "value": 14 }, { "type": "int", - "name": "GITERR_INDEXER", + "name": "GIT_ERROR_INDEXER", "comments": "", "value": 15 }, { "type": "int", - "name": "GITERR_SSL", + "name": "GIT_ERROR_SSL", "comments": "", "value": 16 }, { "type": "int", - "name": "GITERR_SUBMODULE", + "name": "GIT_ERROR_SUBMODULE", "comments": "", "value": 17 }, { "type": "int", - "name": "GITERR_THREAD", + "name": "GIT_ERROR_THREAD", "comments": "", "value": 18 }, { "type": "int", - "name": "GITERR_STASH", + "name": "GIT_ERROR_STASH", "comments": "", "value": 19 }, { "type": "int", - "name": "GITERR_CHECKOUT", + "name": "GIT_ERROR_CHECKOUT", "comments": "", "value": 20 }, { "type": "int", - "name": "GITERR_FETCHHEAD", + "name": "GIT_ERROR_FETCHHEAD", "comments": "", "value": 21 }, { "type": "int", - "name": "GITERR_MERGE", + "name": "GIT_ERROR_MERGE", "comments": "", "value": 22 }, { "type": "int", - "name": "GITERR_SSH", + "name": "GIT_ERROR_SSH", "comments": "", "value": 23 }, { "type": "int", - "name": "GITERR_FILTER", + "name": "GIT_ERROR_FILTER", "comments": "", "value": 24 }, { "type": "int", - "name": "GITERR_REVERT", + "name": "GIT_ERROR_REVERT", "comments": "", "value": 25 }, { "type": "int", - "name": "GITERR_CALLBACK", + "name": "GIT_ERROR_CALLBACK", "comments": "", "value": 26 }, { "type": "int", - "name": "GITERR_CHERRYPICK", + "name": "GIT_ERROR_CHERRYPICK", "comments": "", "value": 27 }, { "type": "int", - "name": "GITERR_DESCRIBE", + "name": "GIT_ERROR_DESCRIBE", "comments": "", "value": 28 }, { "type": "int", - "name": "GITERR_REBASE", + "name": "GIT_ERROR_REBASE", "comments": "", "value": 29 }, { "type": "int", - "name": "GITERR_FILESYSTEM", + "name": "GIT_ERROR_FILESYSTEM", "comments": "", "value": 30 }, { "type": "int", - "name": "GITERR_PATCH", + "name": "GIT_ERROR_PATCH", "comments": "", "value": 31 }, { "type": "int", - "name": "GITERR_WORKTREE", + "name": "GIT_ERROR_WORKTREE", "comments": "", "value": 32 }, { "type": "int", - "name": "GITERR_SHA1", + "name": "GIT_ERROR_SHA1", "comments": "", "value": 33 } @@ -30959,9 +30724,9 @@ "GIT_FEATURE_NSEC" ], "type": "enum", - "file": "common.h", - "line": 111, - "lineto": 134, + "file": "git2/common.h", + "line": 127, + "lineto": 150, "block": "GIT_FEATURE_THREADS\nGIT_FEATURE_HTTPS\nGIT_FEATURE_SSH\nGIT_FEATURE_NSEC", "tdef": "typedef", "description": " Combinations of these values describe the features with which libgit2\n was compiled", @@ -31012,9 +30777,9 @@ ], "type": "struct", "value": "git_fetch_options", - "file": "remote.h", - "line": 555, - "lineto": 592, + "file": "git2/remote.h", + "line": 652, + "lineto": 689, "block": "int version\ngit_remote_callbacks callbacks\ngit_fetch_prune_t prune\nint update_fetchhead\ngit_remote_autotag_option_t download_tags\ngit_proxy_options proxy_opts\ngit_strarray custom_headers", "tdef": "typedef", "description": " Fetch options structure.", @@ -31059,13 +30824,55 @@ "used": { "returns": [], "needs": [ - "git_fetch_init_options", + "git_fetch_options_init", "git_remote_download", "git_remote_fetch" ] } } ], + [ + "git_fetch_prune_t", + { + "decl": [ + "GIT_FETCH_PRUNE_UNSPECIFIED", + "GIT_FETCH_PRUNE", + "GIT_FETCH_NO_PRUNE" + ], + "type": "enum", + "file": "git2/remote.h", + "line": 604, + "lineto": 617, + "block": "GIT_FETCH_PRUNE_UNSPECIFIED\nGIT_FETCH_PRUNE\nGIT_FETCH_NO_PRUNE", + "tdef": "typedef", + "description": " Acceptable prune settings when fetching ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_FETCH_PRUNE_UNSPECIFIED", + "comments": "

Use the setting from the configuration

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_FETCH_PRUNE", + "comments": "

Force pruning on

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_FETCH_NO_PRUNE", + "comments": "

Force pruning off

\n", + "value": 2 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], [ "git_filemode_t", { @@ -31078,9 +30885,9 @@ "GIT_FILEMODE_COMMIT" ], "type": "enum", - "file": "types.h", - "line": 209, - "lineto": 216, + "file": "git2/types.h", + "line": 210, + "lineto": 217, "block": "GIT_FILEMODE_UNREADABLE\nGIT_FILEMODE_TREE\nGIT_FILEMODE_BLOB\nGIT_FILEMODE_BLOB_EXECUTABLE\nGIT_FILEMODE_LINK\nGIT_FILEMODE_COMMIT", "tdef": "typedef", "description": " Valid modes for index and tree entries. ", @@ -31137,98 +30944,27 @@ [ "git_filter", { - "decl": [ - "unsigned int version", - "const char * attributes", - "git_filter_init_fn initialize", - "git_filter_shutdown_fn shutdown", - "git_filter_check_fn check", - "git_filter_apply_fn apply", - "git_filter_stream_fn stream", - "git_filter_cleanup_fn cleanup" - ], + "decl": "git_filter", "type": "struct", "value": "git_filter", - "file": "sys/filter.h", - "line": 226, - "lineto": 271, - "tdef": null, - "description": " Filter structure used to register custom filters.", - "comments": "

To associate extra data with a filter, allocate extra data and put the git_filter struct at the start of your data buffer, then cast the self pointer to your larger structure when your callback is invoked.

\n", - "block": "unsigned int version\nconst char * attributes\ngit_filter_init_fn initialize\ngit_filter_shutdown_fn shutdown\ngit_filter_check_fn check\ngit_filter_apply_fn apply\ngit_filter_stream_fn stream\ngit_filter_cleanup_fn cleanup", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": " The `version` field should be set to `GIT_FILTER_VERSION`. " - }, - { - "type": "const char *", - "name": "attributes", - "comments": " A whitespace-separated list of attribute names to check for this\n filter (e.g. \"eol crlf text\"). If the attribute name is bare, it\n will be simply loaded and passed to the `check` callback. If it\n has a value (i.e. \"name=value\"), the attribute must match that\n value for the filter to be applied. The value may be a wildcard\n (eg, \"name=*\"), in which case the filter will be invoked for any\n value for the given attribute name. See the attribute parameter\n of the `check` callback for the attribute value that was specified." - }, - { - "type": "git_filter_init_fn", - "name": "initialize", - "comments": " Called when the filter is first used for any file. " - }, - { - "type": "git_filter_shutdown_fn", - "name": "shutdown", - "comments": " Called when the filter is removed or unregistered from the system. " - }, - { - "type": "git_filter_check_fn", - "name": "check", - "comments": " Called to determine whether the filter should be invoked for a\n given file. If this function returns `GIT_PASSTHROUGH` then the\n `apply` function will not be invoked and the contents will be passed\n through unmodified." - }, - { - "type": "git_filter_apply_fn", - "name": "apply", - "comments": " Called to actually apply the filter to file contents. If this\n function returns `GIT_PASSTHROUGH` then the contents will be passed\n through unmodified." - }, - { - "type": "git_filter_stream_fn", - "name": "stream", - "comments": " Called to apply the filter in a streaming manner. If this is not\n specified then the system will call `apply` with the whole buffer." - }, - { - "type": "git_filter_cleanup_fn", - "name": "cleanup", - "comments": " Called when the system is done filtering for a file. " - } - ], + "file": "git2/filter.h", + "line": 61, + "lineto": 61, + "tdef": "typedef", + "description": " A filter that can transform file data", + "comments": "

This represents a filter that can be used to transform or even replace file data. Libgit2 includes one built in filter and it is possible to write your own (see git2/sys/filter.h for information on that).

\n\n

The two builtin filters are:

\n\n\n", "used": { - "returns": [ - "git_filter_lookup", - "git_filter_source_mode" - ], + "returns": [], "needs": [ - "git_filter_apply_fn", - "git_filter_check_fn", - "git_filter_cleanup_fn", - "git_filter_init", - "git_filter_init_fn", "git_filter_list_apply_to_blob", "git_filter_list_apply_to_data", "git_filter_list_apply_to_file", "git_filter_list_contains", "git_filter_list_free", - "git_filter_list_length", "git_filter_list_load", - "git_filter_list_new", - "git_filter_list_push", "git_filter_list_stream_blob", "git_filter_list_stream_data", - "git_filter_list_stream_file", - "git_filter_register", - "git_filter_shutdown_fn", - "git_filter_source_filemode", - "git_filter_source_flags", - "git_filter_source_id", - "git_filter_source_mode", - "git_filter_source_path", - "git_filter_source_repo" + "git_filter_list_stream_file" ] } } @@ -31241,7 +30977,7 @@ "GIT_FILTER_ALLOW_UNSAFE" ], "type": "enum", - "file": "filter.h", + "file": "git2/filter.h", "line": 41, "lineto": 44, "block": "GIT_FILTER_DEFAULT\nGIT_FILTER_ALLOW_UNSAFE", @@ -31274,7 +31010,7 @@ "decl": "git_filter_list", "type": "struct", "value": "git_filter_list", - "file": "filter.h", + "file": "git2/filter.h", "line": 73, "lineto": 73, "tdef": "typedef", @@ -31288,10 +31024,7 @@ "git_filter_list_apply_to_file", "git_filter_list_contains", "git_filter_list_free", - "git_filter_list_length", "git_filter_list_load", - "git_filter_list_new", - "git_filter_list_push", "git_filter_list_stream_blob", "git_filter_list_stream_data", "git_filter_list_stream_file" @@ -31309,7 +31042,7 @@ "GIT_FILTER_CLEAN" ], "type": "enum", - "file": "filter.h", + "file": "git2/filter.h", "line": 31, "lineto": 36, "block": "GIT_FILTER_TO_WORKTREE\nGIT_FILTER_SMUDGE\nGIT_FILTER_TO_ODB\nGIT_FILTER_CLEAN", @@ -31343,12 +31076,9 @@ } ], "used": { - "returns": [ - "git_filter_source_mode" - ], + "returns": [], "needs": [ - "git_filter_list_load", - "git_filter_list_new" + "git_filter_list_load" ] } } @@ -31359,7 +31089,7 @@ "decl": "git_filter_source", "type": "struct", "value": "git_filter_source", - "file": "sys/filter.h", + "file": "git2/sys/filter.h", "line": 95, "lineto": 95, "tdef": "typedef", @@ -31367,39 +31097,7 @@ "comments": "", "used": { "returns": [], - "needs": [ - "git_filter_apply_fn", - "git_filter_check_fn", - "git_filter_source_filemode", - "git_filter_source_flags", - "git_filter_source_id", - "git_filter_source_mode", - "git_filter_source_path", - "git_filter_source_repo" - ] - } - } - ], - [ - "git_hashsig", - { - "decl": "git_hashsig", - "type": "struct", - "value": "git_hashsig", - "file": "sys/hashsig.h", - "line": 17, - "lineto": 17, - "tdef": "typedef", - "description": " Similarity signature of arbitrary text content based on line hashes", - "comments": "", - "used": { - "returns": [], - "needs": [ - "git_hashsig_compare", - "git_hashsig_create", - "git_hashsig_create_fromfile", - "git_hashsig_free" - ] + "needs": [] } } ], @@ -31413,7 +31111,7 @@ "GIT_HASHSIG_ALLOW_SMALL_FILES" ], "type": "enum", - "file": "sys/hashsig.h", + "file": "git2/sys/hashsig.h", "line": 25, "lineto": 45, "block": "GIT_HASHSIG_NORMAL\nGIT_HASHSIG_IGNORE_WHITESPACE\nGIT_HASHSIG_SMART_WHITESPACE\nGIT_HASHSIG_ALLOW_SMALL_FILES", @@ -31446,128 +31144,6 @@ "value": 4 } ], - "used": { - "returns": [], - "needs": [ - "git_hashsig_create", - "git_hashsig_create_fromfile" - ] - } - } - ], - [ - "git_idxentry_extended_flag_t", - { - "decl": [ - "GIT_IDXENTRY_INTENT_TO_ADD", - "GIT_IDXENTRY_SKIP_WORKTREE", - "GIT_IDXENTRY_EXTENDED2", - "GIT_IDXENTRY_EXTENDED_FLAGS", - "GIT_IDXENTRY_UPDATE", - "GIT_IDXENTRY_REMOVE", - "GIT_IDXENTRY_UPTODATE", - "GIT_IDXENTRY_ADDED", - "GIT_IDXENTRY_HASHED", - "GIT_IDXENTRY_UNHASHED", - "GIT_IDXENTRY_WT_REMOVE", - "GIT_IDXENTRY_CONFLICTED", - "GIT_IDXENTRY_UNPACKED", - "GIT_IDXENTRY_NEW_SKIP_WORKTREE" - ], - "type": "enum", - "file": "index.h", - "line": 115, - "lineto": 135, - "block": "GIT_IDXENTRY_INTENT_TO_ADD\nGIT_IDXENTRY_SKIP_WORKTREE\nGIT_IDXENTRY_EXTENDED2\nGIT_IDXENTRY_EXTENDED_FLAGS\nGIT_IDXENTRY_UPDATE\nGIT_IDXENTRY_REMOVE\nGIT_IDXENTRY_UPTODATE\nGIT_IDXENTRY_ADDED\nGIT_IDXENTRY_HASHED\nGIT_IDXENTRY_UNHASHED\nGIT_IDXENTRY_WT_REMOVE\nGIT_IDXENTRY_CONFLICTED\nGIT_IDXENTRY_UNPACKED\nGIT_IDXENTRY_NEW_SKIP_WORKTREE", - "tdef": "typedef", - "description": " Bitmasks for on-disk fields of `git_index_entry`'s `flags_extended`", - "comments": "

In memory, the flags_extended fields are divided into two parts: the fields that are read from and written to disk, and other fields that in-memory only and used by libgit2. Only the flags in GIT_IDXENTRY_EXTENDED_FLAGS will get saved on-disk.

\n\n

Thee first three bitmasks match the three fields in the git_index_entry flags_extended value that belong on disk. You can use them to interpret the data in the flags_extended.

\n\n

The rest of the bitmasks match the other fields in the git_index_entry flags_extended value that are only used in-memory by libgit2. You can use them to interpret the data in the flags_extended.

\n", - "fields": [ - { - "type": "int", - "name": "GIT_IDXENTRY_INTENT_TO_ADD", - "comments": "", - "value": 8192 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_SKIP_WORKTREE", - "comments": "", - "value": 16384 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_EXTENDED2", - "comments": "

Reserved for future extension

\n", - "value": 32768 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_EXTENDED_FLAGS", - "comments": "

Reserved for future extension

\n", - "value": 24576 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_UPDATE", - "comments": "

Reserved for future extension

\n", - "value": 1 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_REMOVE", - "comments": "

Reserved for future extension

\n", - "value": 2 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_UPTODATE", - "comments": "

Reserved for future extension

\n", - "value": 4 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_ADDED", - "comments": "

Reserved for future extension

\n", - "value": 8 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_HASHED", - "comments": "

Reserved for future extension

\n", - "value": 16 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_UNHASHED", - "comments": "

Reserved for future extension

\n", - "value": 32 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_WT_REMOVE", - "comments": "

remove in work directory

\n", - "value": 64 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_CONFLICTED", - "comments": "", - "value": 128 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_UNPACKED", - "comments": "", - "value": 256 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_NEW_SKIP_WORKTREE", - "comments": "", - "value": 512 - } - ], "used": { "returns": [], "needs": [] @@ -31580,18 +31156,20 @@ "decl": "git_index", "type": "struct", "value": "git_index", - "file": "types.h", - "line": 135, - "lineto": 135, + "file": "git2/types.h", + "line": 136, + "lineto": 136, "tdef": "typedef", "description": " Memory representation of an index file. ", "comments": "", "used": { "returns": [ "git_index_get_byindex", - "git_index_get_bypath" + "git_index_get_bypath", + "git_remote_stats" ], "needs": [ + "git_apply_to_tree", "git_checkout_index", "git_cherrypick_commit", "git_diff_index_to_index", @@ -31600,7 +31178,7 @@ "git_index_add", "git_index_add_all", "git_index_add_bypath", - "git_index_add_frombuffer", + "git_index_add_from_buffer", "git_index_caps", "git_index_checksum", "git_index_clear", @@ -31620,6 +31198,9 @@ "git_index_get_byindex", "git_index_get_bypath", "git_index_has_conflicts", + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next", "git_index_new", "git_index_open", "git_index_owner", @@ -31642,13 +31223,16 @@ "git_indexer_free", "git_indexer_hash", "git_indexer_new", + "git_indexer_options_init", + "git_indexer_progress_cb", "git_merge_commits", "git_merge_file_from_index", "git_merge_trees", + "git_odb_write_pack", + "git_packbuilder_write", "git_pathspec_match_index", "git_rebase_inmemory_index", "git_repository_index", - "git_repository_set_index", "git_revert_commit" ] } @@ -31664,9 +31248,9 @@ "GIT_INDEX_ADD_CHECK_PATHSPEC" ], "type": "enum", - "file": "index.h", - "line": 150, - "lineto": 155, + "file": "git2/index.h", + "line": 139, + "lineto": 144, "block": "GIT_INDEX_ADD_DEFAULT\nGIT_INDEX_ADD_FORCE\nGIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH\nGIT_INDEX_ADD_CHECK_PATHSPEC", "tdef": "typedef", "description": " Flags for APIs that add files matching pathspec ", @@ -31703,15 +31287,64 @@ } } ], + [ + "git_index_capability_t", + { + "decl": [ + "GIT_INDEX_CAPABILITY_IGNORE_CASE", + "GIT_INDEX_CAPABILITY_NO_FILEMODE", + "GIT_INDEX_CAPABILITY_NO_SYMLINKS", + "GIT_INDEX_CAPABILITY_FROM_OWNER" + ], + "type": "enum", + "file": "git2/index.h", + "line": 126, + "lineto": 131, + "block": "GIT_INDEX_CAPABILITY_IGNORE_CASE\nGIT_INDEX_CAPABILITY_NO_FILEMODE\nGIT_INDEX_CAPABILITY_NO_SYMLINKS\nGIT_INDEX_CAPABILITY_FROM_OWNER", + "tdef": "typedef", + "description": " Capabilities of system that affect index actions. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_INDEX_CAPABILITY_IGNORE_CASE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_INDEX_CAPABILITY_NO_FILEMODE", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_INDEX_CAPABILITY_NO_SYMLINKS", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_INDEX_CAPABILITY_FROM_OWNER", + "comments": "", + "value": -1 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], [ "git_index_conflict_iterator", { "decl": "git_index_conflict_iterator", "type": "struct", "value": "git_index_conflict_iterator", - "file": "types.h", - "line": 138, - "lineto": 138, + "file": "git2/types.h", + "line": 142, + "lineto": 142, "tdef": "typedef", "description": " An iterator for conflicts in the index. ", "comments": "", @@ -31744,13 +31377,13 @@ ], "type": "struct", "value": "git_index_entry", - "file": "index.h", + "file": "git2/index.h", "line": 53, "lineto": 70, "block": "git_index_time ctime\ngit_index_time mtime\nuint32_t dev\nuint32_t ino\nuint32_t mode\nuint32_t uid\nuint32_t gid\nuint32_t file_size\ngit_oid id\nuint16_t flags\nuint16_t flags_extended\nconst char * path", "tdef": "typedef", "description": " In-memory representation of a file entry in the index.", - "comments": "

This is a public structure that represents a file entry in the index. The meaning of the fields corresponds to core Git's documentation (in "Documentation/technical/index-format.txt").

\n\n

The flags field consists of a number of bit fields which can be accessed via the first set of GIT_IDXENTRY_... bitmasks below. These flags are all read from and persisted to disk.

\n\n

The flags_extended field also has a number of bit fields which can be accessed via the later GIT_IDXENTRY_... bitmasks below. Some of these flags are read from and written to disk, but some are set aside for in-memory only reference.

\n\n

Note that the time and size fields are truncated to 32 bits. This is enough to detect changes, which is enough for the index to function as a cache, but it should not be taken as an authoritative source for that data.

\n", + "comments": "

This is a public structure that represents a file entry in the index. The meaning of the fields corresponds to core Git's documentation (in "Documentation/technical/index-format.txt").

\n\n

The flags field consists of a number of bit fields which can be accessed via the first set of GIT_INDEX_ENTRY_... bitmasks below. These flags are all read from and persisted to disk.

\n\n

The flags_extended field also has a number of bit fields which can be accessed via the later GIT_INDEX_ENTRY_... bitmasks below. Some of these flags are read from and written to disk, but some are set aside for in-memory only reference.

\n\n

Note that the time and size fields are truncated to 32 bits. This is enough to detect changes, which is enough for the index to function as a cache, but it should not be taken as an authoritative source for that data.

\n", "fields": [ { "type": "git_index_time", @@ -31820,17 +31453,180 @@ ], "needs": [ "git_index_add", - "git_index_add_frombuffer", + "git_index_add_from_buffer", "git_index_conflict_add", "git_index_conflict_get", "git_index_conflict_next", "git_index_entry_is_conflict", "git_index_entry_stage", + "git_index_iterator_next", "git_merge_file_from_index" ] } } ], + [ + "git_index_entry_extended_flag_t", + { + "decl": [ + "GIT_INDEX_ENTRY_INTENT_TO_ADD", + "GIT_INDEX_ENTRY_SKIP_WORKTREE", + "GIT_INDEX_ENTRY_EXTENDED_FLAGS", + "GIT_INDEX_ENTRY_UPTODATE" + ], + "type": "enum", + "file": "git2/index.h", + "line": 116, + "lineto": 123, + "block": "GIT_INDEX_ENTRY_INTENT_TO_ADD\nGIT_INDEX_ENTRY_SKIP_WORKTREE\nGIT_INDEX_ENTRY_EXTENDED_FLAGS\nGIT_INDEX_ENTRY_UPTODATE", + "tdef": "typedef", + "description": " Bitmasks for on-disk fields of `git_index_entry`'s `flags_extended`", + "comments": "

In memory, the flags_extended fields are divided into two parts: the fields that are read from and written to disk, and other fields that in-memory only and used by libgit2. Only the flags in GIT_INDEX_ENTRY_EXTENDED_FLAGS will get saved on-disk.

\n\n

Thee first three bitmasks match the three fields in the git_index_entry flags_extended value that belong on disk. You can use them to interpret the data in the flags_extended.

\n\n

The rest of the bitmasks match the other fields in the git_index_entry flags_extended value that are only used in-memory by libgit2. You can use them to interpret the data in the flags_extended.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_INDEX_ENTRY_INTENT_TO_ADD", + "comments": "", + "value": 8192 + }, + { + "type": "int", + "name": "GIT_INDEX_ENTRY_SKIP_WORKTREE", + "comments": "", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_INDEX_ENTRY_EXTENDED_FLAGS", + "comments": "", + "value": 24576 + }, + { + "type": "int", + "name": "GIT_INDEX_ENTRY_UPTODATE", + "comments": "", + "value": 4 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_index_entry_flag_t", + { + "decl": [ + "GIT_INDEX_ENTRY_EXTENDED", + "GIT_INDEX_ENTRY_VALID" + ], + "type": "enum", + "file": "git2/index.h", + "line": 87, + "lineto": 90, + "block": "GIT_INDEX_ENTRY_EXTENDED\nGIT_INDEX_ENTRY_VALID", + "tdef": "typedef", + "description": " Flags for index entries", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_INDEX_ENTRY_EXTENDED", + "comments": "", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_INDEX_ENTRY_VALID", + "comments": "", + "value": 32768 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_index_iterator", + { + "decl": "git_index_iterator", + "type": "struct", + "value": "git_index_iterator", + "file": "git2/types.h", + "line": 139, + "lineto": 139, + "tdef": "typedef", + "description": " An iterator for entries in the index. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next" + ] + } + } + ], + [ + "git_index_stage_t", + { + "decl": [ + "GIT_INDEX_STAGE_ANY", + "GIT_INDEX_STAGE_NORMAL", + "GIT_INDEX_STAGE_ANCESTOR", + "GIT_INDEX_STAGE_OURS", + "GIT_INDEX_STAGE_THEIRS" + ], + "type": "enum", + "file": "git2/index.h", + "line": 147, + "lineto": 167, + "block": "GIT_INDEX_STAGE_ANY\nGIT_INDEX_STAGE_NORMAL\nGIT_INDEX_STAGE_ANCESTOR\nGIT_INDEX_STAGE_OURS\nGIT_INDEX_STAGE_THEIRS", + "tdef": "typedef", + "description": " Git index stage states ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_INDEX_STAGE_ANY", + "comments": "

Match any index stage.

\n\n

Some index APIs take a stage to match; pass this value to match\n any entry matching the path regardless of stage.

\n", + "value": -1 + }, + { + "type": "int", + "name": "GIT_INDEX_STAGE_NORMAL", + "comments": "

A normal staged file in the index.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_INDEX_STAGE_ANCESTOR", + "comments": "

The ancestor side of a conflict.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_INDEX_STAGE_OURS", + "comments": "

The "ours" side of a conflict.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_INDEX_STAGE_THEIRS", + "comments": "

The "theirs" side of a conflict.

\n", + "value": 3 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], [ "git_index_time", { @@ -31840,7 +31636,7 @@ ], "type": "struct", "value": "git_index_time", - "file": "index.h", + "file": "git2/index.h", "line": 26, "lineto": 30, "block": "int32_t seconds\nuint32_t nanoseconds", @@ -31866,86 +31662,153 @@ } ], [ - "git_indexcap_t", + "git_indexer", + { + "decl": "git_indexer", + "type": "struct", + "value": "git_indexer", + "file": "git2/indexer.h", + "line": 17, + "lineto": 17, + "tdef": "typedef", + "description": " A git indexer object ", + "comments": "", + "used": { + "returns": [ + "git_remote_stats" + ], + "needs": [ + "git_indexer_append", + "git_indexer_commit", + "git_indexer_free", + "git_indexer_hash", + "git_indexer_new", + "git_indexer_options_init", + "git_indexer_progress_cb", + "git_odb_write_pack", + "git_packbuilder_write" + ] + } + } + ], + [ + "git_indexer_options", { "decl": [ - "GIT_INDEXCAP_IGNORE_CASE", - "GIT_INDEXCAP_NO_FILEMODE", - "GIT_INDEXCAP_NO_SYMLINKS", - "GIT_INDEXCAP_FROM_OWNER" + "unsigned int version", + "git_indexer_progress_cb progress_cb", + "void * progress_cb_payload", + "unsigned char verify" ], - "type": "enum", - "file": "index.h", - "line": 138, - "lineto": 143, - "block": "GIT_INDEXCAP_IGNORE_CASE\nGIT_INDEXCAP_NO_FILEMODE\nGIT_INDEXCAP_NO_SYMLINKS\nGIT_INDEXCAP_FROM_OWNER", + "type": "struct", + "value": "git_indexer_options", + "file": "git2/indexer.h", + "line": 62, + "lineto": 72, + "block": "unsigned int version\ngit_indexer_progress_cb progress_cb\nvoid * progress_cb_payload\nunsigned char verify", "tdef": "typedef", - "description": " Capabilities of system that affect index actions. ", + "description": " Options for indexer configuration", "comments": "", "fields": [ { - "type": "int", - "name": "GIT_INDEXCAP_IGNORE_CASE", - "comments": "", - "value": 1 + "type": "unsigned int", + "name": "version", + "comments": "" }, { - "type": "int", - "name": "GIT_INDEXCAP_NO_FILEMODE", - "comments": "", - "value": 2 + "type": "git_indexer_progress_cb", + "name": "progress_cb", + "comments": " progress_cb function to call with progress information " }, { - "type": "int", - "name": "GIT_INDEXCAP_NO_SYMLINKS", - "comments": "", - "value": 4 + "type": "void *", + "name": "progress_cb_payload", + "comments": " progress_cb_payload payload for the progress callback " }, { - "type": "int", - "name": "GIT_INDEXCAP_FROM_OWNER", - "comments": "", - "value": -1 + "type": "unsigned char", + "name": "verify", + "comments": " Do connectivity checks for the received pack " } ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_indexer_new", + "git_indexer_options_init" + ] } } ], [ - "git_indxentry_flag_t", + "git_indexer_progress", { "decl": [ - "GIT_IDXENTRY_EXTENDED", - "GIT_IDXENTRY_VALID" + "unsigned int total_objects", + "unsigned int indexed_objects", + "unsigned int received_objects", + "unsigned int local_objects", + "unsigned int total_deltas", + "unsigned int indexed_deltas", + "size_t received_bytes" ], - "type": "enum", - "file": "index.h", - "line": 86, - "lineto": 89, - "block": "GIT_IDXENTRY_EXTENDED\nGIT_IDXENTRY_VALID", + "type": "struct", + "value": "git_indexer_progress", + "file": "git2/indexer.h", + "line": 24, + "lineto": 48, + "block": "unsigned int total_objects\nunsigned int indexed_objects\nunsigned int received_objects\nunsigned int local_objects\nunsigned int total_deltas\nunsigned int indexed_deltas\nsize_t received_bytes", "tdef": "typedef", - "description": " Flags for index entries", + "description": " This structure is used to provide callers information about the\n progress of indexing a packfile, either directly or part of a\n fetch or clone that downloads a packfile.", "comments": "", "fields": [ { - "type": "int", - "name": "GIT_IDXENTRY_EXTENDED", - "comments": "", - "value": 16384 + "type": "unsigned int", + "name": "total_objects", + "comments": " number of objects in the packfile being indexed " }, { - "type": "int", - "name": "GIT_IDXENTRY_VALID", - "comments": "", - "value": 32768 + "type": "unsigned int", + "name": "indexed_objects", + "comments": " received objects that have been hashed " + }, + { + "type": "unsigned int", + "name": "received_objects", + "comments": " received_objects: objects which have been downloaded " + }, + { + "type": "unsigned int", + "name": "local_objects", + "comments": " locally-available objects that have been injected in order\n to fix a thin pack" + }, + { + "type": "unsigned int", + "name": "total_deltas", + "comments": " number of deltas in the packfile being indexed " + }, + { + "type": "unsigned int", + "name": "indexed_deltas", + "comments": " received deltas that have been indexed " + }, + { + "type": "size_t", + "name": "received_bytes", + "comments": " size of the packfile received up to now " } ], "used": { - "returns": [], - "needs": [] + "returns": [ + "git_remote_stats" + ], + "needs": [ + "git_indexer_append", + "git_indexer_commit", + "git_indexer_progress_cb", + "git_odb_write_pack", + "git_packbuilder_write" + ] } } ], @@ -31975,13 +31838,18 @@ "GIT_OPT_ENABLE_FSYNC_GITDIR", "GIT_OPT_GET_WINDOWS_SHAREMODE", "GIT_OPT_SET_WINDOWS_SHAREMODE", - "GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION" + "GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION", + "GIT_OPT_SET_ALLOCATOR", + "GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY", + "GIT_OPT_GET_PACK_MAX_OBJECTS", + "GIT_OPT_SET_PACK_MAX_OBJECTS", + "GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS" ], "type": "enum", - "file": "common.h", - "line": 162, - "lineto": 186, - "block": "GIT_OPT_GET_MWINDOW_SIZE\nGIT_OPT_SET_MWINDOW_SIZE\nGIT_OPT_GET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_SET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_GET_SEARCH_PATH\nGIT_OPT_SET_SEARCH_PATH\nGIT_OPT_SET_CACHE_OBJECT_LIMIT\nGIT_OPT_SET_CACHE_MAX_SIZE\nGIT_OPT_ENABLE_CACHING\nGIT_OPT_GET_CACHED_MEMORY\nGIT_OPT_GET_TEMPLATE_PATH\nGIT_OPT_SET_TEMPLATE_PATH\nGIT_OPT_SET_SSL_CERT_LOCATIONS\nGIT_OPT_SET_USER_AGENT\nGIT_OPT_ENABLE_STRICT_OBJECT_CREATION\nGIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION\nGIT_OPT_SET_SSL_CIPHERS\nGIT_OPT_GET_USER_AGENT\nGIT_OPT_ENABLE_OFS_DELTA\nGIT_OPT_ENABLE_FSYNC_GITDIR\nGIT_OPT_GET_WINDOWS_SHAREMODE\nGIT_OPT_SET_WINDOWS_SHAREMODE\nGIT_OPT_ENABLE_STRICT_HASH_VERIFICATION", + "file": "git2/common.h", + "line": 178, + "lineto": 207, + "block": "GIT_OPT_GET_MWINDOW_SIZE\nGIT_OPT_SET_MWINDOW_SIZE\nGIT_OPT_GET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_SET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_GET_SEARCH_PATH\nGIT_OPT_SET_SEARCH_PATH\nGIT_OPT_SET_CACHE_OBJECT_LIMIT\nGIT_OPT_SET_CACHE_MAX_SIZE\nGIT_OPT_ENABLE_CACHING\nGIT_OPT_GET_CACHED_MEMORY\nGIT_OPT_GET_TEMPLATE_PATH\nGIT_OPT_SET_TEMPLATE_PATH\nGIT_OPT_SET_SSL_CERT_LOCATIONS\nGIT_OPT_SET_USER_AGENT\nGIT_OPT_ENABLE_STRICT_OBJECT_CREATION\nGIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION\nGIT_OPT_SET_SSL_CIPHERS\nGIT_OPT_GET_USER_AGENT\nGIT_OPT_ENABLE_OFS_DELTA\nGIT_OPT_ENABLE_FSYNC_GITDIR\nGIT_OPT_GET_WINDOWS_SHAREMODE\nGIT_OPT_SET_WINDOWS_SHAREMODE\nGIT_OPT_ENABLE_STRICT_HASH_VERIFICATION\nGIT_OPT_SET_ALLOCATOR\nGIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY\nGIT_OPT_GET_PACK_MAX_OBJECTS\nGIT_OPT_SET_PACK_MAX_OBJECTS\nGIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS", "tdef": "typedef", "description": " Global library options", "comments": "

These are used to select which global option to set or get and are used in git_libgit2_opts().

\n", @@ -32123,6 +31991,36 @@ "name": "GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION", "comments": "", "value": 22 + }, + { + "type": "int", + "name": "GIT_OPT_SET_ALLOCATOR", + "comments": "", + "value": 23 + }, + { + "type": "int", + "name": "GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY", + "comments": "", + "value": 24 + }, + { + "type": "int", + "name": "GIT_OPT_GET_PACK_MAX_OBJECTS", + "comments": "", + "value": 25 + }, + { + "type": "int", + "name": "GIT_OPT_SET_PACK_MAX_OBJECTS", + "comments": "", + "value": 26 + }, + { + "type": "int", + "name": "GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS", + "comments": "", + "value": 27 } ], "used": { @@ -32131,6 +32029,34 @@ } } ], + [ + "git_mailmap", + { + "decl": "git_mailmap", + "type": "struct", + "value": "git_mailmap", + "file": "git2/types.h", + "line": 412, + "lineto": 412, + "tdef": "typedef", + "description": " Representation of .mailmap file state. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_commit_author_with_mailmap", + "git_commit_committer_with_mailmap", + "git_mailmap_add_entry", + "git_mailmap_free", + "git_mailmap_from_buffer", + "git_mailmap_from_repository", + "git_mailmap_new", + "git_mailmap_resolve", + "git_mailmap_resolve_signature" + ] + } + } + ], [ "git_merge_analysis_t", { @@ -32142,9 +32068,9 @@ "GIT_MERGE_ANALYSIS_UNBORN" ], "type": "enum", - "file": "merge.h", - "line": 318, - "lineto": 347, + "file": "git2/merge.h", + "line": 316, + "lineto": 345, "block": "GIT_MERGE_ANALYSIS_NONE\nGIT_MERGE_ANALYSIS_NORMAL\nGIT_MERGE_ANALYSIS_UP_TO_DATE\nGIT_MERGE_ANALYSIS_FASTFORWARD\nGIT_MERGE_ANALYSIS_UNBORN", "tdef": "typedef", "description": " The results of `git_merge_analysis` indicate the merge opportunities.", @@ -32184,55 +32110,8 @@ "used": { "returns": [], "needs": [ - "git_merge_analysis" - ] - } - } - ], - [ - "git_merge_driver", - { - "decl": [ - "unsigned int version", - "git_merge_driver_init_fn initialize", - "git_merge_driver_shutdown_fn shutdown", - "git_merge_driver_apply_fn apply" - ], - "type": "struct", - "value": "git_merge_driver", - "file": "sys/merge.h", - "line": 118, - "lineto": 135, - "block": "unsigned int version\ngit_merge_driver_init_fn initialize\ngit_merge_driver_shutdown_fn shutdown\ngit_merge_driver_apply_fn apply", - "tdef": null, - "description": " Merge driver structure used to register custom merge drivers.", - "comments": "

To associate extra data with a driver, allocate extra data and put the git_merge_driver struct at the start of your data buffer, then cast the self pointer to your larger structure when your callback is invoked.

\n", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": " The `version` should be set to `GIT_MERGE_DRIVER_VERSION`. " - }, - { - "type": "git_merge_driver_init_fn", - "name": "initialize", - "comments": " Called when the merge driver is first used for any file. " - }, - { - "type": "git_merge_driver_shutdown_fn", - "name": "shutdown", - "comments": " Called when the merge driver is unregistered from the system. " - }, - { - "type": "git_merge_driver_apply_fn", - "name": "apply", - "comments": " Called to merge the contents of a conflict. If this function\n returns `GIT_PASSTHROUGH` then the default (`text`) merge driver\n will instead be invoked. If this function returns\n `GIT_EMERGECONFLICT` then the file will remain conflicted." - } - ], - "used": { - "returns": [], - "needs": [ - "git_merge_driver_apply_fn" + "git_merge_analysis", + "git_merge_analysis_for_ref" ] } } @@ -32243,17 +32122,15 @@ "decl": "git_merge_driver_source", "type": "struct", "value": "git_merge_driver_source", - "file": "sys/merge.h", - "line": 36, - "lineto": 36, + "file": "git2/sys/merge.h", + "line": 41, + "lineto": 41, "tdef": "typedef", "description": " A merge driver source represents the file to be merged", "comments": "", "used": { "returns": [], - "needs": [ - "git_merge_driver_apply_fn" - ] + "needs": [] } } ], @@ -32267,7 +32144,7 @@ "GIT_MERGE_FILE_FAVOR_UNION" ], "type": "enum", - "file": "merge.h", + "file": "git2/merge.h", "line": 101, "lineto": 131, "block": "GIT_MERGE_FILE_FAVOR_NORMAL\nGIT_MERGE_FILE_FAVOR_OURS\nGIT_MERGE_FILE_FAVOR_THEIRS\nGIT_MERGE_FILE_FAVOR_UNION", @@ -32321,7 +32198,7 @@ "GIT_MERGE_FILE_DIFF_MINIMAL" ], "type": "enum", - "file": "merge.h", + "file": "git2/merge.h", "line": 136, "lineto": 163, "block": "GIT_MERGE_FILE_DEFAULT\nGIT_MERGE_FILE_STYLE_MERGE\nGIT_MERGE_FILE_STYLE_DIFF3\nGIT_MERGE_FILE_SIMPLIFY_ALNUM\nGIT_MERGE_FILE_IGNORE_WHITESPACE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_EOL\nGIT_MERGE_FILE_DIFF_PATIENCE\nGIT_MERGE_FILE_DIFF_MINIMAL", @@ -32402,7 +32279,7 @@ ], "type": "struct", "value": "git_merge_file_input", - "file": "merge.h", + "file": "git2/merge.h", "line": 32, "lineto": 46, "block": "unsigned int version\nconst char * ptr\nsize_t size\nconst char * path\nunsigned int mode", @@ -32440,7 +32317,7 @@ "returns": [], "needs": [ "git_merge_file", - "git_merge_file_init_input" + "git_merge_file_input_init" ] } } @@ -32459,7 +32336,7 @@ ], "type": "struct", "value": "git_merge_file_options", - "file": "merge.h", + "file": "git2/merge.h", "line": 170, "lineto": 200, "block": "unsigned int version\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_merge_file_favor_t favor\ngit_merge_file_flag_t flags\nunsigned short marker_size", @@ -32508,7 +32385,7 @@ "needs": [ "git_merge_file", "git_merge_file_from_index", - "git_merge_file_init_options" + "git_merge_file_options_init" ] } } @@ -32525,9 +32402,9 @@ ], "type": "struct", "value": "git_merge_file_result", - "file": "merge.h", - "line": 221, - "lineto": 242, + "file": "git2/merge.h", + "line": 220, + "lineto": 241, "block": "unsigned int automergeable\nconst char * path\nunsigned int mode\nconst char * ptr\nsize_t len", "tdef": "typedef", "description": " Information about file-level merging", @@ -32579,7 +32456,7 @@ "GIT_MERGE_NO_RECURSIVE" ], "type": "enum", - "file": "merge.h", + "file": "git2/merge.h", "line": 68, "lineto": 95, "block": "GIT_MERGE_FIND_RENAMES\nGIT_MERGE_FAIL_ON_CONFLICT\nGIT_MERGE_SKIP_REUC\nGIT_MERGE_NO_RECURSIVE", @@ -32634,9 +32511,9 @@ ], "type": "struct", "value": "git_merge_options", - "file": "merge.h", - "line": 247, - "lineto": 296, + "file": "git2/merge.h", + "line": 246, + "lineto": 295, "block": "unsigned int version\ngit_merge_flag_t flags\nunsigned int rename_threshold\nunsigned int target_limit\ngit_diff_similarity_metric * metric\nunsigned int recursion_limit\nconst char * default_driver\ngit_merge_file_favor_t file_favor\ngit_merge_file_flag_t file_flags", "tdef": "typedef", "description": " Merging options", @@ -32694,7 +32571,7 @@ "git_cherrypick_commit", "git_merge", "git_merge_commits", - "git_merge_init_options", + "git_merge_options_init", "git_merge_trees", "git_revert_commit" ] @@ -32710,9 +32587,9 @@ "GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY" ], "type": "enum", - "file": "merge.h", - "line": 352, - "lineto": 370, + "file": "git2/merge.h", + "line": 350, + "lineto": 368, "block": "GIT_MERGE_PREFERENCE_NONE\nGIT_MERGE_PREFERENCE_NO_FASTFORWARD\nGIT_MERGE_PREFERENCE_FASTFORWARD_ONLY", "tdef": "typedef", "description": " The user's stated preference for merges.", @@ -32740,29 +32617,12 @@ "used": { "returns": [], "needs": [ - "git_merge_analysis" + "git_merge_analysis", + "git_merge_analysis_for_ref" ] } } ], - [ - "git_merge_result", - { - "decl": "git_merge_result", - "type": "struct", - "value": "git_merge_result", - "file": "types.h", - "line": 185, - "lineto": 185, - "tdef": "typedef", - "description": " Merge result ", - "comments": "", - "used": { - "returns": [], - "needs": [] - } - } - ], [ "git_message_trailer", { @@ -32772,7 +32632,7 @@ ], "type": "struct", "value": "git_message_trailer", - "file": "message.h", + "file": "git2/message.h", "line": 43, "lineto": 46, "block": "const char * key\nconst char * value", @@ -32810,7 +32670,7 @@ ], "type": "struct", "value": "git_message_trailer_array", - "file": "message.h", + "file": "git2/message.h", "line": 54, "lineto": 60, "block": "git_message_trailer * trailers\nsize_t count\nchar * _trailer_block", @@ -32849,9 +32709,9 @@ "decl": "git_note", "type": "struct", "value": "git_note", - "file": "types.h", - "line": 153, - "lineto": 153, + "file": "git2/types.h", + "line": 157, + "lineto": 157, "tdef": "typedef", "description": " Representation of a git note ", "comments": "", @@ -32880,7 +32740,7 @@ "decl": "git_note_iterator", "type": "struct", "value": "git_note_iterator", - "file": "notes.h", + "file": "git2/notes.h", "line": 35, "lineto": 35, "tdef": "typedef", @@ -32903,14 +32763,20 @@ "decl": "git_object", "type": "struct", "value": "git_object", - "file": "types.h", - "line": 111, - "lineto": 111, + "file": "git2/types.h", + "line": 112, + "lineto": 112, "tdef": "typedef", "description": " Representation of a generic object in a repository ", "comments": "", "used": { - "returns": [], + "returns": [ + "git_object_string2type", + "git_object_type", + "git_odb_object_type", + "git_tag_target_type", + "git_tree_entry_type" + ], "needs": [ "git_checkout_tree", "git_describe_commit", @@ -32923,8 +32789,18 @@ "git_object_owner", "git_object_peel", "git_object_short_id", + "git_object_size", "git_object_type", + "git_object_type2string", + "git_object_typeisloose", + "git_odb_hash", + "git_odb_hashfile", + "git_odb_open_rstream", + "git_odb_open_wstream", + "git_odb_read_header", + "git_odb_write", "git_reference_peel", + "git_repository_hashfile", "git_reset", "git_reset_default", "git_revparse_ext", @@ -32939,15 +32815,114 @@ } } ], + [ + "git_object_t", + { + "decl": [ + "GIT_OBJECT_ANY", + "GIT_OBJECT_INVALID", + "GIT_OBJECT_COMMIT", + "GIT_OBJECT_TREE", + "GIT_OBJECT_BLOB", + "GIT_OBJECT_TAG", + "GIT_OBJECT_OFS_DELTA", + "GIT_OBJECT_REF_DELTA" + ], + "type": "enum", + "file": "git2/types.h", + "line": 70, + "lineto": 79, + "block": "GIT_OBJECT_ANY\nGIT_OBJECT_INVALID\nGIT_OBJECT_COMMIT\nGIT_OBJECT_TREE\nGIT_OBJECT_BLOB\nGIT_OBJECT_TAG\nGIT_OBJECT_OFS_DELTA\nGIT_OBJECT_REF_DELTA", + "tdef": "typedef", + "description": " Basic type (loose or packed) of any Git object. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_OBJECT_ANY", + "comments": "

Object can be any of the following

\n", + "value": -2 + }, + { + "type": "int", + "name": "GIT_OBJECT_INVALID", + "comments": "

Object is invalid.

\n", + "value": -1 + }, + { + "type": "int", + "name": "GIT_OBJECT_COMMIT", + "comments": "

A commit object.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_OBJECT_TREE", + "comments": "

A tree (directory listing) object.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_OBJECT_BLOB", + "comments": "

A file revision object.

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_OBJECT_TAG", + "comments": "

An annotated tag object.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_OBJECT_OFS_DELTA", + "comments": "

A delta, base is given by an offset.

\n", + "value": 6 + }, + { + "type": "int", + "name": "GIT_OBJECT_REF_DELTA", + "comments": "

A delta, base is given by object id.

\n", + "value": 7 + } + ], + "used": { + "returns": [ + "git_object_string2type", + "git_object_type", + "git_odb_object_type", + "git_tag_target_type", + "git_tree_entry_type" + ], + "needs": [ + "git_object_lookup", + "git_object_lookup_bypath", + "git_object_lookup_prefix", + "git_object_peel", + "git_object_size", + "git_object_type2string", + "git_object_typeisloose", + "git_odb_hash", + "git_odb_hashfile", + "git_odb_open_rstream", + "git_odb_open_wstream", + "git_odb_read_header", + "git_odb_write", + "git_reference_peel", + "git_repository_hashfile" + ] + } + } + ], [ "git_odb", { "decl": "git_odb", "type": "struct", "value": "git_odb", - "file": "types.h", - "line": 81, - "lineto": 81, + "file": "git2/types.h", + "line": 82, + "lineto": 82, "tdef": "typedef", "description": " An open object database handle. ", "comments": "", @@ -32955,9 +32930,6 @@ "returns": [], "needs": [ "git_indexer_new", - "git_mempack_dump", - "git_mempack_new", - "git_mempack_reset", "git_odb_add_alternate", "git_odb_add_backend", "git_odb_add_disk_alternate", @@ -32970,7 +32942,6 @@ "git_odb_foreach", "git_odb_free", "git_odb_get_backend", - "git_odb_init_backend", "git_odb_new", "git_odb_num_backends", "git_odb_object_data", @@ -32993,7 +32964,6 @@ "git_odb_write", "git_odb_write_pack", "git_repository_odb", - "git_repository_set_odb", "git_repository_wrap_odb" ] } @@ -33005,103 +32975,21 @@ "decl": "git_odb_backend", "type": "struct", "value": "git_odb_backend", - "file": "types.h", - "line": 84, - "lineto": 84, - "block": "unsigned int version\ngit_odb * odb\nint (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *) read\nint (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t) read_prefix\nint (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *) read_header\nint (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype) write\nint (*)(git_odb_stream **, git_odb_backend *, git_off_t, git_otype) writestream\nint (*)(git_odb_stream **, size_t *, git_otype *, git_odb_backend *, const git_oid *) readstream\nint (*)(git_odb_backend *, const git_oid *) exists\nint (*)(git_oid *, git_odb_backend *, const git_oid *, size_t) exists_prefix\nint (*)(git_odb_backend *) refresh\nint (*)(git_odb_backend *, git_odb_foreach_cb, void *) foreach\nint (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *) writepack\nint (*)(git_odb_backend *, const git_oid *) freshen\nvoid (*)(git_odb_backend *) free", + "file": "git2/types.h", + "line": 85, + "lineto": 85, "tdef": "typedef", "description": " A custom backend in an ODB ", "comments": "", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, - { - "type": "git_odb *", - "name": "odb", - "comments": "" - }, - { - "type": "int (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *)", - "name": "read", - "comments": "" - }, - { - "type": "int (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t)", - "name": "read_prefix", - "comments": "" - }, - { - "type": "int (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *)", - "name": "read_header", - "comments": "" - }, - { - "type": "int (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype)", - "name": "write", - "comments": " Write an object into the backend. The id of the object has\n already been calculated and is passed in." - }, - { - "type": "int (*)(git_odb_stream **, git_odb_backend *, git_off_t, git_otype)", - "name": "writestream", - "comments": "" - }, - { - "type": "int (*)(git_odb_stream **, size_t *, git_otype *, git_odb_backend *, const git_oid *)", - "name": "readstream", - "comments": "" - }, - { - "type": "int (*)(git_odb_backend *, const git_oid *)", - "name": "exists", - "comments": "" - }, - { - "type": "int (*)(git_oid *, git_odb_backend *, const git_oid *, size_t)", - "name": "exists_prefix", - "comments": "" - }, - { - "type": "int (*)(git_odb_backend *)", - "name": "refresh", - "comments": " If the backend implements a refreshing mechanism, it should be exposed\n through this endpoint. Each call to `git_odb_refresh()` will invoke it.\n\n However, the backend implementation should try to stay up-to-date as much\n as possible by itself as libgit2 will not automatically invoke\n `git_odb_refresh()`. For instance, a potential strategy for the backend\n implementation to achieve this could be to internally invoke this\n endpoint on failed lookups (ie. `exists()`, `read()`, `read_header()`)." - }, - { - "type": "int (*)(git_odb_backend *, git_odb_foreach_cb, void *)", - "name": "foreach", - "comments": "" - }, - { - "type": "int (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *)", - "name": "writepack", - "comments": "" - }, - { - "type": "int (*)(git_odb_backend *, const git_oid *)", - "name": "freshen", - "comments": " \"Freshens\" an already existing object, updating its last-used\n time. This occurs when `git_odb_write` was called, but the\n object already existed (and will not be re-written). The\n underlying implementation may want to update last-used timestamps.\n\n If callers implement this, they should return `0` if the object\n exists and was freshened, and non-zero otherwise." - }, - { - "type": "void (*)(git_odb_backend *)", - "name": "free", - "comments": " Frees any resources held by the odb (including the `git_odb_backend`\n itself). An odb backend implementation must provide this function." - } - ], "used": { "returns": [], "needs": [ - "git_mempack_dump", - "git_mempack_new", - "git_mempack_reset", "git_odb_add_alternate", "git_odb_add_backend", "git_odb_backend_loose", "git_odb_backend_one_pack", "git_odb_backend_pack", - "git_odb_get_backend", - "git_odb_init_backend" + "git_odb_get_backend" ] } } @@ -33112,14 +33000,14 @@ "decl": [ "git_oid id", "unsigned short length", - "git_otype type" + "git_object_t type" ], "type": "struct", "value": "git_odb_expand_id", - "file": "odb.h", - "line": 180, - "lineto": 195, - "block": "git_oid id\nunsigned short length\ngit_otype type", + "file": "git2/odb.h", + "line": 181, + "lineto": 196, + "block": "git_oid id\nunsigned short length\ngit_object_t type", "tdef": "typedef", "description": " The information about object IDs to query in `git_odb_expand_ids`,\n which will be populated upon return.", "comments": "", @@ -33135,9 +33023,9 @@ "comments": " The length of the object ID (in nibbles, or packets of 4 bits; the\n number of hex characters)" }, { - "type": "git_otype", + "type": "git_object_t", "name": "type", - "comments": " The (optional) type of the object to search for; leave as `0` or set\n to `GIT_OBJ_ANY` to query for any object matching the ID." + "comments": " The (optional) type of the object to search for; leave as `0` or set\n to `GIT_OBJECT_ANY` to query for any object matching the ID." } ], "used": { @@ -33154,9 +33042,9 @@ "decl": "git_odb_object", "type": "struct", "value": "git_odb_object", - "file": "types.h", - "line": 87, - "lineto": 87, + "file": "git2/types.h", + "line": 88, + "lineto": 88, "tdef": "typedef", "description": " An object read from the ODB ", "comments": "", @@ -33181,10 +33069,10 @@ "decl": "git_odb_stream", "type": "struct", "value": "git_odb_stream", - "file": "types.h", - "line": 90, - "lineto": 90, - "block": "git_odb_backend * backend\nunsigned int mode\nvoid * hash_ctx\ngit_off_t declared_size\ngit_off_t received_bytes\nint (*)(git_odb_stream *, char *, size_t) read\nint (*)(git_odb_stream *, const char *, size_t) write\nint (*)(git_odb_stream *, const int *) finalize_write\nvoid (*)(git_odb_stream *) free", + "file": "git2/types.h", + "line": 91, + "lineto": 91, + "block": "git_odb_backend * backend\nunsigned int mode\nvoid * hash_ctx\ngit_off_t declared_size\ngit_off_t received_bytes\nint (*)(git_odb_stream *, char *, size_t) read\nint (*)(git_odb_stream *, const char *, size_t) write\nint (*)(git_odb_stream *, const git_oid *) finalize_write\nvoid (*)(git_odb_stream *) free", "tdef": "typedef", "description": " A stream to read/write from the ODB ", "comments": "", @@ -33217,22 +33105,22 @@ { "type": "int (*)(git_odb_stream *, char *, size_t)", "name": "read", - "comments": " Write at most `len` bytes into `buffer` and advance the stream." + "comments": "" }, { "type": "int (*)(git_odb_stream *, const char *, size_t)", "name": "write", - "comments": " Write `len` bytes from `buffer` into the stream." + "comments": "" }, { - "type": "int (*)(git_odb_stream *, const int *)", + "type": "int (*)(git_odb_stream *, const git_oid *)", "name": "finalize_write", - "comments": " Store the contents of the stream as an object with the id\n specified in `oid`.\n\n This method might not be invoked if:\n - an error occurs earlier with the `write` callback,\n - the object referred to by `oid` already exists in any backend, or\n - the final number of received bytes differs from the size declared\n with `git_odb_open_wstream()`" + "comments": "" }, { "type": "void (*)(git_odb_stream *)", "name": "free", - "comments": " Free the stream's memory.\n\n This method might be called without a call to `finalize_write` if\n an error occurs or if the object is already present in the ODB." + "comments": "" } ], "used": { @@ -33257,9 +33145,9 @@ "GIT_STREAM_RW" ], "type": "enum", - "file": "odb_backend.h", - "line": 70, - "lineto": 74, + "file": "git2/odb_backend.h", + "line": 71, + "lineto": 75, "block": "GIT_STREAM_RDONLY\nGIT_STREAM_WRONLY\nGIT_STREAM_RW", "tdef": "typedef", "description": " Streaming mode ", @@ -33296,10 +33184,10 @@ "decl": "git_odb_writepack", "type": "struct", "value": "git_odb_writepack", - "file": "types.h", - "line": 93, - "lineto": 93, - "block": "git_odb_backend * backend\nint (*)(git_odb_writepack *, const void *, size_t, git_transfer_progress *) append\nint (*)(git_odb_writepack *, git_transfer_progress *) commit\nvoid (*)(git_odb_writepack *) free", + "file": "git2/types.h", + "line": 94, + "lineto": 94, + "block": "git_odb_backend * backend\nint (*)(git_odb_writepack *, const void *, size_t, git_indexer_progress *) append\nint (*)(git_odb_writepack *, git_indexer_progress *) commit\nvoid (*)(git_odb_writepack *) free", "tdef": "typedef", "description": " A stream to write a packfile to the ODB ", "comments": "", @@ -33310,12 +33198,12 @@ "comments": "" }, { - "type": "int (*)(git_odb_writepack *, const void *, size_t, git_transfer_progress *)", + "type": "int (*)(git_odb_writepack *, const void *, size_t, git_indexer_progress *)", "name": "append", "comments": "" }, { - "type": "int (*)(git_odb_writepack *, git_transfer_progress *)", + "type": "int (*)(git_odb_writepack *, git_indexer_progress *)", "name": "commit", "comments": "" }, @@ -33341,7 +33229,7 @@ ], "type": "struct", "value": "git_oid", - "file": "oid.h", + "file": "git2/oid.h", "line": 33, "lineto": 36, "block": "unsigned char [20] id", @@ -33362,7 +33250,6 @@ "git_commit_id", "git_commit_parent_id", "git_commit_tree_id", - "git_filter_source_id", "git_index_checksum", "git_indexer_hash", "git_note_id", @@ -33370,6 +33257,8 @@ "git_odb_object_id", "git_oid_shorten_new", "git_packbuilder_hash", + "git_rebase_onto_id", + "git_rebase_orig_head_id", "git_reference_target", "git_reference_target_peel", "git_reflog_entry_id_new", @@ -33385,16 +33274,15 @@ "needs": [ "git_annotated_commit_from_fetchhead", "git_annotated_commit_lookup", - "git_blob_create_frombuffer", - "git_blob_create_fromdisk", - "git_blob_create_fromstream_commit", + "git_blob_create_from_buffer", + "git_blob_create_from_disk", + "git_blob_create_from_stream_commit", + "git_blob_create_from_workdir", "git_blob_create_fromworkdir", "git_blob_lookup", "git_blob_lookup_prefix", "git_commit_amend", "git_commit_create", - "git_commit_create_from_callback", - "git_commit_create_from_ids", "git_commit_create_v", "git_commit_create_with_signature", "git_commit_extract_signature", @@ -33439,6 +33327,7 @@ "git_oid_fromstr", "git_oid_fromstrn", "git_oid_fromstrp", + "git_oid_is_zero", "git_oid_iszero", "git_oid_ncmp", "git_oid_nfmt", @@ -33455,24 +33344,29 @@ "git_packbuilder_insert_recur", "git_packbuilder_insert_tree", "git_rebase_commit", - "git_reference__alloc", "git_reference_create", "git_reference_create_matching", "git_reference_name_to_id", "git_reference_set_target", "git_reflog_append", + "git_repository_fetchhead_foreach_cb", "git_repository_hashfile", + "git_repository_mergehead_foreach_cb", "git_repository_set_head_detached", "git_revwalk_hide", "git_revwalk_hide_cb", "git_revwalk_next", "git_revwalk_push", + "git_stash_cb", + "git_stash_save", "git_tag_annotation_create", "git_tag_create", - "git_tag_create_frombuffer", + "git_tag_create_from_buffer", "git_tag_create_lightweight", + "git_tag_foreach_cb", "git_tag_lookup", "git_tag_lookup_prefix", + "git_transaction_set_target", "git_tree_create_updated", "git_tree_entry_byid", "git_tree_lookup", @@ -33490,7 +33384,7 @@ "decl": "git_oid_shorten", "type": "struct", "value": "git_oid_shorten", - "file": "oid.h", + "file": "git2/oid.h", "line": 215, "lineto": 215, "tdef": "typedef", @@ -33516,7 +33410,7 @@ ], "type": "struct", "value": "git_oidarray", - "file": "oidarray.h", + "file": "git2/oidarray.h", "line": 16, "lineto": 19, "block": "git_oid * ids\nsize_t count", @@ -33545,128 +33439,15 @@ } } ], - [ - "git_otype", - { - "decl": [ - "GIT_OBJ_ANY", - "GIT_OBJ_BAD", - "GIT_OBJ__EXT1", - "GIT_OBJ_COMMIT", - "GIT_OBJ_TREE", - "GIT_OBJ_BLOB", - "GIT_OBJ_TAG", - "GIT_OBJ__EXT2", - "GIT_OBJ_OFS_DELTA", - "GIT_OBJ_REF_DELTA" - ], - "type": "enum", - "file": "types.h", - "line": 67, - "lineto": 78, - "block": "GIT_OBJ_ANY\nGIT_OBJ_BAD\nGIT_OBJ__EXT1\nGIT_OBJ_COMMIT\nGIT_OBJ_TREE\nGIT_OBJ_BLOB\nGIT_OBJ_TAG\nGIT_OBJ__EXT2\nGIT_OBJ_OFS_DELTA\nGIT_OBJ_REF_DELTA", - "tdef": "typedef", - "description": " Basic type (loose or packed) of any Git object. ", - "comments": "", - "fields": [ - { - "type": "int", - "name": "GIT_OBJ_ANY", - "comments": "

Object can be any of the following

\n", - "value": -2 - }, - { - "type": "int", - "name": "GIT_OBJ_BAD", - "comments": "

Object is invalid.

\n", - "value": -1 - }, - { - "type": "int", - "name": "GIT_OBJ__EXT1", - "comments": "

Reserved for future use.

\n", - "value": 0 - }, - { - "type": "int", - "name": "GIT_OBJ_COMMIT", - "comments": "

A commit object.

\n", - "value": 1 - }, - { - "type": "int", - "name": "GIT_OBJ_TREE", - "comments": "

A tree (directory listing) object.

\n", - "value": 2 - }, - { - "type": "int", - "name": "GIT_OBJ_BLOB", - "comments": "

A file revision object.

\n", - "value": 3 - }, - { - "type": "int", - "name": "GIT_OBJ_TAG", - "comments": "

An annotated tag object.

\n", - "value": 4 - }, - { - "type": "int", - "name": "GIT_OBJ__EXT2", - "comments": "

Reserved for future use.

\n", - "value": 5 - }, - { - "type": "int", - "name": "GIT_OBJ_OFS_DELTA", - "comments": "

A delta, base is given by an offset.

\n", - "value": 6 - }, - { - "type": "int", - "name": "GIT_OBJ_REF_DELTA", - "comments": "

A delta, base is given by object id.

\n", - "value": 7 - } - ], - "used": { - "returns": [ - "git_object_string2type", - "git_object_type", - "git_odb_object_type", - "git_tag_target_type", - "git_tree_entry_type" - ], - "needs": [ - "git_object__size", - "git_object_lookup", - "git_object_lookup_bypath", - "git_object_lookup_prefix", - "git_object_peel", - "git_object_type2string", - "git_object_typeisloose", - "git_odb_hash", - "git_odb_hashfile", - "git_odb_open_rstream", - "git_odb_open_wstream", - "git_odb_read_header", - "git_odb_write", - "git_reference_peel", - "git_repository_hashfile" - ] - } - } - ], [ "git_packbuilder", { "decl": "git_packbuilder", "type": "struct", "value": "git_packbuilder", - "file": "types.h", - "line": 156, - "lineto": 156, + "file": "git2/types.h", + "line": 160, + "lineto": 160, "tdef": "typedef", "description": " Representation of a git packbuilder ", "comments": "", @@ -33686,6 +33467,7 @@ "git_packbuilder_set_callbacks", "git_packbuilder_set_threads", "git_packbuilder_write", + "git_packbuilder_write_buf", "git_packbuilder_written" ] } @@ -33699,9 +33481,9 @@ "GIT_PACKBUILDER_DELTAFICATION" ], "type": "enum", - "file": "pack.h", - "line": 51, - "lineto": 54, + "file": "git2/pack.h", + "line": 52, + "lineto": 55, "block": "GIT_PACKBUILDER_ADDING_OBJECTS\nGIT_PACKBUILDER_DELTAFICATION", "tdef": "typedef", "description": " Stages that are reported by the packbuilder progress callback.", @@ -33732,7 +33514,7 @@ "decl": "git_patch", "type": "struct", "value": "git_patch", - "file": "patch.h", + "file": "git2/patch.h", "line": 29, "lineto": 29, "tdef": "typedef", @@ -33759,13 +33541,55 @@ } } ], + [ + "git_path_fs", + { + "decl": [ + "GIT_PATH_FS_GENERIC", + "GIT_PATH_FS_NTFS", + "GIT_PATH_FS_HFS" + ], + "type": "enum", + "file": "git2/sys/path.h", + "line": 34, + "lineto": 41, + "block": "GIT_PATH_FS_GENERIC\nGIT_PATH_FS_NTFS\nGIT_PATH_FS_HFS", + "tdef": "typedef", + "description": " The kinds of checks to perform according to which filesystem we are trying to\n protect.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_PATH_FS_GENERIC", + "comments": "

Do both NTFS- and HFS-specific checks

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_PATH_FS_NTFS", + "comments": "

Do NTFS-specific checks only

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_PATH_FS_HFS", + "comments": "

Do HFS-specific checks only

\n", + "value": 2 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], [ "git_pathspec", { "decl": "git_pathspec", "type": "struct", "value": "git_pathspec", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 20, "lineto": 20, "tdef": "typedef", @@ -33804,7 +33628,7 @@ "GIT_PATHSPEC_FAILURES_ONLY" ], "type": "enum", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 30, "lineto": 73, "block": "GIT_PATHSPEC_DEFAULT\nGIT_PATHSPEC_IGNORE_CASE\nGIT_PATHSPEC_USE_CASE\nGIT_PATHSPEC_NO_GLOB\nGIT_PATHSPEC_NO_MATCH_ERROR\nGIT_PATHSPEC_FIND_FAILURES\nGIT_PATHSPEC_FAILURES_ONLY", @@ -33867,7 +33691,7 @@ "decl": "git_pathspec_match_list", "type": "struct", "value": "git_pathspec_match_list", - "file": "pathspec.h", + "file": "git2/pathspec.h", "line": 25, "lineto": 25, "tdef": "typedef", @@ -33903,7 +33727,7 @@ ], "type": "struct", "value": "git_proxy_options", - "file": "proxy.h", + "file": "git2/proxy.h", "line": 42, "lineto": 77, "block": "unsigned int version\ngit_proxy_t type\nconst char * url\ngit_cred_acquire_cb credentials\ngit_transport_certificate_check_cb certificate_check\nvoid * payload", @@ -33934,7 +33758,7 @@ { "type": "git_transport_certificate_check_cb", "name": "certificate_check", - "comments": " If cert verification fails, this will be called to let the\n user make the final decision of whether to allow the\n connection to proceed. Returns 1 to allow the connection, 0\n to disallow it or a negative value to indicate an error." + "comments": " If cert verification fails, this will be called to let the\n user make the final decision of whether to allow the\n connection to proceed. Returns 0 to allow the connection\n or a negative value to indicate an error." }, { "type": "void *", @@ -33945,9 +33769,8 @@ "used": { "returns": [], "needs": [ - "git_proxy_init_options", - "git_remote_connect", - "git_transport_smart_proxy_options" + "git_proxy_options_init", + "git_remote_connect" ] } } @@ -33961,7 +33784,7 @@ "GIT_PROXY_SPECIFIED" ], "type": "enum", - "file": "proxy.h", + "file": "git2/proxy.h", "line": 18, "lineto": 34, "block": "GIT_PROXY_NONE\nGIT_PROXY_AUTO\nGIT_PROXY_SPECIFIED", @@ -34000,17 +33823,17 @@ "decl": "git_push", "type": "struct", "value": "git_push", - "file": "types.h", - "line": 240, - "lineto": 240, + "file": "git2/types.h", + "line": 241, + "lineto": 241, "tdef": "typedef", "description": " Preparation for a push operation. Can be used to configure what to\n push and the level of parallelism of the packfile builder.", "comments": "", "used": { "returns": [], "needs": [ - "git_push_init_options", "git_push_negotiation", + "git_push_options_init", "git_remote_push", "git_remote_upload" ] @@ -34029,9 +33852,9 @@ ], "type": "struct", "value": "git_push_options", - "file": "remote.h", - "line": 615, - "lineto": 642, + "file": "git2/remote.h", + "line": 713, + "lineto": 740, "block": "unsigned int version\nunsigned int pb_parallelism\ngit_remote_callbacks callbacks\ngit_proxy_options proxy_opts\ngit_strarray custom_headers", "tdef": "typedef", "description": " Controls the behavior of a git_push object.", @@ -34066,7 +33889,7 @@ "used": { "returns": [], "needs": [ - "git_push_init_options", + "git_push_options_init", "git_remote_push", "git_remote_upload" ] @@ -34084,9 +33907,9 @@ ], "type": "struct", "value": "git_push_update", - "file": "remote.h", - "line": 359, - "lineto": 376, + "file": "git2/remote.h", + "line": 434, + "lineto": 451, "block": "char * src_refname\nchar * dst_refname\ngit_oid src\ngit_oid dst", "tdef": "typedef", "description": " Represents an update which will be performed on the remote during push", @@ -34127,9 +33950,9 @@ "decl": "git_rebase", "type": "struct", "value": "git_rebase", - "file": "types.h", - "line": 191, - "lineto": 191, + "file": "git2/types.h", + "line": 192, + "lineto": 192, "tdef": "typedef", "description": " Representation of a rebase ", "comments": "", @@ -34143,13 +33966,17 @@ "git_rebase_finish", "git_rebase_free", "git_rebase_init", - "git_rebase_init_options", "git_rebase_inmemory_index", "git_rebase_next", + "git_rebase_onto_id", + "git_rebase_onto_name", "git_rebase_open", "git_rebase_operation_byindex", "git_rebase_operation_current", - "git_rebase_operation_entrycount" + "git_rebase_operation_entrycount", + "git_rebase_options_init", + "git_rebase_orig_head_id", + "git_rebase_orig_head_name" ] } } @@ -34164,9 +33991,9 @@ ], "type": "struct", "value": "git_rebase_operation", - "file": "rebase.h", - "line": 130, - "lineto": 145, + "file": "git2/rebase.h", + "line": 132, + "lineto": 147, "block": "git_rebase_operation_t type\nconst git_oid id\nconst char * exec", "tdef": "typedef", "description": " A rebase operation", @@ -34210,9 +34037,9 @@ "GIT_REBASE_OPERATION_EXEC" ], "type": "enum", - "file": "rebase.h", - "line": 78, - "lineto": 114, + "file": "git2/rebase.h", + "line": 80, + "lineto": 116, "block": "GIT_REBASE_OPERATION_PICK\nGIT_REBASE_OPERATION_REWORD\nGIT_REBASE_OPERATION_EDIT\nGIT_REBASE_OPERATION_SQUASH\nGIT_REBASE_OPERATION_FIXUP\nGIT_REBASE_OPERATION_EXEC", "tdef": "typedef", "description": " Type of rebase operation in-progress after calling `git_rebase_next`.", @@ -34262,53 +34089,64 @@ } ], [ - "git_ref_t", + "git_rebase_options", { "decl": [ - "GIT_REF_INVALID", - "GIT_REF_OID", - "GIT_REF_SYMBOLIC", - "GIT_REF_LISTALL" + "unsigned int version", + "int quiet", + "int inmemory", + "const char * rewrite_notes_ref", + "git_merge_options merge_options", + "git_checkout_options checkout_options" ], - "type": "enum", - "file": "types.h", - "line": 194, - "lineto": 199, - "block": "GIT_REF_INVALID\nGIT_REF_OID\nGIT_REF_SYMBOLIC\nGIT_REF_LISTALL", + "type": "struct", + "value": "git_rebase_options", + "file": "git2/rebase.h", + "line": 31, + "lineto": 75, + "block": "unsigned int version\nint quiet\nint inmemory\nconst char * rewrite_notes_ref\ngit_merge_options merge_options\ngit_checkout_options checkout_options", "tdef": "typedef", - "description": " Basic type of any Git reference. ", - "comments": "", + "description": " Rebase options", + "comments": "

Use to tell the rebase machinery how to operate.

\n", "fields": [ { - "type": "int", - "name": "GIT_REF_INVALID", - "comments": "

Invalid reference

\n", - "value": 0 + "type": "unsigned int", + "name": "version", + "comments": "" }, { "type": "int", - "name": "GIT_REF_OID", - "comments": "

A reference which points at an object id

\n", - "value": 1 + "name": "quiet", + "comments": " Used by `git_rebase_init`, this will instruct other clients working\n on this rebase that you want a quiet rebase experience, which they\n may choose to provide in an application-specific manner. This has no\n effect upon libgit2 directly, but is provided for interoperability\n between Git tools." }, { "type": "int", - "name": "GIT_REF_SYMBOLIC", - "comments": "

A reference which points at another reference

\n", - "value": 2 + "name": "inmemory", + "comments": " Used by `git_rebase_init`, this will begin an in-memory rebase,\n which will allow callers to step through the rebase operations and\n commit the rebased changes, but will not rewind HEAD or update the\n repository to be in a rebasing state. This will not interfere with\n the working directory (if there is one)." }, { - "type": "int", - "name": "GIT_REF_LISTALL", - "comments": "", - "value": 3 + "type": "const char *", + "name": "rewrite_notes_ref", + "comments": " Used by `git_rebase_finish`, this is the name of the notes reference\n used to rewrite notes for rebased commits when finishing the rebase;\n if NULL, the contents of the configuration option `notes.rewriteRef`\n is examined, unless the configuration option `notes.rewrite.rebase`\n is set to false. If `notes.rewriteRef` is also NULL, notes will\n not be rewritten." + }, + { + "type": "git_merge_options", + "name": "merge_options", + "comments": " Options to control how trees are merged during `git_rebase_next`." + }, + { + "type": "git_checkout_options", + "name": "checkout_options", + "comments": " Options to control how files are written during `git_rebase_init`,\n `git_rebase_next` and `git_rebase_abort`. Note that a minimum\n strategy of `GIT_CHECKOUT_SAFE` is defaulted in `init` and `next`,\n and a minimum strategy of `GIT_CHECKOUT_FORCE` is defaulted in\n `abort` to match git semantics." } ], "used": { - "returns": [ - "git_reference_type" - ], - "needs": [] + "returns": [], + "needs": [ + "git_rebase_init", + "git_rebase_open", + "git_rebase_options_init" + ] } } ], @@ -34318,24 +34156,20 @@ "decl": "git_refdb", "type": "struct", "value": "git_refdb", - "file": "types.h", - "line": 96, - "lineto": 96, + "file": "git2/types.h", + "line": 97, + "lineto": 97, "tdef": "typedef", "description": " An open refs database handle. ", "comments": "", "used": { "returns": [], "needs": [ - "git_refdb_backend_fs", "git_refdb_compress", "git_refdb_free", - "git_refdb_init_backend", "git_refdb_new", "git_refdb_open", - "git_refdb_set_backend", - "git_repository_refdb", - "git_repository_set_refdb" + "git_repository_refdb" ] } } @@ -34346,107 +34180,15 @@ "decl": "git_refdb_backend", "type": "struct", "value": "git_refdb_backend", - "file": "types.h", - "line": 99, - "lineto": 99, - "block": "unsigned int version\nint (*)(int *, git_refdb_backend *, const char *) exists\nint (*)(git_reference **, git_refdb_backend *, const char *) lookup\nint (*)(git_reference_iterator **, struct git_refdb_backend *, const char *) iterator\nint (*)(git_refdb_backend *, const git_reference *, int, const git_signature *, const char *, const git_oid *, const char *) write\nint (*)(git_reference **, git_refdb_backend *, const char *, const char *, int, const git_signature *, const char *) rename\nint (*)(git_refdb_backend *, const char *, const git_oid *, const char *) del\nint (*)(git_refdb_backend *) compress\nint (*)(git_refdb_backend *, const char *) has_log\nint (*)(git_refdb_backend *, const char *) ensure_log\nvoid (*)(git_refdb_backend *) free\nint (*)(git_reflog **, git_refdb_backend *, const char *) reflog_read\nint (*)(git_refdb_backend *, git_reflog *) reflog_write\nint (*)(git_refdb_backend *, const char *, const char *) reflog_rename\nint (*)(git_refdb_backend *, const char *) reflog_delete\nint (*)(void **, git_refdb_backend *, const char *) lock\nint (*)(git_refdb_backend *, void *, int, int, const git_reference *, const git_signature *, const char *) unlock", + "file": "git2/types.h", + "line": 100, + "lineto": 100, "tdef": "typedef", "description": " A custom backend for refs ", "comments": "", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, - { - "type": "int (*)(int *, git_refdb_backend *, const char *)", - "name": "exists", - "comments": " Queries the refdb backend to determine if the given ref_name\n exists. A refdb implementation must provide this function." - }, - { - "type": "int (*)(git_reference **, git_refdb_backend *, const char *)", - "name": "lookup", - "comments": " Queries the refdb backend for a given reference. A refdb\n implementation must provide this function." - }, - { - "type": "int (*)(git_reference_iterator **, struct git_refdb_backend *, const char *)", - "name": "iterator", - "comments": " Allocate an iterator object for the backend.\n\n A refdb implementation must provide this function." - }, - { - "type": "int (*)(git_refdb_backend *, const git_reference *, int, const git_signature *, const char *, const git_oid *, const char *)", - "name": "write", - "comments": "" - }, - { - "type": "int (*)(git_reference **, git_refdb_backend *, const char *, const char *, int, const git_signature *, const char *)", - "name": "rename", - "comments": "" - }, - { - "type": "int (*)(git_refdb_backend *, const char *, const git_oid *, const char *)", - "name": "del", - "comments": " Deletes the given reference (and if necessary its reflog)\n from the refdb. A refdb implementation must provide this\n function." - }, - { - "type": "int (*)(git_refdb_backend *)", - "name": "compress", - "comments": " Suggests that the given refdb compress or optimize its references.\n This mechanism is implementation specific. (For on-disk reference\n databases, this may pack all loose references.) A refdb\n implementation may provide this function; if it is not provided,\n nothing will be done." - }, - { - "type": "int (*)(git_refdb_backend *, const char *)", - "name": "has_log", - "comments": " Query whether a particular reference has a log (may be empty)" - }, - { - "type": "int (*)(git_refdb_backend *, const char *)", - "name": "ensure_log", - "comments": " Make sure a particular reference will have a reflog which\n will be appended to on writes." - }, - { - "type": "void (*)(git_refdb_backend *)", - "name": "free", - "comments": " Frees any resources held by the refdb (including the `git_refdb_backend`\n itself). A refdb backend implementation must provide this function." - }, - { - "type": "int (*)(git_reflog **, git_refdb_backend *, const char *)", - "name": "reflog_read", - "comments": " Read the reflog for the given reference name." - }, - { - "type": "int (*)(git_refdb_backend *, git_reflog *)", - "name": "reflog_write", - "comments": " Write a reflog to disk." - }, - { - "type": "int (*)(git_refdb_backend *, const char *, const char *)", - "name": "reflog_rename", - "comments": " Rename a reflog" - }, - { - "type": "int (*)(git_refdb_backend *, const char *)", - "name": "reflog_delete", - "comments": " Remove a reflog." - }, - { - "type": "int (*)(void **, git_refdb_backend *, const char *)", - "name": "lock", - "comments": " Lock a reference. The opaque parameter will be passed to the unlock function" - }, - { - "type": "int (*)(git_refdb_backend *, void *, int, int, const git_reference *, const git_signature *, const char *)", - "name": "unlock", - "comments": " Unlock a reference. Only one of target or symbolic_target\n will be set. success indicates whether to update the\n reference or discard the lock (if it's false)" - } - ], "used": { "returns": [], - "needs": [ - "git_refdb_backend_fs", - "git_refdb_init_backend", - "git_refdb_set_backend" - ] + "needs": [] } } ], @@ -34456,16 +34198,15 @@ "decl": "git_reference", "type": "struct", "value": "git_reference", - "file": "types.h", - "line": 173, - "lineto": 173, + "file": "git2/types.h", + "line": 177, + "lineto": 177, "tdef": "typedef", "description": " In-memory representation of a reference. ", "comments": "", "used": { "returns": [ - "git_reference__alloc", - "git_reference__alloc_symbolic" + "git_reference_type" ], "needs": [ "git_annotated_commit_from_ref", @@ -34480,6 +34221,7 @@ "git_branch_next", "git_branch_set_upstream", "git_branch_upstream", + "git_merge_analysis_for_ref", "git_reference_cmp", "git_reference_create", "git_reference_create_matching", @@ -34487,6 +34229,7 @@ "git_reference_dup", "git_reference_dwim", "git_reference_foreach", + "git_reference_foreach_cb", "git_reference_foreach_glob", "git_reference_foreach_name", "git_reference_free", @@ -34522,40 +34265,66 @@ } ], [ - "git_reference_iterator", + "git_reference_format_t", { - "decl": "git_reference_iterator", - "type": "struct", - "value": "git_reference_iterator", - "file": "types.h", - "line": 176, - "lineto": 176, - "block": "git_refdb * db\nint (*)(git_reference **, git_reference_iterator *) next\nint (*)(const char **, git_reference_iterator *) next_name\nvoid (*)(git_reference_iterator *) free", + "decl": [ + "GIT_REFERENCE_FORMAT_NORMAL", + "GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL", + "GIT_REFERENCE_FORMAT_REFSPEC_PATTERN", + "GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND" + ], + "type": "enum", + "file": "git2/refs.h", + "line": 658, + "lineto": 687, + "block": "GIT_REFERENCE_FORMAT_NORMAL\nGIT_REFERENCE_FORMAT_ALLOW_ONELEVEL\nGIT_REFERENCE_FORMAT_REFSPEC_PATTERN\nGIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND", "tdef": "typedef", - "description": " Iterator for references ", + "description": " Normalization options for reference lookup", "comments": "", "fields": [ { - "type": "git_refdb *", - "name": "db", - "comments": "" + "type": "int", + "name": "GIT_REFERENCE_FORMAT_NORMAL", + "comments": "

No particular normalization.

\n", + "value": 0 }, { - "type": "int (*)(git_reference **, git_reference_iterator *)", - "name": "next", - "comments": " Return the current reference and advance the iterator." + "type": "int", + "name": "GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL", + "comments": "

Control whether one-level refnames are accepted\n (i.e., refnames that do not contain multiple /-separated\n components). Those are expected to be written only using\n uppercase letters and underscore (FETCH_HEAD, ...)

\n", + "value": 1 }, { - "type": "int (*)(const char **, git_reference_iterator *)", - "name": "next_name", - "comments": " Return the name of the current reference and advance the iterator" + "type": "int", + "name": "GIT_REFERENCE_FORMAT_REFSPEC_PATTERN", + "comments": "

Interpret the provided name as a reference pattern for a\n refspec (as used with remote repositories). If this option\n is enabled, the name is allowed to contain a single * (\n<star

\n\n
\n

)\n in place of a one full pathname component\n (e.g., foo/\n<star\n/bar but not foo/bar\n<star\n).

\n
\n", + "value": 2 }, { - "type": "void (*)(git_reference_iterator *)", - "name": "free", - "comments": " Free the iterator" + "type": "int", + "name": "GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND", + "comments": "

Interpret the name as part of a refspec in shorthand form\n so the ONELEVEL naming rules aren't enforced and 'master'\n becomes a valid name.

\n", + "value": 4 } ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_reference_iterator", + { + "decl": "git_reference_iterator", + "type": "struct", + "value": "git_reference_iterator", + "file": "git2/types.h", + "line": 180, + "lineto": 180, + "tdef": "typedef", + "description": " Iterator for references ", + "comments": "", "used": { "returns": [], "needs": [ @@ -34569,50 +34338,52 @@ } ], [ - "git_reference_normalize_t", + "git_reference_t", { "decl": [ - "GIT_REF_FORMAT_NORMAL", - "GIT_REF_FORMAT_ALLOW_ONELEVEL", - "GIT_REF_FORMAT_REFSPEC_PATTERN", - "GIT_REF_FORMAT_REFSPEC_SHORTHAND" + "GIT_REFERENCE_INVALID", + "GIT_REFERENCE_DIRECT", + "GIT_REFERENCE_SYMBOLIC", + "GIT_REFERENCE_ALL" ], "type": "enum", - "file": "refs.h", - "line": 639, - "lineto": 668, - "block": "GIT_REF_FORMAT_NORMAL\nGIT_REF_FORMAT_ALLOW_ONELEVEL\nGIT_REF_FORMAT_REFSPEC_PATTERN\nGIT_REF_FORMAT_REFSPEC_SHORTHAND", + "file": "git2/types.h", + "line": 195, + "lineto": 200, + "block": "GIT_REFERENCE_INVALID\nGIT_REFERENCE_DIRECT\nGIT_REFERENCE_SYMBOLIC\nGIT_REFERENCE_ALL", "tdef": "typedef", - "description": " Normalization options for reference lookup", + "description": " Basic type of any Git reference. ", "comments": "", "fields": [ { "type": "int", - "name": "GIT_REF_FORMAT_NORMAL", - "comments": "

No particular normalization.

\n", + "name": "GIT_REFERENCE_INVALID", + "comments": "

Invalid reference

\n", "value": 0 }, { "type": "int", - "name": "GIT_REF_FORMAT_ALLOW_ONELEVEL", - "comments": "

Control whether one-level refnames are accepted\n (i.e., refnames that do not contain multiple /-separated\n components). Those are expected to be written only using\n uppercase letters and underscore (FETCH_HEAD, ...)

\n", + "name": "GIT_REFERENCE_DIRECT", + "comments": "

A reference that points at an object id

\n", "value": 1 }, { "type": "int", - "name": "GIT_REF_FORMAT_REFSPEC_PATTERN", - "comments": "

Interpret the provided name as a reference pattern for a\n refspec (as used with remote repositories). If this option\n is enabled, the name is allowed to contain a single * (\n<star

\n\n
\n

)\n in place of a one full pathname component\n (e.g., foo/\n<star\n/bar but not foo/bar\n<star\n).

\n
\n", + "name": "GIT_REFERENCE_SYMBOLIC", + "comments": "

A reference that points at another reference

\n", "value": 2 }, { "type": "int", - "name": "GIT_REF_FORMAT_REFSPEC_SHORTHAND", - "comments": "

Interpret the name as part of a refspec in shorthand form\n so the ONELEVEL naming rules aren't enforced and 'master'\n becomes a valid name.

\n", - "value": 4 + "name": "GIT_REFERENCE_ALL", + "comments": "", + "value": 3 } ], "used": { - "returns": [], + "returns": [ + "git_reference_type" + ], "needs": [] } } @@ -34623,9 +34394,9 @@ "decl": "git_reflog", "type": "struct", "value": "git_reflog", - "file": "types.h", - "line": 150, - "lineto": 150, + "file": "git2/types.h", + "line": 154, + "lineto": 154, "tdef": "typedef", "description": " Representation of a reference log ", "comments": "", @@ -34644,7 +34415,8 @@ "git_reflog_entrycount", "git_reflog_free", "git_reflog_read", - "git_reflog_write" + "git_reflog_write", + "git_transaction_set_reflog" ] } } @@ -34655,9 +34427,9 @@ "decl": "git_reflog_entry", "type": "struct", "value": "git_reflog_entry", - "file": "types.h", - "line": 147, - "lineto": 147, + "file": "git2/types.h", + "line": 151, + "lineto": 151, "tdef": "typedef", "description": " Representation of a reference log entry ", "comments": "", @@ -34674,15 +34446,47 @@ } } ], + [ + "git_refspec", + { + "decl": "git_refspec", + "type": "struct", + "value": "git_refspec", + "file": "git2/types.h", + "line": 223, + "lineto": 223, + "tdef": "typedef", + "description": " A refspec specifies the mapping between remote and local reference\n names when fetch or pushing.", + "comments": "", + "used": { + "returns": [ + "git_remote_get_refspec" + ], + "needs": [ + "git_refspec_direction", + "git_refspec_dst", + "git_refspec_dst_matches", + "git_refspec_force", + "git_refspec_free", + "git_refspec_parse", + "git_refspec_rtransform", + "git_refspec_src", + "git_refspec_src_matches", + "git_refspec_string", + "git_refspec_transform" + ] + } + } + ], [ "git_remote", { "decl": "git_remote", "type": "struct", "value": "git_remote", - "file": "types.h", - "line": 228, - "lineto": 228, + "file": "git2/types.h", + "line": 229, + "lineto": 229, "tdef": "typedef", "description": " Git's idea of a remote repository. A remote can be anonymous (in\n which case it does not have backing configuration entires).", "comments": "", @@ -34699,7 +34503,9 @@ "git_remote_create_anonymous", "git_remote_create_cb", "git_remote_create_detached", + "git_remote_create_options_init", "git_remote_create_with_fetchspec", + "git_remote_create_with_opts", "git_remote_default_branch", "git_remote_disconnect", "git_remote_download", @@ -34725,12 +34531,7 @@ "git_remote_update_tips", "git_remote_upload", "git_remote_url", - "git_transport_cb", - "git_transport_dummy", - "git_transport_local", - "git_transport_new", - "git_transport_smart", - "git_transport_ssh_with_paths" + "git_transport_cb" ] } } @@ -34745,9 +34546,9 @@ "GIT_REMOTE_DOWNLOAD_TAGS_ALL" ], "type": "enum", - "file": "remote.h", - "line": 527, - "lineto": 545, + "file": "git2/remote.h", + "line": 624, + "lineto": 642, "block": "GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED\nGIT_REMOTE_DOWNLOAD_TAGS_AUTO\nGIT_REMOTE_DOWNLOAD_TAGS_NONE\nGIT_REMOTE_DOWNLOAD_TAGS_ALL", "tdef": "typedef", "description": " Automatic tag following option", @@ -34795,24 +34596,25 @@ "decl": [ "unsigned int version", "git_transport_message_cb sideband_progress", - "int (*)(git_remote_completion_type, void *) completion", + "int (*)(git_remote_completion_t, void *) completion", "git_cred_acquire_cb credentials", "git_transport_certificate_check_cb certificate_check", - "git_transfer_progress_cb transfer_progress", + "git_indexer_progress_cb transfer_progress", "int (*)(const char *, const git_oid *, const git_oid *, void *) update_tips", "git_packbuilder_progress pack_progress", - "git_push_transfer_progress push_transfer_progress", + "git_push_transfer_progress_cb push_transfer_progress", "git_push_update_reference_cb push_update_reference", "git_push_negotiation push_negotiation", "git_transport_cb transport", - "void * payload" + "void * payload", + "git_url_resolve_cb resolve_url" ], "type": "struct", "value": "git_remote_callbacks", - "file": "remote.h", - "line": 408, - "lineto": 490, - "block": "unsigned int version\ngit_transport_message_cb sideband_progress\nint (*)(git_remote_completion_type, void *) completion\ngit_cred_acquire_cb credentials\ngit_transport_certificate_check_cb certificate_check\ngit_transfer_progress_cb transfer_progress\nint (*)(const char *, const git_oid *, const git_oid *, void *) update_tips\ngit_packbuilder_progress pack_progress\ngit_push_transfer_progress push_transfer_progress\ngit_push_update_reference_cb push_update_reference\ngit_push_negotiation push_negotiation\ngit_transport_cb transport\nvoid * payload", + "file": "git2/remote.h", + "line": 497, + "lineto": 586, + "block": "unsigned int version\ngit_transport_message_cb sideband_progress\nint (*)(git_remote_completion_t, void *) completion\ngit_cred_acquire_cb credentials\ngit_transport_certificate_check_cb certificate_check\ngit_indexer_progress_cb transfer_progress\nint (*)(const char *, const git_oid *, const git_oid *, void *) update_tips\ngit_packbuilder_progress pack_progress\ngit_push_transfer_progress_cb push_transfer_progress\ngit_push_update_reference_cb push_update_reference\ngit_push_negotiation push_negotiation\ngit_transport_cb transport\nvoid * payload\ngit_url_resolve_cb resolve_url", "tdef": null, "description": " The callback settings structure", "comments": "

Set the callbacks to be called by the remote when informing the user about the progress of the network operations.

\n", @@ -34820,7 +34622,7 @@ { "type": "unsigned int", "name": "version", - "comments": "" + "comments": " The version " }, { "type": "git_transport_message_cb", @@ -34828,9 +34630,9 @@ "comments": " Textual progress from the remote. Text send over the\n progress side-band will be passed to this function (this is\n the 'counting objects' output)." }, { - "type": "int (*)(git_remote_completion_type, void *)", + "type": "int (*)(git_remote_completion_t, void *)", "name": "completion", - "comments": " Completion is called when different parts of the download\n process are done (currently unused)." + "comments": "" }, { "type": "git_cred_acquire_cb", @@ -34840,17 +34642,17 @@ { "type": "git_transport_certificate_check_cb", "name": "certificate_check", - "comments": " If cert verification fails, this will be called to let the\n user make the final decision of whether to allow the\n connection to proceed. Returns 1 to allow the connection, 0\n to disallow it or a negative value to indicate an error." + "comments": " If cert verification fails, this will be called to let the\n user make the final decision of whether to allow the\n connection to proceed. Returns 0 to allow the connection\n or a negative value to indicate an error." }, { - "type": "git_transfer_progress_cb", + "type": "git_indexer_progress_cb", "name": "transfer_progress", "comments": " During the download of new data, this will be regularly\n called with the current count of progress done by the\n indexer." }, { "type": "int (*)(const char *, const git_oid *, const git_oid *, void *)", "name": "update_tips", - "comments": " Each time a reference is updated locally, this function\n will be called with information about it." + "comments": "" }, { "type": "git_packbuilder_progress", @@ -34858,7 +34660,7 @@ "comments": " Function to call with progress information during pack\n building. Be aware that this is called inline with pack\n building operations, so performance may be affected." }, { - "type": "git_push_transfer_progress", + "type": "git_push_transfer_progress_cb", "name": "push_transfer_progress", "comments": " Function to call with progress information during the\n upload portion of a push. Be aware that this is called\n inline with pack building operations, so performance may be\n affected." }, @@ -34881,6 +34683,11 @@ "type": "void *", "name": "payload", "comments": " This will be passed to each of the callbacks in this struct\n as the last parameter." + }, + { + "type": "git_url_resolve_cb", + "name": "resolve_url", + "comments": " Resolve URL before connecting to remote.\n The returned URL will be used to connect to the remote instead." } ], "used": { @@ -34895,7 +34702,7 @@ } ], [ - "git_remote_completion_type", + "git_remote_completion_t", { "decl": [ "GIT_REMOTE_COMPLETION_DOWNLOAD", @@ -34903,9 +34710,9 @@ "GIT_REMOTE_COMPLETION_ERROR" ], "type": "enum", - "file": "remote.h", - "line": 344, - "lineto": 348, + "file": "git2/remote.h", + "line": 418, + "lineto": 422, "block": "GIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR\nGIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR", "tdef": "typedef", "description": " Argument to the completion callback which tells it which operation\n finished.", @@ -34936,6 +34743,96 @@ } } ], + [ + "git_remote_create_flags", + { + "decl": [ + "GIT_REMOTE_CREATE_SKIP_INSTEADOF", + "GIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC" + ], + "type": "enum", + "file": "git2/remote.h", + "line": 47, + "lineto": 53, + "block": "GIT_REMOTE_CREATE_SKIP_INSTEADOF\nGIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC", + "tdef": "typedef", + "description": " Remote creation options flags", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REMOTE_CREATE_SKIP_INSTEADOF", + "comments": "

Ignore the repository apply.insteadOf configuration

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC", + "comments": "

Don't build a fetchspec from the name if none is set

\n", + "value": 2 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_remote_create_options", + { + "decl": [ + "unsigned int version", + "git_repository * repository", + "const char * name", + "const char * fetchspec", + "unsigned int flags" + ], + "type": "struct", + "value": "git_remote_create_options", + "file": "git2/remote.h", + "line": 62, + "lineto": 82, + "block": "unsigned int version\ngit_repository * repository\nconst char * name\nconst char * fetchspec\nunsigned int flags", + "tdef": "typedef", + "description": " Remote creation options structure", + "comments": "

Initialize with GIT_REMOTE_CREATE_OPTIONS_INIT. Alternatively, you can use git_remote_create_options_init.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "git_repository *", + "name": "repository", + "comments": " The repository that should own the remote.\n Setting this to NULL results in a detached remote." + }, + { + "type": "const char *", + "name": "name", + "comments": " The remote's name.\n Setting this to NULL results in an in-memory/anonymous remote." + }, + { + "type": "const char *", + "name": "fetchspec", + "comments": " The fetchspec the remote should use. " + }, + { + "type": "unsigned int", + "name": "flags", + "comments": " Additional flags for the remote. See git_remote_create_flags. " + } + ], + "used": { + "returns": [], + "needs": [ + "git_remote_create_options_init", + "git_remote_create_with_opts" + ] + } + } + ], [ "git_remote_head", { @@ -34948,7 +34845,7 @@ ], "type": "struct", "value": "git_remote_head", - "file": "net.h", + "file": "git2/net.h", "line": 40, "lineto": 50, "block": "int local\ngit_oid oid\ngit_oid loid\nchar * name\nchar * symref_target", @@ -34997,9 +34894,9 @@ "decl": "git_repository", "type": "struct", "value": "git_repository", - "file": "types.h", - "line": 105, - "lineto": 105, + "file": "git2/types.h", + "line": 106, + "lineto": 106, "tdef": "typedef", "description": " Representation of an existing git repository,\n including all its object contents", "comments": "", @@ -35007,7 +34904,6 @@ "returns": [ "git_blob_owner", "git_commit_owner", - "git_filter_source_repo", "git_index_owner", "git_object_owner", "git_reference_owner", @@ -35022,15 +34918,18 @@ "git_annotated_commit_from_ref", "git_annotated_commit_from_revspec", "git_annotated_commit_lookup", + "git_apply", + "git_apply_to_tree", "git_attr_add_macro", "git_attr_cache_flush", "git_attr_foreach", "git_attr_get", "git_attr_get_many", "git_blame_file", - "git_blob_create_frombuffer", - "git_blob_create_fromdisk", - "git_blob_create_fromstream", + "git_blob_create_from_buffer", + "git_blob_create_from_disk", + "git_blob_create_from_stream", + "git_blob_create_from_workdir", "git_blob_create_fromworkdir", "git_blob_lookup", "git_blob_lookup_prefix", @@ -35038,6 +34937,9 @@ "git_branch_create_from_annotated", "git_branch_iterator_new", "git_branch_lookup", + "git_branch_remote_name", + "git_branch_upstream_name", + "git_branch_upstream_remote", "git_checkout_head", "git_checkout_index", "git_checkout_tree", @@ -35046,14 +34948,11 @@ "git_clone", "git_commit_create", "git_commit_create_buffer", - "git_commit_create_from_callback", - "git_commit_create_from_ids", "git_commit_create_v", "git_commit_create_with_signature", "git_commit_extract_signature", "git_commit_lookup", "git_commit_lookup_prefix", - "git_config_add_backend", "git_config_add_file_ondisk", "git_describe_workdir", "git_diff_commit_as_email", @@ -35065,7 +34964,6 @@ "git_diff_tree_to_workdir_with_index", "git_filter_list_apply_to_file", "git_filter_list_load", - "git_filter_list_new", "git_filter_list_stream_file", "git_graph_ahead_behind", "git_graph_descendant_of", @@ -35073,9 +34971,10 @@ "git_ignore_clear_internal_rules", "git_ignore_path_is_ignored", "git_index_write_tree_to", - "git_mempack_dump", + "git_mailmap_from_repository", "git_merge", "git_merge_analysis", + "git_merge_analysis_for_ref", "git_merge_base", "git_merge_base_many", "git_merge_base_octopus", @@ -35088,6 +34987,7 @@ "git_note_commit_read", "git_note_commit_remove", "git_note_create", + "git_note_default_ref", "git_note_foreach", "git_note_iterator_new", "git_note_read", @@ -35098,7 +34998,6 @@ "git_pathspec_match_workdir", "git_rebase_init", "git_rebase_open", - "git_refdb_backend_fs", "git_refdb_new", "git_refdb_open", "git_reference_create", @@ -35133,7 +35032,6 @@ "git_remote_set_autotag", "git_remote_set_pushurl", "git_remote_set_url", - "git_repository__cleanup", "git_repository_commondir", "git_repository_config", "git_repository_config_snapshot", @@ -35145,13 +35043,14 @@ "git_repository_hashfile", "git_repository_head", "git_repository_head_detached", + "git_repository_head_detached_for_worktree", "git_repository_head_for_worktree", "git_repository_head_unborn", "git_repository_ident", "git_repository_index", "git_repository_init", "git_repository_init_ext", - "git_repository_init_init_options", + "git_repository_init_options_init", "git_repository_is_bare", "git_repository_is_empty", "git_repository_is_shallow", @@ -35160,7 +35059,6 @@ "git_repository_mergehead_foreach", "git_repository_message", "git_repository_message_remove", - "git_repository_new", "git_repository_odb", "git_repository_open", "git_repository_open_bare", @@ -35168,22 +35066,14 @@ "git_repository_open_from_worktree", "git_repository_path", "git_repository_refdb", - "git_repository_reinit_filesystem", - "git_repository_set_bare", - "git_repository_set_config", "git_repository_set_head", "git_repository_set_head_detached", "git_repository_set_head_detached_from_annotated", "git_repository_set_ident", - "git_repository_set_index", "git_repository_set_namespace", - "git_repository_set_odb", - "git_repository_set_refdb", "git_repository_set_workdir", "git_repository_state", "git_repository_state_cleanup", - "git_repository_submodule_cache_all", - "git_repository_submodule_cache_clear", "git_repository_workdir", "git_repository_wrap_odb", "git_reset", @@ -35200,6 +35090,7 @@ "git_stash_drop", "git_stash_foreach", "git_stash_pop", + "git_stash_save", "git_status_file", "git_status_foreach", "git_status_foreach_ext", @@ -35219,7 +35110,7 @@ "git_submodule_status", "git_tag_annotation_create", "git_tag_create", - "git_tag_create_frombuffer", + "git_tag_create_from_buffer", "git_tag_create_lightweight", "git_tag_delete", "git_tag_foreach", @@ -35227,6 +35118,7 @@ "git_tag_list_match", "git_tag_lookup", "git_tag_lookup_prefix", + "git_transaction_new", "git_tree_create_updated", "git_tree_entry_to_object", "git_tree_lookup", @@ -35253,9 +35145,9 @@ "GIT_REPOSITORY_INIT_RELATIVE_GITLINK" ], "type": "enum", - "file": "repository.h", - "line": 232, - "lineto": 240, + "file": "git2/repository.h", + "line": 245, + "lineto": 253, "block": "GIT_REPOSITORY_INIT_BARE\nGIT_REPOSITORY_INIT_NO_REINIT\nGIT_REPOSITORY_INIT_NO_DOTGIT_DIR\nGIT_REPOSITORY_INIT_MKDIR\nGIT_REPOSITORY_INIT_MKPATH\nGIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE\nGIT_REPOSITORY_INIT_RELATIVE_GITLINK", "tdef": "typedef", "description": " Option flags for `git_repository_init_ext`.", @@ -35319,9 +35211,9 @@ "GIT_REPOSITORY_INIT_SHARED_ALL" ], "type": "enum", - "file": "repository.h", - "line": 255, - "lineto": 259, + "file": "git2/repository.h", + "line": 268, + "lineto": 272, "block": "GIT_REPOSITORY_INIT_SHARED_UMASK\nGIT_REPOSITORY_INIT_SHARED_GROUP\nGIT_REPOSITORY_INIT_SHARED_ALL", "tdef": "typedef", "description": " Mode options for `git_repository_init_ext`.", @@ -35367,9 +35259,9 @@ ], "type": "struct", "value": "git_repository_init_options", - "file": "repository.h", - "line": 289, - "lineto": 298, + "file": "git2/repository.h", + "line": 302, + "lineto": 311, "block": "unsigned int version\nuint32_t flags\nuint32_t mode\nconst char * workdir_path\nconst char * description\nconst char * template_path\nconst char * initial_head\nconst char * origin_url", "tdef": "typedef", "description": " Extended options structure for `git_repository_init_ext`.", @@ -35420,7 +35312,7 @@ "returns": [], "needs": [ "git_repository_init_ext", - "git_repository_init_init_options" + "git_repository_init_options_init" ] } } @@ -35442,13 +35334,14 @@ "GIT_REPOSITORY_ITEM_HOOKS", "GIT_REPOSITORY_ITEM_LOGS", "GIT_REPOSITORY_ITEM_MODULES", - "GIT_REPOSITORY_ITEM_WORKTREES" + "GIT_REPOSITORY_ITEM_WORKTREES", + "GIT_REPOSITORY_ITEM__LAST" ], "type": "enum", - "file": "repository.h", - "line": 412, - "lineto": 427, - "block": "GIT_REPOSITORY_ITEM_GITDIR\nGIT_REPOSITORY_ITEM_WORKDIR\nGIT_REPOSITORY_ITEM_COMMONDIR\nGIT_REPOSITORY_ITEM_INDEX\nGIT_REPOSITORY_ITEM_OBJECTS\nGIT_REPOSITORY_ITEM_REFS\nGIT_REPOSITORY_ITEM_PACKED_REFS\nGIT_REPOSITORY_ITEM_REMOTES\nGIT_REPOSITORY_ITEM_CONFIG\nGIT_REPOSITORY_ITEM_INFO\nGIT_REPOSITORY_ITEM_HOOKS\nGIT_REPOSITORY_ITEM_LOGS\nGIT_REPOSITORY_ITEM_MODULES\nGIT_REPOSITORY_ITEM_WORKTREES", + "file": "git2/repository.h", + "line": 427, + "lineto": 443, + "block": "GIT_REPOSITORY_ITEM_GITDIR\nGIT_REPOSITORY_ITEM_WORKDIR\nGIT_REPOSITORY_ITEM_COMMONDIR\nGIT_REPOSITORY_ITEM_INDEX\nGIT_REPOSITORY_ITEM_OBJECTS\nGIT_REPOSITORY_ITEM_REFS\nGIT_REPOSITORY_ITEM_PACKED_REFS\nGIT_REPOSITORY_ITEM_REMOTES\nGIT_REPOSITORY_ITEM_CONFIG\nGIT_REPOSITORY_ITEM_INFO\nGIT_REPOSITORY_ITEM_HOOKS\nGIT_REPOSITORY_ITEM_LOGS\nGIT_REPOSITORY_ITEM_MODULES\nGIT_REPOSITORY_ITEM_WORKTREES\nGIT_REPOSITORY_ITEM__LAST", "tdef": "typedef", "description": " List of items which belong to the git repository layout", "comments": "", @@ -35536,6 +35429,12 @@ "name": "GIT_REPOSITORY_ITEM_WORKTREES", "comments": "", "value": 13 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM__LAST", + "comments": "", + "value": 14 } ], "used": { @@ -35557,42 +35456,42 @@ "GIT_REPOSITORY_OPEN_FROM_ENV" ], "type": "enum", - "file": "repository.h", - "line": 126, - "lineto": 132, + "file": "git2/repository.h", + "line": 98, + "lineto": 145, "block": "GIT_REPOSITORY_OPEN_NO_SEARCH\nGIT_REPOSITORY_OPEN_CROSS_FS\nGIT_REPOSITORY_OPEN_BARE\nGIT_REPOSITORY_OPEN_NO_DOTGIT\nGIT_REPOSITORY_OPEN_FROM_ENV", "tdef": "typedef", "description": " Option flags for `git_repository_open_ext`.", - "comments": "\n", + "comments": "", "fields": [ { "type": "int", "name": "GIT_REPOSITORY_OPEN_NO_SEARCH", - "comments": "", + "comments": "

Only open the repository if it can be immediately found in the\n start_path. Do not walk up from the start_path looking at parent\n directories.

\n", "value": 1 }, { "type": "int", "name": "GIT_REPOSITORY_OPEN_CROSS_FS", - "comments": "", + "comments": "

Unless this flag is set, open will not continue searching across\n filesystem boundaries (i.e. when st_dev changes from the stat\n system call). For example, searching in a user's home directory at\n "/home/user/source/" will not return "/.git/" as the found repo if\n "/" is a different filesystem than "/home".

\n", "value": 2 }, { "type": "int", "name": "GIT_REPOSITORY_OPEN_BARE", - "comments": "", + "comments": "

Open repository as a bare repo regardless of core.bare config, and\n defer loading config file for faster setup.\n Unlike git_repository_open_bare, this can follow gitlinks.

\n", "value": 4 }, { "type": "int", "name": "GIT_REPOSITORY_OPEN_NO_DOTGIT", - "comments": "", + "comments": "

Do not check for a repository by appending /.git to the start_path;\n only open the repository if start_path itself points to the git\n directory.

\n", "value": 8 }, { "type": "int", "name": "GIT_REPOSITORY_OPEN_FROM_ENV", - "comments": "", + "comments": "

Find and open a git repository, respecting the environment variables\n used by the git command-line tools.\n If set, git_repository_open_ext will ignore the other flags and\n the ceiling_dirs argument, and will allow a NULL path to use\n GIT_DIR or search from the current directory.\n The search for a repository will respect $GIT_CEILING_DIRECTORIES and\n $GIT_DISCOVERY_ACROSS_FILESYSTEM. The opened repository will\n respect $GIT_INDEX_FILE, $GIT_NAMESPACE, $GIT_OBJECT_DIRECTORY, and\n $GIT_ALTERNATE_OBJECT_DIRECTORIES.\n In the future, this flag will also cause git_repository_open_ext\n to respect $GIT_WORK_TREE and $GIT_COMMON_DIR; currently,\n git_repository_open_ext with this flag will error out if either\n $GIT_WORK_TREE or $GIT_COMMON_DIR is set.

\n", "value": 16 } ], @@ -35620,9 +35519,9 @@ "GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE" ], "type": "enum", - "file": "repository.h", - "line": 784, - "lineto": 797, + "file": "git2/repository.h", + "line": 821, + "lineto": 834, "block": "GIT_REPOSITORY_STATE_NONE\nGIT_REPOSITORY_STATE_MERGE\nGIT_REPOSITORY_STATE_REVERT\nGIT_REPOSITORY_STATE_REVERT_SEQUENCE\nGIT_REPOSITORY_STATE_CHERRYPICK\nGIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE\nGIT_REPOSITORY_STATE_BISECT\nGIT_REPOSITORY_STATE_REBASE\nGIT_REPOSITORY_STATE_REBASE_INTERACTIVE\nGIT_REPOSITORY_STATE_REBASE_MERGE\nGIT_REPOSITORY_STATE_APPLY_MAILBOX\nGIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE", "tdef": "typedef", "description": " Repository state", @@ -35716,7 +35615,7 @@ "GIT_RESET_HARD" ], "type": "enum", - "file": "reset.h", + "file": "git2/reset.h", "line": 26, "lineto": 30, "block": "GIT_RESET_SOFT\nGIT_RESET_MIXED\nGIT_RESET_HARD", @@ -35763,7 +35662,7 @@ ], "type": "struct", "value": "git_revert_options", - "file": "revert.h", + "file": "git2/revert.h", "line": 26, "lineto": 34, "block": "unsigned int version\nunsigned int mainline\ngit_merge_options merge_opts\ngit_checkout_options checkout_opts", @@ -35796,7 +35695,7 @@ "returns": [], "needs": [ "git_revert", - "git_revert_init_options" + "git_revert_options_init" ] } } @@ -35810,7 +35709,7 @@ "GIT_REVPARSE_MERGE_BASE" ], "type": "enum", - "file": "revparse.h", + "file": "git2/revparse.h", "line": 71, "lineto": 78, "block": "GIT_REVPARSE_SINGLE\nGIT_REVPARSE_RANGE\nGIT_REVPARSE_MERGE_BASE", @@ -35853,7 +35752,7 @@ ], "type": "struct", "value": "git_revspec", - "file": "revparse.h", + "file": "git2/revparse.h", "line": 83, "lineto": 90, "block": "git_object * from\ngit_object * to\nunsigned int flags", @@ -35891,9 +35790,9 @@ "decl": "git_revwalk", "type": "struct", "value": "git_revwalk", - "file": "types.h", - "line": 114, - "lineto": 114, + "file": "git2/types.h", + "line": 115, + "lineto": 115, "tdef": "typedef", "description": " Representation of an in-progress walk through the commits in a repo ", "comments": "", @@ -35932,9 +35831,9 @@ ], "type": "struct", "value": "git_signature", - "file": "types.h", - "line": 166, - "lineto": 170, + "file": "git2/types.h", + "line": 170, + "lineto": 174, "block": "char * name\nchar * email\ngit_time when", "tdef": "typedef", "description": " An action signature (e.g. for committers, taggers, etc) ", @@ -35967,11 +35866,12 @@ ], "needs": [ "git_commit_amend", + "git_commit_author_with_mailmap", + "git_commit_committer_with_mailmap", "git_commit_create", "git_commit_create_buffer", - "git_commit_create_from_callback", - "git_commit_create_from_ids", "git_commit_create_v", + "git_mailmap_resolve_signature", "git_note_commit_create", "git_note_commit_remove", "git_note_create", @@ -35985,44 +35885,56 @@ "git_signature_from_buffer", "git_signature_new", "git_signature_now", + "git_stash_save", "git_tag_annotation_create", - "git_tag_create" + "git_tag_create", + "git_transaction_set_symbolic_target", + "git_transaction_set_target" ] } } ], [ - "git_smart_subtransport_definition", + "git_smart_service_t", { "decl": [ - "git_smart_subtransport_cb callback", - "unsigned int rpc", - "void * param" + "GIT_SERVICE_UPLOADPACK_LS", + "GIT_SERVICE_UPLOADPACK", + "GIT_SERVICE_RECEIVEPACK_LS", + "GIT_SERVICE_RECEIVEPACK" ], - "type": "struct", - "value": "git_smart_subtransport_definition", - "file": "sys/transport.h", - "line": 336, - "lineto": 349, - "block": "git_smart_subtransport_cb callback\nunsigned int rpc\nvoid * param", + "type": "enum", + "file": "git2/sys/transport.h", + "line": 287, + "lineto": 292, + "block": "GIT_SERVICE_UPLOADPACK_LS\nGIT_SERVICE_UPLOADPACK\nGIT_SERVICE_RECEIVEPACK_LS\nGIT_SERVICE_RECEIVEPACK", "tdef": "typedef", - "description": " Definition for a \"subtransport\"", - "comments": "

This is used to let the smart protocol code know about the protocol which you are implementing.

\n", + "description": " Actions that the smart transport can ask a subtransport to perform ", + "comments": "", "fields": [ { - "type": "git_smart_subtransport_cb", - "name": "callback", - "comments": " The function to use to create the git_smart_subtransport " + "type": "int", + "name": "GIT_SERVICE_UPLOADPACK_LS", + "comments": "", + "value": 1 }, { - "type": "unsigned int", - "name": "rpc", - "comments": " True if the protocol is stateless; false otherwise. For example,\n http:// is stateless, but git:// is not." + "type": "int", + "name": "GIT_SERVICE_UPLOADPACK", + "comments": "", + "value": 2 }, { - "type": "void *", - "name": "param", - "comments": " Param of the callback" + "type": "int", + "name": "GIT_SERVICE_RECEIVEPACK_LS", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GIT_SERVICE_RECEIVEPACK", + "comments": "", + "value": 4 } ], "used": { @@ -36041,7 +35953,7 @@ "GIT_SORT_REVERSE" ], "type": "enum", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 26, "lineto": 53, "block": "GIT_SORT_NONE\nGIT_SORT_TOPOLOGICAL\nGIT_SORT_TIME\nGIT_SORT_REVERSE", @@ -36052,13 +35964,13 @@ { "type": "int", "name": "GIT_SORT_NONE", - "comments": "

Sort the output with the same default time-order method from git.\n This is the default sorting for new walkers.

\n", + "comments": "

Sort the output with the same default method from git: reverse\n chronological order. This is the default sorting for new walkers.

\n", "value": 0 }, { "type": "int", "name": "GIT_SORT_TOPOLOGICAL", - "comments": "

Sort the repository contents in topological order (parents before\n children); this sorting mode can be combined with time sorting to\n produce git's "time-order".

\n", + "comments": "

Sort the repository contents in topological order (no parents before\n all of its children are shown); this sorting mode can be combined\n with time sorting to produce git's --date-order`.

\n", "value": 1 }, { @@ -36088,9 +36000,9 @@ "GIT_STASH_APPLY_REINSTATE_INDEX" ], "type": "enum", - "file": "stash.h", - "line": 74, - "lineto": 81, + "file": "git2/stash.h", + "line": 75, + "lineto": 82, "block": "GIT_STASH_APPLY_DEFAULT\nGIT_STASH_APPLY_REINSTATE_INDEX", "tdef": "typedef", "description": " Stash application flags. ", @@ -36115,6 +36027,141 @@ } } ], + [ + "git_stash_apply_options", + { + "decl": [ + "unsigned int version", + "git_stash_apply_flags flags", + "git_checkout_options checkout_options", + "git_stash_apply_progress_cb progress_cb", + "void * progress_payload" + ], + "type": "struct", + "value": "git_stash_apply_options", + "file": "git2/stash.h", + "line": 126, + "lineto": 138, + "block": "unsigned int version\ngit_stash_apply_flags flags\ngit_checkout_options checkout_options\ngit_stash_apply_progress_cb progress_cb\nvoid * progress_payload", + "tdef": "typedef", + "description": " Stash application options structure", + "comments": "

Initialize with GIT_STASH_APPLY_OPTIONS_INIT. Alternatively, you can use git_stash_apply_options_init.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "git_stash_apply_flags", + "name": "flags", + "comments": " See `git_stash_apply_flags_t`, above. " + }, + { + "type": "git_checkout_options", + "name": "checkout_options", + "comments": " Options to use when writing files to the working directory. " + }, + { + "type": "git_stash_apply_progress_cb", + "name": "progress_cb", + "comments": " Optional callback to notify the consumer of application progress. " + }, + { + "type": "void *", + "name": "progress_payload", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_stash_apply", + "git_stash_apply_options_init", + "git_stash_pop" + ] + } + } + ], + [ + "git_stash_apply_progress_t", + { + "decl": [ + "GIT_STASH_APPLY_PROGRESS_NONE", + "GIT_STASH_APPLY_PROGRESS_LOADING_STASH", + "GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX", + "GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED", + "GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED", + "GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED", + "GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED", + "GIT_STASH_APPLY_PROGRESS_DONE" + ], + "type": "enum", + "file": "git2/stash.h", + "line": 85, + "lineto": 108, + "block": "GIT_STASH_APPLY_PROGRESS_NONE\nGIT_STASH_APPLY_PROGRESS_LOADING_STASH\nGIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX\nGIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED\nGIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED\nGIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED\nGIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED\nGIT_STASH_APPLY_PROGRESS_DONE", + "tdef": "typedef", + "description": " Stash apply progression states ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_NONE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_LOADING_STASH", + "comments": "

Loading the stashed data from the object database.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX", + "comments": "

The stored index is being analyzed.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED", + "comments": "

The modified files are being analyzed.

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED", + "comments": "

The untracked and ignored files are being analyzed.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED", + "comments": "

The untracked files are being written to disk.

\n", + "value": 5 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED", + "comments": "

The modified files are being written to disk.

\n", + "value": 6 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_DONE", + "comments": "

The stash was applied successfully.

\n", + "value": 7 + } + ], + "used": { + "returns": [], + "needs": [ + "git_stash_apply_progress_cb" + ] + } + } + ], [ "git_stash_flags", { @@ -36125,9 +36172,9 @@ "GIT_STASH_INCLUDE_IGNORED" ], "type": "enum", - "file": "stash.h", - "line": 24, - "lineto": 47, + "file": "git2/stash.h", + "line": 25, + "lineto": 48, "block": "GIT_STASH_DEFAULT\nGIT_STASH_KEEP_INDEX\nGIT_STASH_INCLUDE_UNTRACKED\nGIT_STASH_INCLUDE_IGNORED", "tdef": "typedef", "description": " Stash flags", @@ -36164,15 +36211,57 @@ } } ], + [ + "git_status_entry", + { + "decl": [ + "git_status_t status", + "git_diff_delta * head_to_index", + "git_diff_delta * index_to_workdir" + ], + "type": "struct", + "value": "git_status_entry", + "file": "git2/status.h", + "line": 230, + "lineto": 234, + "block": "git_status_t status\ngit_diff_delta * head_to_index\ngit_diff_delta * index_to_workdir", + "tdef": "typedef", + "description": " A status entry, providing the differences between the file as it exists\n in HEAD and the index, and providing the differences between the index\n and the working directory.", + "comments": "

The status value provides the status flags for this file.

\n\n

The head_to_index value provides detailed information about the differences between the file in HEAD and the file in the index.

\n\n

The index_to_workdir value provides detailed information about the differences between the file in the index and the file in the working directory.

\n", + "fields": [ + { + "type": "git_status_t", + "name": "status", + "comments": "" + }, + { + "type": "git_diff_delta *", + "name": "head_to_index", + "comments": "" + }, + { + "type": "git_diff_delta *", + "name": "index_to_workdir", + "comments": "" + } + ], + "used": { + "returns": [ + "git_status_byindex" + ], + "needs": [] + } + } + ], [ "git_status_list", { "decl": "git_status_list", "type": "struct", "value": "git_status_list", - "file": "types.h", - "line": 188, - "lineto": 188, + "file": "git2/types.h", + "line": 189, + "lineto": 189, "tdef": "typedef", "description": " Representation of a status collection ", "comments": "", @@ -36182,7 +36271,6 @@ "git_status_byindex", "git_status_list_entrycount", "git_status_list_free", - "git_status_list_get_perfdata", "git_status_list_new" ] } @@ -36210,9 +36298,9 @@ "GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED" ], "type": "enum", - "file": "status.h", - "line": 137, - "lineto": 154, + "file": "git2/status.h", + "line": 139, + "lineto": 156, "block": "GIT_STATUS_OPT_INCLUDE_UNTRACKED\nGIT_STATUS_OPT_INCLUDE_IGNORED\nGIT_STATUS_OPT_INCLUDE_UNMODIFIED\nGIT_STATUS_OPT_EXCLUDE_SUBMODULES\nGIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS\nGIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH\nGIT_STATUS_OPT_RECURSE_IGNORED_DIRS\nGIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX\nGIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR\nGIT_STATUS_OPT_SORT_CASE_SENSITIVELY\nGIT_STATUS_OPT_SORT_CASE_INSENSITIVELY\nGIT_STATUS_OPT_RENAMES_FROM_REWRITES\nGIT_STATUS_OPT_NO_REFRESH\nGIT_STATUS_OPT_UPDATE_INDEX\nGIT_STATUS_OPT_INCLUDE_UNREADABLE\nGIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED", "tdef": "typedef", "description": " Flags to control status callbacks", @@ -36321,6 +36409,62 @@ } } ], + [ + "git_status_options", + { + "decl": [ + "unsigned int version", + "git_status_show_t show", + "unsigned int flags", + "git_strarray pathspec", + "git_tree * baseline" + ], + "type": "struct", + "value": "git_status_options", + "file": "git2/status.h", + "line": 170, + "lineto": 197, + "block": "unsigned int version\ngit_status_show_t show\nunsigned int flags\ngit_strarray pathspec\ngit_tree * baseline", + "tdef": "typedef", + "description": " Options to control how `git_status_foreach_ext()` will issue callbacks.", + "comments": "

Initialize with GIT_STATUS_OPTIONS_INIT. Alternatively, you can use git_status_options_init.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " The version " + }, + { + "type": "git_status_show_t", + "name": "show", + "comments": " The `show` value is one of the `git_status_show_t` constants that\n control which files to scan and in what order." + }, + { + "type": "unsigned int", + "name": "flags", + "comments": " The `flags` value is an OR'ed combination of the `git_status_opt_t`\n values above." + }, + { + "type": "git_strarray", + "name": "pathspec", + "comments": " The `pathspec` is an array of path patterns to match (using\n fnmatch-style matching), or just an array of paths to match exactly if\n `GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH` is specified in the flags." + }, + { + "type": "git_tree *", + "name": "baseline", + "comments": " The `baseline` is the tree to be used for comparison to the working directory\n and index; defaults to HEAD." + } + ], + "used": { + "returns": [], + "needs": [ + "git_status_foreach_ext", + "git_status_list_new", + "git_status_options_init" + ] + } + } + ], [ "git_status_show_t", { @@ -36330,9 +36474,9 @@ "GIT_STATUS_SHOW_WORKDIR_ONLY" ], "type": "enum", - "file": "status.h", - "line": 79, - "lineto": 83, + "file": "git2/status.h", + "line": 81, + "lineto": 85, "block": "GIT_STATUS_SHOW_INDEX_AND_WORKDIR\nGIT_STATUS_SHOW_INDEX_ONLY\nGIT_STATUS_SHOW_WORKDIR_ONLY", "tdef": "typedef", "description": " Select the files on which to report status.", @@ -36383,9 +36527,9 @@ "GIT_STATUS_CONFLICTED" ], "type": "enum", - "file": "status.h", - "line": 32, - "lineto": 50, + "file": "git2/status.h", + "line": 34, + "lineto": 52, "block": "GIT_STATUS_CURRENT\nGIT_STATUS_INDEX_NEW\nGIT_STATUS_INDEX_MODIFIED\nGIT_STATUS_INDEX_DELETED\nGIT_STATUS_INDEX_RENAMED\nGIT_STATUS_INDEX_TYPECHANGE\nGIT_STATUS_WT_NEW\nGIT_STATUS_WT_MODIFIED\nGIT_STATUS_WT_DELETED\nGIT_STATUS_WT_TYPECHANGE\nGIT_STATUS_WT_RENAMED\nGIT_STATUS_WT_UNREADABLE\nGIT_STATUS_IGNORED\nGIT_STATUS_CONFLICTED", "tdef": "typedef", "description": " Status flags for a single file.", @@ -36491,7 +36635,7 @@ ], "type": "struct", "value": "git_strarray", - "file": "strarray.h", + "file": "git2/strarray.h", "line": 22, "lineto": 25, "block": "char ** strings\nsize_t count", @@ -36538,86 +36682,37 @@ } ], [ - "git_stream", + "git_stream_t", { "decl": [ - "int version", - "int encrypted", - "int proxy_support", - "int (*)(struct git_stream *) connect", - "int (*)(git_cert **, struct git_stream *) certificate", - "int (*)(struct git_stream *, const git_proxy_options *) set_proxy", - "ssize_t (*)(struct git_stream *, void *, size_t) read", - "ssize_t (*)(struct git_stream *, const char *, size_t, int) write", - "int (*)(struct git_stream *) close", - "void (*)(struct git_stream *) free" + "GIT_STREAM_STANDARD", + "GIT_STREAM_TLS" ], - "type": "struct", - "value": "git_stream", - "file": "sys/stream.h", - "line": 29, - "lineto": 41, - "block": "int version\nint encrypted\nint proxy_support\nint (*)(struct git_stream *) connect\nint (*)(git_cert **, struct git_stream *) certificate\nint (*)(struct git_stream *, const git_proxy_options *) set_proxy\nssize_t (*)(struct git_stream *, void *, size_t) read\nssize_t (*)(struct git_stream *, const char *, size_t, int) write\nint (*)(struct git_stream *) close\nvoid (*)(struct git_stream *) free", + "type": "enum", + "file": "git2/sys/stream.h", + "line": 77, + "lineto": 83, + "block": "GIT_STREAM_STANDARD\nGIT_STREAM_TLS", "tdef": "typedef", - "description": " Every stream must have this struct as its first element, so the\n API can talk to it. You'd define your stream as", - "comments": "
 struct my_stream {             git_stream parent;             ...     }\n
\n\n

and fill the functions

\n", + "description": " The type of stream to register.", + "comments": "", "fields": [ { "type": "int", - "name": "version", - "comments": "" - }, - { - "type": "int", - "name": "encrypted", - "comments": "" + "name": "GIT_STREAM_STANDARD", + "comments": "

A standard (non-TLS) socket.

\n", + "value": 1 }, { "type": "int", - "name": "proxy_support", - "comments": "" - }, - { - "type": "int (*)(struct git_stream *)", - "name": "connect", - "comments": "" - }, - { - "type": "int (*)(git_cert **, struct git_stream *)", - "name": "certificate", - "comments": "" - }, - { - "type": "int (*)(struct git_stream *, const git_proxy_options *)", - "name": "set_proxy", - "comments": "" - }, - { - "type": "ssize_t (*)(struct git_stream *, void *, size_t)", - "name": "read", - "comments": "" - }, - { - "type": "ssize_t (*)(struct git_stream *, const char *, size_t, int)", - "name": "write", - "comments": "" - }, - { - "type": "int (*)(struct git_stream *)", - "name": "close", - "comments": "" - }, - { - "type": "void (*)(struct git_stream *)", - "name": "free", - "comments": "" + "name": "GIT_STREAM_TLS", + "comments": "

A TLS-encrypted socket.

\n", + "value": 2 } ], "used": { "returns": [], - "needs": [ - "git_stream_register_tls" - ] + "needs": [] } } ], @@ -36627,9 +36722,9 @@ "decl": "git_submodule", "type": "struct", "value": "git_submodule", - "file": "types.h", - "line": 339, - "lineto": 339, + "file": "git2/types.h", + "line": 313, + "lineto": 313, "tdef": "typedef", "description": " Opaque structure representing a submodule.", "comments": "", @@ -36666,7 +36761,7 @@ "git_submodule_status", "git_submodule_sync", "git_submodule_update", - "git_submodule_update_init_options", + "git_submodule_update_options_init", "git_submodule_update_strategy", "git_submodule_url", "git_submodule_wd_id" @@ -36685,9 +36780,9 @@ "GIT_SUBMODULE_IGNORE_ALL" ], "type": "enum", - "file": "types.h", - "line": 403, - "lineto": 410, + "file": "git2/types.h", + "line": 377, + "lineto": 384, "block": "GIT_SUBMODULE_IGNORE_UNSPECIFIED\nGIT_SUBMODULE_IGNORE_NONE\nGIT_SUBMODULE_IGNORE_UNTRACKED\nGIT_SUBMODULE_IGNORE_DIRTY\nGIT_SUBMODULE_IGNORE_ALL", "tdef": "typedef", "description": " Submodule ignore values", @@ -36744,9 +36839,9 @@ "GIT_SUBMODULE_RECURSE_ONDEMAND" ], "type": "enum", - "file": "types.h", - "line": 422, - "lineto": 426, + "file": "git2/types.h", + "line": 396, + "lineto": 400, "block": "GIT_SUBMODULE_RECURSE_NO\nGIT_SUBMODULE_RECURSE_YES\nGIT_SUBMODULE_RECURSE_ONDEMAND", "tdef": "typedef", "description": " Options for submodule recurse.", @@ -36801,7 +36896,7 @@ "GIT_SUBMODULE_STATUS_WD_UNTRACKED" ], "type": "enum", - "file": "submodule.h", + "file": "git2/submodule.h", "line": 74, "lineto": 89, "block": "GIT_SUBMODULE_STATUS_IN_HEAD\nGIT_SUBMODULE_STATUS_IN_INDEX\nGIT_SUBMODULE_STATUS_IN_CONFIG\nGIT_SUBMODULE_STATUS_IN_WD\nGIT_SUBMODULE_STATUS_INDEX_ADDED\nGIT_SUBMODULE_STATUS_INDEX_DELETED\nGIT_SUBMODULE_STATUS_INDEX_MODIFIED\nGIT_SUBMODULE_STATUS_WD_UNINITIALIZED\nGIT_SUBMODULE_STATUS_WD_ADDED\nGIT_SUBMODULE_STATUS_WD_DELETED\nGIT_SUBMODULE_STATUS_WD_MODIFIED\nGIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED\nGIT_SUBMODULE_STATUS_WD_WD_MODIFIED\nGIT_SUBMODULE_STATUS_WD_UNTRACKED", @@ -36911,13 +37006,13 @@ ], "type": "struct", "value": "git_submodule_update_options", - "file": "submodule.h", - "line": 129, - "lineto": 154, + "file": "git2/submodule.h", + "line": 128, + "lineto": 153, "block": "unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nint allow_fetch", "tdef": "typedef", "description": " Submodule update options structure", - "comments": "

Use the GIT_SUBMODULE_UPDATE_OPTIONS_INIT to get the default settings, like this:

\n\n

git_submodule_update_options opts = GIT_SUBMODULE_UPDATE_OPTIONS_INIT;

\n", + "comments": "

Initialize with GIT_SUBMODULE_UPDATE_OPTIONS_INIT. Alternatively, you can use git_submodule_update_options_init.

\n", "fields": [ { "type": "unsigned int", @@ -36927,7 +37022,7 @@ { "type": "git_checkout_options", "name": "checkout_opts", - "comments": " These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to\n `GIT_CHECKOUT_NONE`. Generally you will want the use\n GIT_CHECKOUT_SAFE to update files in the working\n directory. " + "comments": " These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to\n `GIT_CHECKOUT_NONE`. Generally you will want the use\n GIT_CHECKOUT_SAFE to update files in the working\n directory." }, { "type": "git_fetch_options", @@ -36944,7 +37039,7 @@ "returns": [], "needs": [ "git_submodule_update", - "git_submodule_update_init_options" + "git_submodule_update_options_init" ] } } @@ -36960,9 +37055,9 @@ "GIT_SUBMODULE_UPDATE_DEFAULT" ], "type": "enum", - "file": "types.h", - "line": 367, - "lineto": 374, + "file": "git2/types.h", + "line": 341, + "lineto": 348, "block": "GIT_SUBMODULE_UPDATE_CHECKOUT\nGIT_SUBMODULE_UPDATE_REBASE\nGIT_SUBMODULE_UPDATE_MERGE\nGIT_SUBMODULE_UPDATE_NONE\nGIT_SUBMODULE_UPDATE_DEFAULT", "tdef": "typedef", "description": " Submodule update values", @@ -37015,9 +37110,9 @@ "decl": "git_tag", "type": "struct", "value": "git_tag", - "file": "types.h", - "line": 117, - "lineto": 117, + "file": "git2/types.h", + "line": 118, + "lineto": 118, "tdef": "typedef", "description": " Parsed representation of a tag object. ", "comments": "", @@ -37052,9 +37147,9 @@ ], "type": "struct", "value": "git_time", - "file": "types.h", - "line": 159, - "lineto": 163, + "file": "git2/types.h", + "line": 163, + "lineto": 167, "block": "git_time_t time\nint offset\nchar sign", "tdef": "typedef", "description": " Time in a signature ", @@ -37099,7 +37194,7 @@ "GIT_TRACE_TRACE" ], "type": "enum", - "file": "trace.h", + "file": "git2/trace.h", "line": 26, "lineto": 47, "block": "GIT_TRACE_NONE\nGIT_TRACE_FATAL\nGIT_TRACE_ERROR\nGIT_TRACE_WARN\nGIT_TRACE_INFO\nGIT_TRACE_DEBUG\nGIT_TRACE_TRACE", @@ -37153,7 +37248,7 @@ "used": { "returns": [], "needs": [ - "git_trace_callback", + "git_trace_cb", "git_trace_set" ] } @@ -37165,89 +37260,24 @@ "decl": "git_transaction", "type": "struct", "value": "git_transaction", - "file": "types.h", - "line": 179, - "lineto": 179, + "file": "git2/types.h", + "line": 183, + "lineto": 183, "tdef": "typedef", "description": " Transactional interface to references ", "comments": "", "used": { "returns": [], "needs": [ - "git_config_lock" - ] - } - } - ], - [ - "git_transfer_progress", - { - "decl": [ - "unsigned int total_objects", - "unsigned int indexed_objects", - "unsigned int received_objects", - "unsigned int local_objects", - "unsigned int total_deltas", - "unsigned int indexed_deltas", - "size_t received_bytes" - ], - "type": "struct", - "value": "git_transfer_progress", - "file": "types.h", - "line": 257, - "lineto": 265, - "block": "unsigned int total_objects\nunsigned int indexed_objects\nunsigned int received_objects\nunsigned int local_objects\nunsigned int total_deltas\nunsigned int indexed_deltas\nsize_t received_bytes", - "tdef": "typedef", - "description": " This is passed as the first argument to the callback to allow the\n user to see the progress.", - "comments": "\n", - "fields": [ - { - "type": "unsigned int", - "name": "total_objects", - "comments": "" - }, - { - "type": "unsigned int", - "name": "indexed_objects", - "comments": "" - }, - { - "type": "unsigned int", - "name": "received_objects", - "comments": "" - }, - { - "type": "unsigned int", - "name": "local_objects", - "comments": "" - }, - { - "type": "unsigned int", - "name": "total_deltas", - "comments": "" - }, - { - "type": "unsigned int", - "name": "indexed_deltas", - "comments": "" - }, - { - "type": "size_t", - "name": "received_bytes", - "comments": "" - } - ], - "used": { - "returns": [ - "git_remote_stats" - ], - "needs": [ - "git_indexer_append", - "git_indexer_commit", - "git_indexer_new", - "git_odb_write_pack", - "git_packbuilder_write", - "git_transfer_progress_cb" + "git_config_lock", + "git_transaction_commit", + "git_transaction_free", + "git_transaction_lock_ref", + "git_transaction_new", + "git_transaction_remove", + "git_transaction_set_reflog", + "git_transaction_set_symbolic_target", + "git_transaction_set_target" ] } } @@ -37258,70 +37288,29 @@ "decl": "git_transport", "type": "struct", "value": "git_transport", - "file": "types.h", - "line": 234, - "lineto": 234, + "file": "git2/types.h", + "line": 235, + "lineto": 235, "tdef": "typedef", "description": " Interface which represents a transport to communicate with a\n remote.", "comments": "", "used": { "returns": [], "needs": [ - "git_smart_subtransport_git", - "git_smart_subtransport_http", - "git_smart_subtransport_ssh", - "git_transport_cb", - "git_transport_dummy", - "git_transport_init", - "git_transport_local", - "git_transport_new", - "git_transport_register", - "git_transport_smart", - "git_transport_smart_certificate_check", - "git_transport_smart_credentials", - "git_transport_smart_proxy_options", - "git_transport_ssh_with_paths" + "git_transport_cb" ] } } ], - [ - "git_transport_flags_t", - { - "decl": [ - "GIT_TRANSPORTFLAGS_NONE" - ], - "type": "enum", - "file": "sys/transport.h", - "line": 31, - "lineto": 33, - "block": "GIT_TRANSPORTFLAGS_NONE", - "tdef": "typedef", - "description": " Flags to pass to transport", - "comments": "

Currently unused.

\n", - "fields": [ - { - "type": "int", - "name": "GIT_TRANSPORTFLAGS_NONE", - "comments": "", - "value": 0 - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], [ "git_tree", { "decl": "git_tree", "type": "struct", "value": "git_tree", - "file": "types.h", - "line": 129, - "lineto": 129, + "file": "git2/types.h", + "line": 130, + "lineto": 130, "tdef": "typedef", "description": " Representation of a tree object. ", "comments": "", @@ -37333,6 +37322,7 @@ "git_treebuilder_get" ], "needs": [ + "git_apply_to_tree", "git_commit_amend", "git_commit_create", "git_commit_create_buffer", @@ -37389,9 +37379,9 @@ "decl": "git_tree_entry", "type": "struct", "value": "git_tree_entry", - "file": "types.h", - "line": 126, - "lineto": 126, + "file": "git2/types.h", + "line": 127, + "lineto": 127, "tdef": "typedef", "description": " Representation of each one of the entries in a tree object. ", "comments": "", @@ -37431,7 +37421,7 @@ ], "type": "struct", "value": "git_tree_update", - "file": "tree.h", + "file": "git2/tree.h", "line": 448, "lineto": 457, "block": "git_tree_update_t action\ngit_oid id\ngit_filemode_t filemode\nconst char * path", @@ -37476,7 +37466,7 @@ "GIT_TREE_UPDATE_REMOVE" ], "type": "enum", - "file": "tree.h", + "file": "git2/tree.h", "line": 438, "lineto": 443, "block": "GIT_TREE_UPDATE_UPSERT\nGIT_TREE_UPDATE_REMOVE", @@ -37509,9 +37499,9 @@ "decl": "git_treebuilder", "type": "struct", "value": "git_treebuilder", - "file": "types.h", - "line": 132, - "lineto": 132, + "file": "git2/types.h", + "line": 133, + "lineto": 133, "tdef": "typedef", "description": " Constructor for in-memory trees ", "comments": "", @@ -37540,7 +37530,7 @@ "GIT_TREEWALK_POST" ], "type": "enum", - "file": "tree.h", + "file": "git2/tree.h", "line": 398, "lineto": 401, "block": "GIT_TREEWALK_PRE\nGIT_TREEWALK_POST", @@ -37575,9 +37565,9 @@ "decl": "git_worktree", "type": "struct", "value": "git_worktree", - "file": "types.h", - "line": 108, - "lineto": 108, + "file": "git2/types.h", + "line": 109, + "lineto": 109, "tdef": "typedef", "description": " Representation of a working tree ", "comments": "", @@ -37586,21 +37576,104 @@ "needs": [ "git_repository_open_from_worktree", "git_worktree_add", - "git_worktree_add_init_options", + "git_worktree_add_options_init", "git_worktree_free", "git_worktree_is_locked", "git_worktree_is_prunable", "git_worktree_lock", "git_worktree_lookup", + "git_worktree_name", "git_worktree_open_from_repository", + "git_worktree_path", "git_worktree_prune", - "git_worktree_prune_init_options", + "git_worktree_prune_options_init", "git_worktree_unlock", "git_worktree_validate" ] } } ], + [ + "git_worktree_add_options", + { + "decl": [ + "unsigned int version", + "int lock", + "git_reference * ref" + ], + "type": "struct", + "value": "git_worktree_add_options", + "file": "git2/worktree.h", + "line": 84, + "lineto": 89, + "block": "unsigned int version\nint lock\ngit_reference * ref", + "tdef": "typedef", + "description": " Worktree add options structure", + "comments": "

Initialize with GIT_WORKTREE_ADD_OPTIONS_INIT. Alternatively, you can use git_worktree_add_options_init.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "int", + "name": "lock", + "comments": " lock newly created worktree " + }, + { + "type": "git_reference *", + "name": "ref", + "comments": " reference to use for the new worktree HEAD " + } + ], + "used": { + "returns": [], + "needs": [ + "git_worktree_add", + "git_worktree_add_options_init" + ] + } + } + ], + [ + "git_worktree_prune_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags" + ], + "type": "struct", + "value": "git_worktree_prune_options", + "file": "git2/worktree.h", + "line": 198, + "lineto": 202, + "block": "unsigned int version\nuint32_t flags", + "tdef": "typedef", + "description": " Worktree prune options structure", + "comments": "

Initialize with GIT_WORKTREE_PRUNE_OPTIONS_INIT. Alternatively, you can use git_worktree_prune_options_init.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "uint32_t", + "name": "flags", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_worktree_is_prunable", + "git_worktree_prune", + "git_worktree_prune_options_init" + ] + } + } + ], [ "git_worktree_prune_t", { @@ -37610,9 +37683,9 @@ "GIT_WORKTREE_PRUNE_WORKING_TREE" ], "type": "enum", - "file": "worktree.h", - "line": 155, - "lineto": 162, + "file": "git2/worktree.h", + "line": 182, + "lineto": 189, "block": "GIT_WORKTREE_PRUNE_VALID\nGIT_WORKTREE_PRUNE_LOCKED\nGIT_WORKTREE_PRUNE_WORKING_TREE", "tdef": "typedef", "description": " Flags which can be passed to git_worktree_prune to alter its\n behavior.", @@ -37646,20 +37719,42 @@ [ "git_writestream", { - "decl": "git_writestream", + "decl": [ + "int (*)(git_writestream *, const char *, size_t) write", + "int (*)(git_writestream *) close", + "void (*)(git_writestream *) free" + ], "type": "struct", "value": "git_writestream", - "file": "types.h", - "line": 429, - "lineto": 429, - "tdef": "typedef", + "file": "git2/types.h", + "line": 405, + "lineto": 409, + "tdef": null, "description": " A type to write in a streaming fashion, for example, for filters. ", "comments": "", + "fields": [ + { + "type": "int (*)(git_writestream *, const char *, size_t)", + "name": "write", + "comments": "" + }, + { + "type": "int (*)(git_writestream *)", + "name": "close", + "comments": "" + }, + { + "type": "void (*)(git_writestream *)", + "name": "free", + "comments": "" + } + ], + "block": "int (*)(git_writestream *, const char *, size_t) write\nint (*)(git_writestream *) close\nvoid (*)(git_writestream *) free", "used": { "returns": [], "needs": [ - "git_blob_create_fromstream", - "git_blob_create_fromstream_commit", + "git_blob_create_from_stream", + "git_blob_create_from_stream_commit", "git_filter_list_stream_blob", "git_filter_list_stream_data", "git_filter_list_stream_file" @@ -37668,7 +37763,7 @@ } ] ], - "prefix": "include/git2", + "prefix": "include", "groups": [ [ "annotated", @@ -37678,7 +37773,15 @@ "git_annotated_commit_from_ref", "git_annotated_commit_from_revspec", "git_annotated_commit_id", - "git_annotated_commit_lookup" + "git_annotated_commit_lookup", + "git_annotated_commit_ref" + ] + ], + [ + "apply", + [ + "git_apply", + "git_apply_to_tree" ] ], [ @@ -37701,16 +37804,18 @@ "git_blame_get_hunk_byindex", "git_blame_get_hunk_byline", "git_blame_get_hunk_count", - "git_blame_init_options" + "git_blame_init_options", + "git_blame_options_init" ] ], [ "blob", [ - "git_blob_create_frombuffer", - "git_blob_create_fromdisk", - "git_blob_create_fromstream", - "git_blob_create_fromstream_commit", + "git_blob_create_from_buffer", + "git_blob_create_from_disk", + "git_blob_create_from_stream", + "git_blob_create_from_stream_commit", + "git_blob_create_from_workdir", "git_blob_create_fromworkdir", "git_blob_dup", "git_blob_filtered_content", @@ -37738,14 +37843,18 @@ "git_branch_move", "git_branch_name", "git_branch_next", + "git_branch_remote_name", "git_branch_set_upstream", - "git_branch_upstream" + "git_branch_upstream", + "git_branch_upstream_name", + "git_branch_upstream_remote" ] ], [ "buf", [ "git_buf_contains_nul", + "git_buf_dispose", "git_buf_free", "git_buf_grow", "git_buf_is_binary", @@ -37757,7 +37866,7 @@ [ "git_checkout_head", "git_checkout_index", - "git_checkout_init_options", + "git_checkout_options_init", "git_checkout_tree" ] ], @@ -37766,14 +37875,14 @@ [ "git_cherrypick", "git_cherrypick_commit", - "git_cherrypick_init_options" + "git_cherrypick_options_init" ] ], [ "clone", [ "git_clone", - "git_clone_init_options" + "git_clone_options_init" ] ], [ @@ -37781,12 +37890,12 @@ [ "git_commit_amend", "git_commit_author", + "git_commit_author_with_mailmap", "git_commit_body", "git_commit_committer", + "git_commit_committer_with_mailmap", "git_commit_create", "git_commit_create_buffer", - "git_commit_create_from_callback", - "git_commit_create_from_ids", "git_commit_create_v", "git_commit_create_with_signature", "git_commit_dup", @@ -37815,7 +37924,6 @@ [ "config", [ - "git_config_add_backend", "git_config_add_file_ondisk", "git_config_backend_foreach_match", "git_config_delete_entry", @@ -37837,7 +37945,6 @@ "git_config_get_path", "git_config_get_string", "git_config_get_string_buf", - "git_config_init_backend", "git_config_iterator_free", "git_config_iterator_glob_new", "git_config_iterator_new", @@ -37883,6 +37990,8 @@ [ "git_describe_commit", "git_describe_format", + "git_describe_format_options_init", + "git_describe_options_init", "git_describe_result_free", "git_describe_workdir" ] @@ -37894,28 +38003,25 @@ "git_diff_blobs", "git_diff_buffers", "git_diff_commit_as_email", - "git_diff_find_init_options", + "git_diff_find_options_init", "git_diff_find_similar", "git_diff_foreach", "git_diff_format_email", - "git_diff_format_email_init_options", + "git_diff_format_email_options_init", "git_diff_free", "git_diff_from_buffer", "git_diff_get_delta", - "git_diff_get_perfdata", "git_diff_get_stats", "git_diff_index_to_index", "git_diff_index_to_workdir", - "git_diff_init_options", "git_diff_is_sorted_icase", "git_diff_merge", "git_diff_num_deltas", "git_diff_num_deltas_of_type", + "git_diff_options_init", "git_diff_patchid", - "git_diff_patchid_init_options", + "git_diff_patchid_options_init", "git_diff_print", - "git_diff_print_callback__to_buf", - "git_diff_print_callback__to_file_handle", "git_diff_stats_deletions", "git_diff_stats_files_changed", "git_diff_stats_free", @@ -37929,37 +38035,33 @@ "git_diff_tree_to_workdir_with_index" ] ], + [ + "error", + [ + "git_error_clear", + "git_error_last", + "git_error_set_oom", + "git_error_set_str" + ] + ], [ "fetch", [ - "git_fetch_init_options" + "git_fetch_options_init" ] ], [ "filter", [ - "git_filter_init", "git_filter_list_apply_to_blob", "git_filter_list_apply_to_data", "git_filter_list_apply_to_file", "git_filter_list_contains", "git_filter_list_free", - "git_filter_list_length", "git_filter_list_load", - "git_filter_list_new", - "git_filter_list_push", "git_filter_list_stream_blob", "git_filter_list_stream_data", - "git_filter_list_stream_file", - "git_filter_lookup", - "git_filter_register", - "git_filter_source_filemode", - "git_filter_source_flags", - "git_filter_source_id", - "git_filter_source_mode", - "git_filter_source_path", - "git_filter_source_repo", - "git_filter_unregister" + "git_filter_list_stream_file" ] ], [ @@ -37978,15 +38080,6 @@ "git_graph_descendant_of" ] ], - [ - "hashsig", - [ - "git_hashsig_compare", - "git_hashsig_create", - "git_hashsig_create_fromfile", - "git_hashsig_free" - ] - ], [ "ignore", [ @@ -38001,7 +38094,7 @@ "git_index_add", "git_index_add_all", "git_index_add_bypath", - "git_index_add_frombuffer", + "git_index_add_from_buffer", "git_index_caps", "git_index_checksum", "git_index_clear", @@ -38021,6 +38114,9 @@ "git_index_get_byindex", "git_index_get_bypath", "git_index_has_conflicts", + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next", "git_index_new", "git_index_open", "git_index_owner", @@ -38047,7 +38143,8 @@ "git_indexer_commit", "git_indexer_free", "git_indexer_hash", - "git_indexer_new" + "git_indexer_new", + "git_indexer_options_init" ] ], [ @@ -38061,11 +38158,15 @@ ] ], [ - "mempack", + "mailmap", [ - "git_mempack_dump", - "git_mempack_new", - "git_mempack_reset" + "git_mailmap_add_entry", + "git_mailmap_free", + "git_mailmap_from_buffer", + "git_mailmap_from_repository", + "git_mailmap_new", + "git_mailmap_resolve", + "git_mailmap_resolve_signature" ] ], [ @@ -38073,6 +38174,7 @@ [ "git_merge", "git_merge_analysis", + "git_merge_analysis_for_ref", "git_merge_base", "git_merge_base_many", "git_merge_base_octopus", @@ -38081,10 +38183,10 @@ "git_merge_commits", "git_merge_file", "git_merge_file_from_index", - "git_merge_file_init_input", - "git_merge_file_init_options", + "git_merge_file_input_init", + "git_merge_file_options_init", "git_merge_file_result_free", - "git_merge_init_options", + "git_merge_options_init", "git_merge_trees" ] ], @@ -38106,6 +38208,7 @@ "git_note_commit_remove", "git_note_committer", "git_note_create", + "git_note_default_ref", "git_note_foreach", "git_note_free", "git_note_id", @@ -38120,7 +38223,6 @@ [ "object", [ - "git_object__size", "git_object_dup", "git_object_free", "git_object_id", @@ -38130,6 +38232,7 @@ "git_object_owner", "git_object_peel", "git_object_short_id", + "git_object_size", "git_object_string2type", "git_object_type", "git_object_type2string", @@ -38153,7 +38256,6 @@ "git_odb_get_backend", "git_odb_hash", "git_odb_hashfile", - "git_odb_init_backend", "git_odb_new", "git_odb_num_backends", "git_odb_object_data", @@ -38188,6 +38290,7 @@ "git_oid_fromstr", "git_oid_fromstrn", "git_oid_fromstrp", + "git_oid_is_zero", "git_oid_iszero", "git_oid_ncmp", "git_oid_nfmt", @@ -38207,12 +38310,6 @@ "git_oidarray_free" ] ], - [ - "openssl", - [ - "git_openssl_set_locking" - ] - ], [ "packbuilder", [ @@ -38229,6 +38326,7 @@ "git_packbuilder_set_callbacks", "git_packbuilder_set_threads", "git_packbuilder_write", + "git_packbuilder_write_buf", "git_packbuilder_written" ] ], @@ -38272,13 +38370,13 @@ [ "proxy", [ - "git_proxy_init_options" + "git_proxy_options_init" ] ], [ "push", [ - "git_push_init_options" + "git_push_options_init" ] ], [ @@ -38289,32 +38387,31 @@ "git_rebase_finish", "git_rebase_free", "git_rebase_init", - "git_rebase_init_options", "git_rebase_inmemory_index", "git_rebase_next", + "git_rebase_onto_id", + "git_rebase_onto_name", "git_rebase_open", "git_rebase_operation_byindex", "git_rebase_operation_current", - "git_rebase_operation_entrycount" + "git_rebase_operation_entrycount", + "git_rebase_options_init", + "git_rebase_orig_head_id", + "git_rebase_orig_head_name" ] ], [ "refdb", [ - "git_refdb_backend_fs", "git_refdb_compress", "git_refdb_free", - "git_refdb_init_backend", "git_refdb_new", - "git_refdb_open", - "git_refdb_set_backend" + "git_refdb_open" ] ], [ "reference", [ - "git_reference__alloc", - "git_reference__alloc_symbolic", "git_reference_cmp", "git_reference_create", "git_reference_create_matching", @@ -38383,6 +38480,8 @@ "git_refspec_dst", "git_refspec_dst_matches", "git_refspec_force", + "git_refspec_free", + "git_refspec_parse", "git_refspec_rtransform", "git_refspec_src", "git_refspec_src_matches", @@ -38401,7 +38500,9 @@ "git_remote_create", "git_remote_create_anonymous", "git_remote_create_detached", + "git_remote_create_options_init", "git_remote_create_with_fetchspec", + "git_remote_create_with_opts", "git_remote_default_branch", "git_remote_delete", "git_remote_disconnect", @@ -38438,7 +38539,6 @@ [ "repository", [ - "git_repository__cleanup", "git_repository_commondir", "git_repository_config", "git_repository_config_snapshot", @@ -38450,13 +38550,14 @@ "git_repository_hashfile", "git_repository_head", "git_repository_head_detached", + "git_repository_head_detached_for_worktree", "git_repository_head_for_worktree", "git_repository_head_unborn", "git_repository_ident", "git_repository_index", "git_repository_init", "git_repository_init_ext", - "git_repository_init_init_options", + "git_repository_init_options_init", "git_repository_is_bare", "git_repository_is_empty", "git_repository_is_shallow", @@ -38465,7 +38566,6 @@ "git_repository_mergehead_foreach", "git_repository_message", "git_repository_message_remove", - "git_repository_new", "git_repository_odb", "git_repository_open", "git_repository_open_bare", @@ -38473,22 +38573,14 @@ "git_repository_open_from_worktree", "git_repository_path", "git_repository_refdb", - "git_repository_reinit_filesystem", - "git_repository_set_bare", - "git_repository_set_config", "git_repository_set_head", "git_repository_set_head_detached", "git_repository_set_head_detached_from_annotated", "git_repository_set_ident", - "git_repository_set_index", "git_repository_set_namespace", - "git_repository_set_odb", - "git_repository_set_refdb", "git_repository_set_workdir", "git_repository_state", "git_repository_state_cleanup", - "git_repository_submodule_cache_all", - "git_repository_submodule_cache_clear", "git_repository_workdir", "git_repository_wrap_odb" ] @@ -38506,7 +38598,7 @@ [ "git_revert", "git_revert_commit", - "git_revert_init_options" + "git_revert_options_init" ] ], [ @@ -38550,22 +38642,15 @@ "git_signature_now" ] ], - [ - "smart", - [ - "git_smart_subtransport_git", - "git_smart_subtransport_http", - "git_smart_subtransport_ssh" - ] - ], [ "stash", [ "git_stash_apply", - "git_stash_apply_init_options", + "git_stash_apply_options_init", "git_stash_drop", "git_stash_foreach", - "git_stash_pop" + "git_stash_pop", + "git_stash_save" ] ], [ @@ -38575,11 +38660,10 @@ "git_status_file", "git_status_foreach", "git_status_foreach_ext", - "git_status_init_options", "git_status_list_entrycount", "git_status_list_free", - "git_status_list_get_perfdata", "git_status_list_new", + "git_status_options_init", "git_status_should_ignore" ] ], @@ -38590,12 +38674,6 @@ "git_strarray_free" ] ], - [ - "stream", - [ - "git_stream_register_tls" - ] - ], [ "submodule", [ @@ -38627,7 +38705,7 @@ "git_submodule_status", "git_submodule_sync", "git_submodule_update", - "git_submodule_update_init_options", + "git_submodule_update_options_init", "git_submodule_update_strategy", "git_submodule_url", "git_submodule_wd_id" @@ -38638,7 +38716,7 @@ [ "git_tag_annotation_create", "git_tag_create", - "git_tag_create_frombuffer", + "git_tag_create_from_buffer", "git_tag_create_lightweight", "git_tag_delete", "git_tag_dup", @@ -38659,12 +38737,6 @@ "git_tag_target_type" ] ], - [ - "time", - [ - "git_time_monotonic" - ] - ], [ "trace", [ @@ -38672,19 +38744,16 @@ ] ], [ - "transport", + "transaction", [ - "git_transport_dummy", - "git_transport_init", - "git_transport_local", - "git_transport_new", - "git_transport_register", - "git_transport_smart", - "git_transport_smart_certificate_check", - "git_transport_smart_credentials", - "git_transport_smart_proxy_options", - "git_transport_ssh_with_paths", - "git_transport_unregister" + "git_transaction_commit", + "git_transaction_free", + "git_transaction_lock_ref", + "git_transaction_new", + "git_transaction_remove", + "git_transaction_set_reflog", + "git_transaction_set_symbolic_target", + "git_transaction_set_target" ] ], [ @@ -38733,16 +38802,18 @@ "worktree", [ "git_worktree_add", - "git_worktree_add_init_options", + "git_worktree_add_options_init", "git_worktree_free", "git_worktree_is_locked", "git_worktree_is_prunable", "git_worktree_list", "git_worktree_lock", "git_worktree_lookup", + "git_worktree_name", "git_worktree_open_from_repository", + "git_worktree_path", "git_worktree_prune", - "git_worktree_prune_init_options", + "git_worktree_prune_options_init", "git_worktree_unlock", "git_worktree_validate" ] @@ -38761,10 +38832,22 @@ "cat-file.c", "ex/HEAD/cat-file.html" ], + [ + "checkout.c", + "ex/HEAD/checkout.html" + ], + [ + "clone.c", + "ex/HEAD/clone.html" + ], [ "common.c", "ex/HEAD/common.html" ], + [ + "config.c", + "ex/HEAD/config.html" + ], [ "describe.c", "ex/HEAD/describe.html" @@ -38773,6 +38856,10 @@ "diff.c", "ex/HEAD/diff.html" ], + [ + "fetch.c", + "ex/HEAD/fetch.html" + ], [ "for-each-ref.c", "ex/HEAD/for-each-ref.html" @@ -38782,40 +38869,32 @@ "ex/HEAD/general.html" ], [ - "init.c", - "ex/HEAD/init.html" + "index-pack.c", + "ex/HEAD/index-pack.html" ], [ - "log.c", - "ex/HEAD/log.html" - ], - [ - "merge.c", - "ex/HEAD/merge.html" - ], - [ - "network/clone.c", - "ex/HEAD/network/clone.html" + "init.c", + "ex/HEAD/init.html" ], [ - "network/common.c", - "ex/HEAD/network/common.html" + "lg2.c", + "ex/HEAD/lg2.html" ], [ - "network/fetch.c", - "ex/HEAD/network/fetch.html" + "log.c", + "ex/HEAD/log.html" ], [ - "network/git2.c", - "ex/HEAD/network/git2.html" + "ls-files.c", + "ex/HEAD/ls-files.html" ], [ - "network/index-pack.c", - "ex/HEAD/network/index-pack.html" + "ls-remote.c", + "ex/HEAD/ls-remote.html" ], [ - "network/ls-remote.c", - "ex/HEAD/network/ls-remote.html" + "merge.c", + "ex/HEAD/merge.html" ], [ "remote.c", @@ -38830,8 +38909,8 @@ "ex/HEAD/rev-parse.html" ], [ - "showindex.c", - "ex/HEAD/showindex.html" + "show-index.c", + "ex/HEAD/show-index.html" ], [ "status.c", diff --git a/generate/input/libgit2-supplement.json b/generate/input/libgit2-supplement.json index 3697a3485..e6f5c4d05 100644 --- a/generate/input/libgit2-supplement.json +++ b/generate/input/libgit2-supplement.json @@ -86,165 +86,690 @@ }, "new" : { "functions": { - "git_branch_remote_name": { + "git_clone": { + "isManual": true, + "cFile": "generate/templates/manual/clone/clone.cc", + "isAsync": true, + "isPrototypeMethod": false, + "group": "clone" + }, + "git_commit_extract_signature": { + "args": [ + { + "name": "signature", + "type": "git_buf" + }, + { + "name": "signed_data", + "type": "git_buf" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "commit_id", + "type": "git_oid *" + }, + { + "name": "field", + "type": "char *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/commit/extract_signature.cc", + "isAsync": true, + "isPrototypeMethod": false, + "group": "commit", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_diff_get_perfdata": { + "file": "sys/diff.h", + "args": [ + { + "name": "out", + "type": "git_diff_perfdata *" + }, + { + "name": "diff", + "type": "const git_diff *" + } + ], + "return": { + "type": "int" + }, + "group": "diff" + }, + "git_filter_list_load": { + "isManual": true, + "cFile": "generate/templates/manual/filter_list/load.cc", + "isAsync": true, + "isPrototypeMethod": false, + "group": "filter_list" + }, + "git_filter_source_filemode": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "uint16_t" + }, + "group": "filter_source" + }, + "git_filter_source_flags": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "uint32_t" + }, + "group": "filter_source" + }, + "git_filter_source_id": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "const git_oid *" + }, + "group": "filter_source" + }, + "git_filter_source_mode": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "git_filter_mode_t" + }, + "group": "filter_source" + }, + "git_filter_source_path": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "const char *" + }, + "group": "filter_source" + }, + "git_filter_source_repo": { + "args": [ + { + "name": "out", + "type": "git_repository **" + }, + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "isManual": true, + "cFile": "generate/templates/manual/filter_source/repo.cc", + "isAsync": true, + "isPrototypeMethod": true, + "type": "function", + "group": "filter_source", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_hashsig_compare": { + "type": "function", + "file": "sys/hashsig.h", + "args": [ + { + "name": "a", + "type": "const git_hashsig *" + }, + { + "name": "b", + "type": "const git_hashsig *" + } + ], + "return": { + "type": "int" + }, + "group": "hashsig" + }, + "git_hashsig_create": { + "type": "function", + "file": "sys/hashsig.h", + "args": [ + { + "name": "out", + "type": "git_hashsig **" + }, + { + "name": "buf", + "type": "const char *" + }, + { + "name": "buflen", + "type": "size_t" + }, + { + "name": "opts", + "type": "git_hashsig_option_t" + } + ], + "return": { + "type": "int" + }, + "group": "hashsig" + }, + "git_hashsig_create_fromfile": { + "type": "function", + "file": "sys/hashsig.h", + "args": [ + { + "name": "out", + "type": "git_hashsig **" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "opts", + "type": "git_hashsig_option_t" + } + ], + "return": { + "type": "int" + }, + "group": "hashsig" + }, + "git_index_name_add": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "ancestor", + "type": "const char *" + }, + { + "name": "ours", + "type": "const char *" + }, + { + "name": "theirs", + "type": "const char *" + } + ], + "return": { + "type": "int" + }, + "group": "index_name_entry" + }, + "git_index_name_clear": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "void" + }, + "group": "index_name_entry" + }, + "git_index_name_entrycount": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "size_t" + }, + "group": "index_name_entry" + }, + "git_index_name_get_byindex": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "n", + "type": "size_t" + } + ], + "return": { + "type": "const git_index_name_entry *" + }, + "group": "index_name_entry" + }, + "git_index_reuc_add": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "ancestor_mode", + "type": "int" + }, + { + "name": "ancestor_id", + "type": "const git_oid *" + }, + { + "name": "our_mode", + "type": "int" + }, + { + "name": "our_id", + "type": "const git_oid *" + }, + { + "name": "their_mode", + "type": "int" + }, + { + "name": "their_id", + "type": "const git_oid *" + } + ], + "return": { + "type": "int" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_clear": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "void" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_entrycount": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "size_t" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_find": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "at_pos", + "type": "size_t *" + }, + { + "name": "index", + "type": "git_index *" + }, + { + "name": "path", + "type": "const char *" + } + ], + "return": { + "type": "int" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_get_byindex": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "n", + "type": "size_t" + } + ], + "return": { + "type": "const git_index_reuc_entry *" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_get_bypath": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "path", + "type": "const char *" + } + ], + "return": { + "type": "const git_index_reuc_entry *" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_remove": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "n", + "type": "size_t" + } + ], + "return": { + "type": "int" + }, + "group": "index_reuc_entry" + }, + "git_patch_convenient_from_diff": { + "args": [ + { + "name": "diff", + "type": "git_diff *" + }, + { + "name": "out", + "type": "std::vector *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/patches/convenient_patches.cc", + "isAsync": true, + "isPrototypeMethod": false, + "group": "patch", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_path_is_gitfile": { + "type": "function", + "file": "sys/path.h", + "args": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pathlen", + "type": "size_t" + }, + { + "name": "gitfile", + "type": "git_path_gitfile" + }, + { + "name": "fs", + "type": "git_path_fs" + } + ], + "return": { + "type": "int" + }, + "group": "path" + }, + "git_remote_reference_list": { + "args": [ + { + "name": "out", + "type": "std::vector *" + }, + { + "name": "remote", + "type": "git_remote *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/remote/ls.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "remote", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_repository__cleanup": { "type": "function", - "file": "branch.h", + "file": "sys/repository.h", "args": [ - { - "name": "out", - "type": "git_buf *" - }, { "name": "repo", "type": "git_repository *" - }, - { - "name": "canonical_branch_name", - "type": "const char *" } ], - "isAsync": true, "return": { - "type": "int", - "isErrorCode": true + "type": "void" }, - "group": "branch" - }, - "git_clone": { - "isManual": true, - "cFile": "generate/templates/manual/clone/clone.cc", - "isAsync": true, - "isPrototypeMethod": false, - "group": "clone" + "group": "repository" }, - "git_commit_extract_signature": { + "git_repository_get_references": { "args": [ { - "name": "signature", - "type": "git_buf" - }, - { - "name": "signed_data", - "type": "git_buf" + "name": "out", + "type": "std::vector *" }, { "name": "repo", "type": "git_repository *" - }, - { - "name": "commit_id", - "type": "git_oid *" - }, - { - "name": "field", - "type": "char *" } ], "type": "function", "isManual": true, - "cFile": "generate/templates/manual/commit/extract_signature.cc", + "cFile": "generate/templates/manual/repository/get_references.cc", "isAsync": true, - "isPrototypeMethod": false, - "group": "commit", + "isPrototypeMethod": true, + "group": "repository", "return": { "type": "int", "isErrorCode": true } }, - "git_filter_list_load": { - "isManual": true, - "cFile": "generate/templates/manual/filter_list/load.cc", - "isAsync": true, - "isPrototypeMethod": false, - "group": "filter_list" - }, - "git_patch_convenient_from_diff": { + "git_repository_get_submodules": { "args": [ { - "name": "diff", - "type": "git_diff *" + "name": "out", + "type": "std::vector *" }, { - "name": "out", - "type": "std::vector *" + "name": "repo", + "type": "git_repository *" } ], "type": "function", "isManual": true, - "cFile": "generate/templates/manual/patches/convenient_patches.cc", + "cFile": "generate/templates/manual/repository/get_submodules.cc", "isAsync": true, - "isPrototypeMethod": false, - "group": "patch", + "isPrototypeMethod": true, + "group": "repository", "return": { "type": "int", "isErrorCode": true } }, - "git_rebase_next": { - "type": "function", - "file": "rebase.h", + "git_repository_get_remotes": { "args": [ { "name": "out", - "type": "git_rebase_operation **" + "type": "std::vector *" }, { - "name": "rebase", - "type": "git_rebase *" + "name": "repo", + "type": "git_repository *" } ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/repository/get_remotes.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "repository", "return": { - "type": "int" - }, - "group": "rebase" + "type": "int", + "isErrorCode": true + } }, - "git_remote_reference_list": { + "git_repository_refresh_references": { "args": [ { "name": "out", - "type": "std::vector *" + "type": "void *" }, { - "name": "remote", - "type": "git_remote *" + "name": "repo", + "type": "git_repository *" } ], "type": "function", "isManual": true, - "cFile": "generate/templates/manual/remote/ls.cc", + "cFile": "generate/templates/manual/repository/refresh_references.cc", "isAsync": true, "isPrototypeMethod": true, - "group": "remote", + "group": "repository", "return": { "type": "int", "isErrorCode": true } }, - "git_reset": { + "git_repository_set_index": { "type": "function", - "file": "reset.h", + "file": "sys/repository.h", "args": [ { "name": "repo", "type": "git_repository *" }, { - "name": "target", - "type": "git_object *" - }, + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "void" + }, + "group": "repository" + }, + "git_repository_submodule_cache_all": { + "type": "function", + "file": "sys/repository.h", + "args": [ { - "name": "reset_type", - "type": "git_reset_t" - }, + "name": "repo", + "type": "git_repository *" + } + ], + "return": { + "type": "int" + }, + "group": "repository" + }, + "git_repository_submodule_cache_clear": { + "type": "function", + "file": "sys/repository.h", + "args": [ { - "name": "checkout_opts", - "type": "git_checkout_options *" + "name": "repo", + "type": "git_repository *" } ], "return": { "type": "int" }, - "group": "reset" + "group": "repository" + }, + "git_revwalk_commit_walk": { + "args": [ + { + "name": "max_count", + "type": "int" + }, + { + "name": "out", + "type": "std::vector *" + }, + { + "name": "walk", + "type": "git_revwalk *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/revwalk/commit_walk.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "revwalk", + "return": { + "type": "int", + "isErrorCode": true + } }, "git_revwalk_fast_walk": { "args": [ @@ -280,11 +805,11 @@ }, { "name": "max_count", - "type": "int" + "type": "unsigned int" }, { "name": "out", - "type": "std::vector< std::pair > *> *" + "type": "std::vector *" }, { "name": "walk", @@ -302,35 +827,22 @@ "isErrorCode": true } }, - "git_stash_save": { - "type": "function", - "file": "stash.h", + "git_status_list_get_perfdata": { + "file": "sys/diff.h", "args": [ { "name": "out", - "type": "git_oid *" - }, - { - "name": "repo", - "type": "git_repository *" + "type": "git_diff_perfdata *" }, { - "name": "stasher", - "type": "const git_signature *" - }, - { - "name": "message", - "type": "const char *" - }, - { - "name": "flags", - "type": "unsigned int" + "name": "status", + "type": "const git_status_list *" } ], "return": { "type": "int" }, - "group": "stash" + "group": "status_list" } }, "groups": [ @@ -342,7 +854,24 @@ "git_annotated_commit_from_ref", "git_annotated_commit_from_revspec", "git_annotated_commit_id", - "git_annotated_commit_lookup" + "git_annotated_commit_lookup", + "git_annotated_commit_ref" + ] + ], + [ + "config_iterator", + [ + "git_config_iterator_free", + "git_config_iterator_new", + "git_config_iterator_glob_new", + "git_config_multivar_iterator_new", + "git_config_next" + ] + ], + [ + "diff", + [ + "git_diff_get_perfdata" ] ], [ @@ -376,6 +905,51 @@ "git_filter_source_flags" ] ], + [ + "hashsig", + [ + "git_hashsig_compare", + "git_hashsig_create", + "git_hashsig_create_fromfile" + ] + ], + [ + "index_conflict_iterator", + [ + "git_index_conflict_iterator_free", + "git_index_conflict_iterator_new", + "git_index_conflict_next" + ] + ], + [ + "index_iterator", + [ + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next" + ] + ], + [ + "index_name_entry", + [ + "git_index_name_add", + "git_index_name_clear", + "git_index_name_entrycount", + "git_index_name_get_byindex" + ] + ], + [ + "index_reuc_entry", + [ + "git_index_reuc_add", + "git_index_reuc_clear", + "git_index_reuc_entrycount", + "git_index_reuc_find", + "git_index_reuc_get_byindex", + "git_index_reuc_get_bypath", + "git_index_reuc_remove" + ] + ], [ "merge_file_result", [ @@ -416,6 +990,12 @@ "git_patch_convenient_from_diff" ] ], + [ + "path", + [ + "git_path_is_gitfile" + ] + ], [ "pathspec_match_list", [ @@ -442,9 +1022,23 @@ "git_remote_reference_list" ] ], + [ + "repository", + [ + "git_repository__cleanup", + "git_repository_get_references", + "git_repository_get_submodules", + "git_repository_get_remotes", + "git_repository_refresh_references", + "git_repository_set_index", + "git_repository_submodule_cache_all", + "git_repository_submodule_cache_clear" + ] + ], [ "revwalk", [ + "git_revwalk_commit_walk", "git_revwalk_fast_walk", "git_revwalk_file_history_walk" ] @@ -473,51 +1067,32 @@ ], "types": [ [ - "git_stash_apply_progress_t", + "git_apply_options", { - "type": "enum", + "type": "sctruct", "fields": [ { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_NONE", - "value": 0 - }, - { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_LOADING_STASH", - "value": 1 - }, - { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX", - "value": 2 - }, - { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED", - "value": 3 - }, - { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED", - "value": 4 + "type": "unsigned int", + "name": "version" }, { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED", - "value": 5 + "type": "git_apply_delta_cb", + "name": "delta_cb" }, { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED", - "value": 6 + "type": "git_apply_hunk_cb", + "name": "hunk_cb" }, { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_DONE", - "value": 7 + "type": "void *", + "name": "payload" } - ] + ], + "used": { + "needs": [ + "git_apply_init_options" + ] + } } ], [ @@ -611,62 +1186,28 @@ } ], [ - "git_filter", + "git_diff_perfdata", { "type": "struct", "fields": [ { "type": "unsigned int", - "name": "version" - }, - { - "type": "const char *", - "name": "attributes" - }, - { - "type": "git_filter_init_fn", - "name": "initialize" - }, - { - "type": "git_filter_shutdown_fn", - "name": "shutdown" - }, - { - "type": "git_filter_check_fn", - "name": "check" - }, - { - "type": "git_filter_apply_fn", - "name": "apply" - }, - { - "type": "git_filter_cleanup_fn", - "name": "cleanup" - } - ] - } - ], - [ - "git_status_entry", - { - "fields": [ - { - "type": "git_status_t", - "name": "status" + "name": "version", + "ignore": true }, { - "type": "git_diff_delta *", - "name": "head_to_index" + "type": "size_t", + "name": "stat_calls" }, { - "type": "git_diff_delta *", - "name": "index_to_workdir" + "type": "size_t", + "name": "oid_calculations" } ] } ], [ - "git_diff_perfdata", + "git_filter", { "type": "struct", "fields": [ @@ -675,12 +1216,28 @@ "name": "version" }, { - "type": "size_t", - "name": "stat_calls" + "type": "const char *", + "name": "attributes" }, { - "type": "size_t", - "name": "oid_calculations" + "type": "git_filter_init_fn", + "name": "initialize" + }, + { + "type": "git_filter_shutdown_fn", + "name": "shutdown" + }, + { + "type": "git_filter_check_fn", + "name": "check" + }, + { + "type": "git_filter_apply_fn", + "name": "apply" + }, + { + "type": "git_filter_cleanup_fn", + "name": "cleanup" } ] } @@ -750,6 +1307,53 @@ ] } ], + [ + "git_hashsig", + { + "type": "struct", + "fields": [] + } + ], + [ + "git_index_name_entry", + { + "type": "struct", + "fields": [ + { + "type": "char *", + "name": "ancestor" + }, + { + "type": "char *", + "name": "ours" + }, + { + "type": "char *", + "name": "theirs" + } + ] + } + ], + [ + "git_index_reuc_entry", + { + "type": "struct", + "fields": [ + { + "type": "uint32_t [3]", + "name": "mode" + }, + { + "type": "git_oid [3]", + "name": "oid" + }, + { + "type": "char *", + "name": "path" + } + ] + } + ], [ "git_off_t", { @@ -780,6 +1384,14 @@ { "type": "git_merge_options", "name": "merge_options" + }, + { + "type": "git_commit_signing_cb", + "name": "signing_cb" + }, + { + "type": "void *", + "name": "payload" } ], "used": { @@ -819,11 +1431,11 @@ "name": "certificate_check" }, { - "type": "git_transfer_progress_cb", + "type": "git_indexer_progress_cb", "name": "transfer_progress" }, { - "type": "git_push_transfer_progress", + "type": "git_push_transfer_progress_cb", "name": "push_transfer_progress", "isCallback": true }, @@ -839,6 +1451,10 @@ { "type": "void *", "name": "payload" + }, + { + "type": "git_url_resolve_cb", + "name": "resolve_url" } ], "used": { @@ -848,6 +1464,39 @@ } } ], + [ + "git_remote_create_options", + { + "type": "struct", + "fields": [ + { + "type": "unsigned int", + "name": "version" + }, + { + "type": "git_repository *", + "name": "repository" + }, + { + "type": "const char *", + "name": "name" + }, + { + "type": "const char *", + "name": "fetchspec" + }, + { + "type": "unsigned int", + "name": "flags" + } + ], + "used": { + "needs": [ + "git_remote_create_init_options" + ] + } + } + ], [ "git_remote_head", { @@ -882,46 +1531,74 @@ } ], [ - "git_time_t", - { - "type": "enum" - } - ], - [ - "git_trace_level_t", + "git_path_gitfile", { - "type": "enum" + "type": "enum", + "fields": [ + { + "type": "int", + "name": "GIT_PATH_GITFILE_GITIGNORE", + "value": 0 + }, + { + "type": "int", + "name": "GIT_PATH_GITFILE_GITMODULES", + "value": 1 + }, + { + "type": "int", + "name": "GIT_PATH_GITFILE_GITATTRIBUTES", + "value": 1 + } + ] } ], [ - "git_status_options", + "git_stash_apply_progress_t", { - "type": "struct", + "type": "enum", "fields": [ { - "type": "unsigned int", - "name": "version" + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_NONE", + "value": 0 }, { - "type": "git_status_show_t", - "name": "show" + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_LOADING_STASH", + "value": 1 }, { - "type": "git_status_opt_t", - "name": "flags" + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX", + "value": 2 }, { - "type": "git_strarray", - "name": "pathspec" + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED", + "value": 3 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED", + "value": 4 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED", + "value": 5 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED", + "value": 6 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_DONE", + "value": 7 } - ], - "used": { - "needs": [ - "git_status_init_options", - "git_status_foreach_ext", - "git_status_list_new" - ] - } + ] } ], [ @@ -959,7 +1636,7 @@ } ], [ - "git_worktree_add_options", + "git_status_options", { "type": "struct", "fields": [ @@ -968,31 +1645,51 @@ "name": "version" }, { - "type": "int", - "name": "lock" + "type": "git_status_show_t", + "name": "show" + }, + { + "type": "git_status_opt_t", + "name": "flags" + }, + { + "type": "git_strarray", + "name": "pathspec" } - ] + ], + "used": { + "needs": [ + "git_status_init_options", + "git_status_foreach_ext", + "git_status_list_new" + ] + } } ], [ - "git_worktree_prune_t", + "git_time_t", { - "type": "enum", + "type": "enum" + } + ], + [ + "git_trace_level_t", + { + "type": "enum" + } + ], + [ + "git_worktree_add_options", + { + "type": "struct", "fields": [ { "type": "unsigned int", - "name": "git_worktree_prune_valid", - "value": 1 - }, - { - "type": "unsigned int", - "name": "git_worktree_prune_locked", - "value": 2 + "name": "version" }, { - "type": "unsigned int", - "name": "git_worktree_prune_working_tree", - "value": 4 + "type": "int", + "name": "lock" } ] } @@ -1012,6 +1709,29 @@ } ] } + ], + [ + "git_worktree_prune_t", + { + "type": "enum", + "fields": [ + { + "type": "unsigned int", + "name": "git_worktree_prune_valid", + "value": 1 + }, + { + "type": "unsigned int", + "name": "git_worktree_prune_locked", + "value": 2 + }, + { + "type": "unsigned int", + "name": "git_worktree_prune_working_tree", + "value": 4 + } + ] + } ] ] }, @@ -1023,7 +1743,17 @@ "git_annotated_commit_from_ref", "git_annotated_commit_from_revspec", "git_annotated_commit_id", - "git_annotated_commit_lookup" + "git_annotated_commit_lookup", + "git_annotated_commit_ref" + ] + }, + "config": { + "functions": [ + "git_config_iterator_free", + "git_config_iterator_new", + "git_config_iterator_glob_new", + "git_config_multivar_iterator_new", + "git_config_next" ] }, "diff": { @@ -1035,11 +1765,33 @@ "git_diff_stats_free" ] }, + "index": { + "functions": [ + "git_index_conflict_iterator_free", + "git_index_conflict_iterator_new", + "git_index_conflict_next", + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next", + "git_index_name_add", + "git_index_name_clear", + "git_index_name_entrycount", + "git_index_name_get_byindex", + "git_index_reuc_add", + "git_index_reuc_clear", + "git_index_reuc_entrycount", + "git_index_reuc_find", + "git_index_reuc_get_byindex", + "git_index_reuc_get_bypath", + "git_index_reuc_remove" + ] + }, "merge": { "functions": [ "git_merge_driver_lookup", "git_merge_driver_register", "git_merge_driver_source_ancestor", + "git_merge_driver_source_file_options", "git_merge_driver_source_ours", "git_merge_driver_source_repo", "git_merge_driver_source_theirs", @@ -1059,6 +1811,10 @@ }, "odb": { "functions": [ + "git_odb_backend_loose", + "git_odb_backend_malloc", + "git_odb_backend_one_pack", + "git_odb_backend_pack", "git_odb_object_data", "git_odb_object_dup", "git_odb_object_free", @@ -1090,6 +1846,8 @@ }, "reflog": { "functions": [ + "git_reflog_entry__alloc", + "git_reflog_entry__free", "git_reflog_entry_committer", "git_reflog_entry_id_new", "git_reflog_entry_id_old", @@ -1117,12 +1875,5 @@ ] } }, - "groups": { - "branch": [ - "git_branch_remote_name" - ], - "stash": [ - "git_stash_save" - ] - } + "groups": {} } diff --git a/generate/scripts/generateNativeCode.js b/generate/scripts/generateNativeCode.js index 95e0ab875..44f0501a9 100644 --- a/generate/scripts/generateNativeCode.js +++ b/generate/scripts/generateNativeCode.js @@ -50,11 +50,18 @@ module.exports = function generateNativeCode() { var filters = { and: require("../templates/filters/and"), argsInfo: require("../templates/filters/args_info"), + arrayTypeToPlainType: require("../templates/filters/array_type_to_plain_type"), + asElementPointer: require("../templates/filters/as_element_pointer"), + callbackArgsInfo: require("../templates/filters/callback_args_info"), + callbackArgsCount: require("../templates/filters/callback_args_count"), cppToV8: require("../templates/filters/cpp_to_v8"), defaultValue: require("../templates/filters/default_value"), fieldsInfo: require("../templates/filters/fields_info"), + getCPPFunctionForRootProto: require("../templates/filters/get_cpp_function_for_root_proto"), + hasFunctionOnRootProto: require("../templates/filters/has_function_on_root_proto"), hasReturnType: require("../templates/filters/has_return_type"), hasReturnValue: require("../templates/filters/has_return_value"), + isArrayType: require("../templates/filters/is_array_type"), isDoublePointer: require("../templates/filters/is_double_pointer"), isFixedLengthString: require("../templates/filters/is_fixed_length_string"), isOid: require("../templates/filters/is_oid"), @@ -70,6 +77,7 @@ module.exports = function generateNativeCode() { subtract: require("../templates/filters/subtract"), titleCase: require("../templates/filters/title_case"), toBool: require('../templates/filters/to_bool'), + toSizeOfArray: require("../templates/filters/to_size_of_array"), unPointer: require("../templates/filters/un_pointer"), setUnsigned: require("../templates/filters/unsigned"), upper: require("../templates/filters/upper") diff --git a/generate/scripts/helpers.js b/generate/scripts/helpers.js index b9a67dc06..3a8daaaa2 100644 --- a/generate/scripts/helpers.js +++ b/generate/scripts/helpers.js @@ -40,6 +40,7 @@ var Helpers = { .replace("struct", "") .replace(utils.doublePointerRegex, "") .replace(utils.pointerRegex, "") + .replace(utils.arrayTypeRegex, "") .trim(); }, @@ -68,12 +69,13 @@ var Helpers = { }, isConstructorFunction: function(cType, fnName) { - var initFnName = cType.split('_'); + var deprecatedInitFnName = cType.split("_"); + deprecatedInitFnName.splice(-1, 0, "init"); + deprecatedInitFnName = deprecatedInitFnName.join("_"); - initFnName.splice(-1, 0, "init"); - initFnName = initFnName.join('_'); + var initFnName = cType + "_init"; - return initFnName === fnName; + return initFnName === fnName || deprecatedInitFnName === fnName; }, hasConstructor: function(type, normalizedType) { diff --git a/generate/scripts/utils.js b/generate/scripts/utils.js index e618a954a..078ccf41e 100644 --- a/generate/scripts/utils.js +++ b/generate/scripts/utils.js @@ -9,6 +9,7 @@ const path = require("path"); var local = path.join.bind(null, __dirname, "../"); var util = { + arrayTypeRegex: /\s\[\d+\]\s*/, pointerRegex: /\s*\*\s*/, doublePointerRegex: /\s*\*\*\s*/, diff --git a/generate/templates/filters/array_type_to_plain_type.js b/generate/templates/filters/array_type_to_plain_type.js new file mode 100644 index 000000000..55f283350 --- /dev/null +++ b/generate/templates/filters/array_type_to_plain_type.js @@ -0,0 +1,3 @@ +module.exports = function(cType) { + return /(.*)\s\[\d+\]\s*/.exec(cType)[1]; +}; diff --git a/generate/templates/filters/as_element_pointer.js b/generate/templates/filters/as_element_pointer.js new file mode 100644 index 000000000..8b34eed17 --- /dev/null +++ b/generate/templates/filters/as_element_pointer.js @@ -0,0 +1,7 @@ +const isArrayType = require("./is_array_type"); + +module.exports = function(cType, parsedName) { + return isArrayType(cType) ? + "&" + parsedName + "[i]" : + parsedName; +}; diff --git a/generate/templates/filters/callback_args_count.js b/generate/templates/filters/callback_args_count.js new file mode 100644 index 000000000..26c7762ea --- /dev/null +++ b/generate/templates/filters/callback_args_count.js @@ -0,0 +1,18 @@ +module.exports = function(args) { + if (!args) { + return 0; + } + + return args.reduce( + function(count, arg) { + var shouldCount = !arg.isReturn && + !arg.isSelf && + arg.name !== "payload" && + arg.name !== "self" && + !arg.ignore; + + return shouldCount ? count + 1 : count; + }, + 0 + ); +}; diff --git a/generate/templates/filters/callback_args_info.js b/generate/templates/filters/callback_args_info.js new file mode 100644 index 000000000..a7285c0b8 --- /dev/null +++ b/generate/templates/filters/callback_args_info.js @@ -0,0 +1,27 @@ +module.exports = function(args) { + var result = args.reduce( + function(argList, arg) { + var useArg = !arg.isReturn && + !arg.isSelf && + arg.name !== "payload" && + arg.name !== "self" && + !arg.ignore; + + if (!useArg) { + return argList; + } + + arg.firstArg = argList.length === 0; + argList.push(arg); + + return argList; + }, + [] + ); + + if (result.length) { + result[result.length - 1].lastArg = true; + } + + return result; +}; diff --git a/generate/templates/filters/get_cpp_function_for_root_proto.js b/generate/templates/filters/get_cpp_function_for_root_proto.js new file mode 100644 index 000000000..6571af880 --- /dev/null +++ b/generate/templates/filters/get_cpp_function_for_root_proto.js @@ -0,0 +1,12 @@ +module.exports = function(functions) { + if (!functions || functions.length === 0) { + throw new Error("Should not be able to get function from empty function list"); + } + + const fun = functions.find(function(f) { return f.useAsOnRootProto; }); + if (!fun) { + throw new Error("There is no function on the root prototype for this collection"); + } + + return fun.cppFunctionName; +}; diff --git a/generate/templates/filters/has_function_on_root_proto.js b/generate/templates/filters/has_function_on_root_proto.js new file mode 100644 index 000000000..626ce0ff6 --- /dev/null +++ b/generate/templates/filters/has_function_on_root_proto.js @@ -0,0 +1,7 @@ +module.exports = function(functions) { + if (!functions || functions.length === 0) { + return false; + } + + return functions.some(function(f) { return f.useAsOnRootProto; }); +}; diff --git a/generate/templates/filters/is_array_type.js b/generate/templates/filters/is_array_type.js new file mode 100644 index 000000000..d633d9e40 --- /dev/null +++ b/generate/templates/filters/is_array_type.js @@ -0,0 +1,3 @@ +module.exports = function(cType) { + return /\s\[\d+\]\s*/.test(cType); +}; diff --git a/generate/templates/filters/js_args_count.js b/generate/templates/filters/js_args_count.js index 5be437f41..17a56a1c1 100644 --- a/generate/templates/filters/js_args_count.js +++ b/generate/templates/filters/js_args_count.js @@ -5,11 +5,11 @@ module.exports = function(args) { if (!args) { return 0; } - + for(cArg = 0, jsArg = 0; cArg < args.length; cArg++) { var arg = args[cArg]; - if (!arg.isReturn && !arg.isSelf && !arg.isPayload) { + if (!arg.isReturn && !arg.isSelf) { jsArg++; } } diff --git a/generate/templates/filters/to_size_of_array.js b/generate/templates/filters/to_size_of_array.js new file mode 100644 index 000000000..b56e9315f --- /dev/null +++ b/generate/templates/filters/to_size_of_array.js @@ -0,0 +1,3 @@ +module.exports = function(cType) { + return /\s\[(\d+)\]\s*/.exec(cType)[1]; +}; diff --git a/generate/templates/manual/clone/clone.cc b/generate/templates/manual/clone/clone.cc index 7ddcd559b..a7ac262dc 100644 --- a/generate/templates/manual/clone/clone.cc +++ b/generate/templates/manual/clone/clone.cc @@ -33,7 +33,7 @@ NAN_METHOD(GitClone::Clone) { // start convert_from_v8 block const char *from_url = NULL; - String::Utf8Value url(info[0]->ToString()); + Nan::Utf8String url(Nan::To(info[0]).ToLocalChecked()); // malloc with one extra byte so we can add the terminating null character // C-strings expect: from_url = (const char *)malloc(url.length() + 1); @@ -50,7 +50,7 @@ NAN_METHOD(GitClone::Clone) { // start convert_from_v8 block const char *from_local_path = NULL; - String::Utf8Value local_path(info[1]->ToString()); + Nan::Utf8String local_path(Nan::To(info[1]).ToLocalChecked()); // malloc with one extra byte so we can add the terminating null character // C-strings expect: from_local_path = (const char *)malloc(local_path.length() + 1); @@ -67,7 +67,7 @@ NAN_METHOD(GitClone::Clone) { // start convert_from_v8 block const git_clone_options *from_options = NULL; if (info[2]->IsObject()) { - from_options = Nan::ObjectWrap::Unwrap(info[2]->ToObject()) + from_options = Nan::ObjectWrap::Unwrap(Nan::To(info[2]).ToLocalChecked()) ->GetValue(); } else { from_options = 0; @@ -80,18 +80,18 @@ NAN_METHOD(GitClone::Clone) { CloneWorker *worker = new CloneWorker(baton, callback); if (!info[0]->IsUndefined() && !info[0]->IsNull()) - worker->SaveToPersistent("url", info[0]->ToObject()); + worker->SaveToPersistent("url", Nan::To(info[0]).ToLocalChecked()); if (!info[1]->IsUndefined() && !info[1]->IsNull()) - worker->SaveToPersistent("local_path", info[1]->ToObject()); + worker->SaveToPersistent("local_path", Nan::To(info[1]).ToLocalChecked()); if (!info[2]->IsUndefined() && !info[2]->IsNull()) - worker->SaveToPersistent("options", info[2]->ToObject()); + worker->SaveToPersistent("options", Nan::To(info[2]).ToLocalChecked()); AsyncLibgit2QueueWorker(worker); return; } void GitClone::CloneWorker::Execute() { - giterr_clear(); + git_error_clear(); { LockMaster lockMaster( @@ -113,8 +113,8 @@ void GitClone::CloneWorker::Execute() { baton->error_code = result; - if (result != GIT_OK && giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); + if (result != GIT_OK && git_error_last() != NULL) { + baton->error = git_error_dup(git_error_last()); } } } @@ -140,12 +140,12 @@ void GitClone::CloneWorker::HandleOKCallback() { if (baton->error) { v8::Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method clone has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method clone has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Clone.clone").ToLocalChecked()); v8::Local argv[1] = {err}; callback->Call(1, argv, async_resource); @@ -168,24 +168,24 @@ void GitClone::CloneWorker::HandleOKCallback() { continue; } - v8::Local nodeObj = node->ToObject(); + v8::Local nodeObj = Nan::To(node).ToLocalChecked(); v8::Local checkValue = GetPrivate( nodeObj, Nan::New("NodeGitPromiseError").ToLocalChecked()); if (!checkValue.IsEmpty() && !checkValue->IsNull() && !checkValue->IsUndefined()) { - v8::Local argv[1] = {checkValue->ToObject()}; + v8::Local argv[1] = {Nan::To(checkValue).ToLocalChecked()}; callback->Call(1, argv, async_resource); callbackFired = true; break; } - v8::Local properties = nodeObj->GetPropertyNames(); + v8::Local properties = Nan::GetPropertyNames(nodeObj).ToLocalChecked(); for (unsigned int propIndex = 0; propIndex < properties->Length(); ++propIndex) { v8::Local propName = - properties->Get(propIndex)->ToString(); - v8::Local nodeToQueue = nodeObj->Get(propName); + Nan::To(Nan::Get(properties, propIndex).ToLocalChecked()).ToLocalChecked(); + v8::Local nodeToQueue = Nan::Get(nodeObj, propName).ToLocalChecked(); if (!nodeToQueue->IsUndefined()) { workerArguments.push(nodeToQueue); } @@ -194,10 +194,10 @@ void GitClone::CloneWorker::HandleOKCallback() { if (!callbackFired) { v8::Local err = - Nan::Error("Method clone has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), + Nan::To(Nan::Error("Method clone has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Clone.clone").ToLocalChecked()); v8::Local argv[1] = {err}; callback->Call(1, argv, async_resource); diff --git a/generate/templates/manual/commit/extract_signature.cc b/generate/templates/manual/commit/extract_signature.cc index 911a31eef..e96d0cc7f 100644 --- a/generate/templates/manual/commit/extract_signature.cc +++ b/generate/templates/manual/commit/extract_signature.cc @@ -28,28 +28,28 @@ NAN_METHOD(GitCommit::ExtractSignature) baton->error = NULL; baton->signature = GIT_BUF_INIT_CONST(NULL, 0); baton->signed_data = GIT_BUF_INIT_CONST(NULL, 0); - baton->repo = Nan::ObjectWrap::Unwrap(info[0]->ToObject())->GetValue(); + baton->repo = Nan::ObjectWrap::Unwrap(Nan::To(info[0]).ToLocalChecked())->GetValue(); // baton->commit_id if (info[1]->IsString()) { - String::Utf8Value oidString(info[1]->ToString()); + Nan::Utf8String oidString(Nan::To(info[1]).ToLocalChecked()); baton->commit_id = (git_oid *)malloc(sizeof(git_oid)); if (git_oid_fromstr(baton->commit_id, (const char *)strdup(*oidString)) != GIT_OK) { free(baton->commit_id); - if (giterr_last()) { - return Nan::ThrowError(giterr_last()->message); + if (git_error_last()) { + return Nan::ThrowError(git_error_last()->message); } else { return Nan::ThrowError("Unknown Error"); } } } else { - baton->commit_id = Nan::ObjectWrap::Unwrap(info[1]->ToObject())->GetValue(); + baton->commit_id = Nan::ObjectWrap::Unwrap(Nan::To(info[1]).ToLocalChecked())->GetValue(); } // baton->field if (info[2]->IsString()) { - String::Utf8Value field(info[2]->ToString()); + Nan::Utf8String field(Nan::To(info[2]).ToLocalChecked()); baton->field = (char *)malloc(field.length() + 1); memcpy((void *)baton->field, *field, field.length()); baton->field[field.length()] = 0; @@ -65,15 +65,15 @@ NAN_METHOD(GitCommit::ExtractSignature) } ExtractSignatureWorker *worker = new ExtractSignatureWorker(baton, callback); - worker->SaveToPersistent("repo", info[0]->ToObject()); - worker->SaveToPersistent("commit_id", info[1]->ToObject()); + worker->SaveToPersistent("repo", Nan::To(info[0]).ToLocalChecked()); + worker->SaveToPersistent("commit_id", Nan::To(info[1]).ToLocalChecked()); Nan::AsyncQueueWorker(worker); return; } void GitCommit::ExtractSignatureWorker::Execute() { - giterr_clear(); + git_error_clear(); { LockMaster lockMaster( @@ -89,8 +89,8 @@ void GitCommit::ExtractSignatureWorker::Execute() (const char *)baton->field ); - if (baton->error_code != GIT_OK && giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); + if (baton->error_code != GIT_OK && git_error_last() != NULL) { + baton->error = git_error_dup(git_error_last()); } } } @@ -132,9 +132,9 @@ void GitCommit::ExtractSignatureWorker::HandleOKCallback() } else if (baton->error_code < 0) { - Local err = Nan::Error("Extract Signature has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("Commit.extractSignature").ToLocalChecked()); + Local err = Nan::To(Nan::Error("Extract Signature has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Commit.extractSignature").ToLocalChecked()); Local argv[1] = { err }; @@ -145,8 +145,8 @@ void GitCommit::ExtractSignatureWorker::HandleOKCallback() callback->Call(0, NULL, async_resource); } - git_buf_free(&baton->signature); - git_buf_free(&baton->signed_data); + git_buf_dispose(&baton->signature); + git_buf_dispose(&baton->signed_data); if (baton->field != NULL) { free((void *)baton->field); diff --git a/generate/templates/manual/filter_list/load.cc b/generate/templates/manual/filter_list/load.cc index 1e7788e65..fd02a44e6 100644 --- a/generate/templates/manual/filter_list/load.cc +++ b/generate/templates/manual/filter_list/load.cc @@ -47,14 +47,14 @@ NAN_METHOD(GitFilterList::Load) { // start convert_from_v8 block git_repository *from_repo = NULL; from_repo = - Nan::ObjectWrap::Unwrap(info[0]->ToObject())->GetValue(); + Nan::ObjectWrap::Unwrap(Nan::To(info[0]).ToLocalChecked())->GetValue(); // end convert_from_v8 block baton->repo = from_repo; // start convert_from_v8 block git_blob *from_blob = NULL; if (info[1]->IsObject()) { from_blob = - Nan::ObjectWrap::Unwrap(info[1]->ToObject())->GetValue(); + Nan::ObjectWrap::Unwrap(Nan::To(info[1]).ToLocalChecked())->GetValue(); } else { from_blob = 0; } @@ -63,7 +63,7 @@ NAN_METHOD(GitFilterList::Load) { // start convert_from_v8 block const char *from_path = NULL; - String::Utf8Value path(info[2]->ToString()); + Nan::Utf8String path(Nan::To(info[2]).ToLocalChecked()); // malloc with one extra byte so we can add the terminating null character // C-strings expect: from_path = (const char *)malloc(path.length() + 1); @@ -93,22 +93,22 @@ NAN_METHOD(GitFilterList::Load) { LoadWorker *worker = new LoadWorker(baton, callback); if (!info[0]->IsUndefined() && !info[0]->IsNull()) - worker->SaveToPersistent("repo", info[0]->ToObject()); + worker->SaveToPersistent("repo", Nan::To(info[0]).ToLocalChecked()); if (!info[1]->IsUndefined() && !info[1]->IsNull()) - worker->SaveToPersistent("blob", info[1]->ToObject()); + worker->SaveToPersistent("blob", Nan::To(info[1]).ToLocalChecked()); if (!info[2]->IsUndefined() && !info[2]->IsNull()) - worker->SaveToPersistent("path", info[2]->ToObject()); + worker->SaveToPersistent("path", Nan::To(info[2]).ToLocalChecked()); if (!info[3]->IsUndefined() && !info[3]->IsNull()) - worker->SaveToPersistent("mode", info[3]->ToObject()); + worker->SaveToPersistent("mode", Nan::To(info[3]).ToLocalChecked()); if (!info[4]->IsUndefined() && !info[4]->IsNull()) - worker->SaveToPersistent("flags", info[4]->ToObject()); + worker->SaveToPersistent("flags", Nan::To(info[4]).ToLocalChecked()); AsyncLibgit2QueueWorker(worker); return; } void GitFilterList::LoadWorker::Execute() { - giterr_clear(); + git_error_clear(); { LockMaster lockMaster( @@ -119,8 +119,8 @@ void GitFilterList::LoadWorker::Execute() { baton->error_code = result; - if (result != GIT_OK && giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); + if (result != GIT_OK && git_error_last() != NULL) { + baton->error = git_error_dup(git_error_last()); } } } @@ -134,17 +134,17 @@ void GitFilterList::LoadWorker::HandleOKCallback() { // GitFilterList baton->filters v8::Local owners = Nan::New(0); v8::Local filterRegistry = Nan::New(GitFilterRegistry::persistentHandle); - v8::Local propertyNames = filterRegistry->GetPropertyNames(); + v8::Local propertyNames = Nan::GetPropertyNames(filterRegistry).ToLocalChecked(); Nan::Set( owners, Nan::New(0), - this->GetFromPersistent("repo")->ToObject() + Nan::To(this->GetFromPersistent("repo")).ToLocalChecked() ); for (uint32_t index = 0; index < propertyNames->Length(); ++index) { - v8::Local propertyName = propertyNames->Get(index)->ToString(); - String::Utf8Value propertyNameAsUtf8Value(propertyName); + v8::Local propertyName = Nan::To(Nan::Get(propertyNames, index).ToLocalChecked()).ToLocalChecked(); + Nan::Utf8String propertyNameAsUtf8Value(propertyName); const char *propertyNameAsCString = *propertyNameAsUtf8Value; bool isNotMethodOnRegistry = strcmp("register", propertyNameAsCString) @@ -153,12 +153,12 @@ void GitFilterList::LoadWorker::HandleOKCallback() { Nan::Set( owners, Nan::New(owners->Length()), - filterRegistry->Get(propertyName) + Nan::Get(filterRegistry, propertyName).ToLocalChecked() ); } } - to = GitFilterList::New(baton->filters, true, owners->ToObject()); + to = GitFilterList::New(baton->filters, true, Nan::To(owners).ToLocalChecked()); } else { to = Nan::Null(); } @@ -172,12 +172,12 @@ void GitFilterList::LoadWorker::HandleOKCallback() { if (baton->error) { v8::Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method load has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method load has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterList.load").ToLocalChecked()); v8::Local argv[1] = {err}; callback->Call(1, argv, async_resource); @@ -202,24 +202,24 @@ void GitFilterList::LoadWorker::HandleOKCallback() { continue; } - v8::Local nodeObj = node->ToObject(); + v8::Local nodeObj = Nan::To(node).ToLocalChecked(); v8::Local checkValue = GetPrivate( nodeObj, Nan::New("NodeGitPromiseError").ToLocalChecked()); if (!checkValue.IsEmpty() && !checkValue->IsNull() && !checkValue->IsUndefined()) { - v8::Local argv[1] = {checkValue->ToObject()}; + v8::Local argv[1] = {Nan::To(checkValue).ToLocalChecked()}; callback->Call(1, argv, async_resource); callbackFired = true; break; } - v8::Local properties = nodeObj->GetPropertyNames(); + v8::Local properties = Nan::GetPropertyNames(nodeObj).ToLocalChecked(); for (unsigned int propIndex = 0; propIndex < properties->Length(); ++propIndex) { v8::Local propName = - properties->Get(propIndex)->ToString(); - v8::Local nodeToQueue = nodeObj->Get(propName); + Nan::To(Nan::Get(properties, propIndex).ToLocalChecked()).ToLocalChecked(); + v8::Local nodeToQueue = Nan::Get(nodeObj, propName).ToLocalChecked(); if (!nodeToQueue->IsUndefined()) { workerArguments.push(nodeToQueue); } @@ -228,10 +228,10 @@ void GitFilterList::LoadWorker::HandleOKCallback() { if (!callbackFired) { v8::Local err = - Nan::Error("Method load has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), + Nan::To(Nan::Error("Method load has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterList.load").ToLocalChecked()); v8::Local argv[1] = {err}; callback->Call(1, argv, async_resource); diff --git a/generate/templates/manual/filter_source/repo.cc b/generate/templates/manual/filter_source/repo.cc new file mode 100644 index 000000000..57c2a07f7 --- /dev/null +++ b/generate/templates/manual/filter_source/repo.cc @@ -0,0 +1,90 @@ +// NOTE you may need to occasionally rebuild this method by calling the generators +// if major changes are made to the templates / generator. + +// Due to some garbage collection issues related to submodules and git_filters, we need to clone the repository +// pointer before giving it to a user. + +/* + * @param Repository callback + */ +NAN_METHOD(GitFilterSource::Repo) { + if (info.Length() == 0 || !info[0]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + RepoBaton *baton = new RepoBaton; + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->src = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(v8::Local::Cast(info[0])); + RepoWorker *worker = new RepoWorker(baton, callback); + + worker->SaveToPersistent("src", info.This()); + + AsyncLibgit2QueueWorker(worker); + return; +} + +void GitFilterSource::RepoWorker::Execute() { + git_error_clear(); + + { + LockMaster lockMaster(true, baton->src); + + git_repository *repo = git_filter_source_repo(baton->src); + baton->error_code = git_repository_open(&repo, git_repository_path(repo)); + + if (baton->error_code == GIT_OK) { + baton->out = repo; + } else if (git_error_last() != NULL) { + baton->error = git_error_dup(git_error_last()); + } + } +} + +void GitFilterSource::RepoWorker::HandleOKCallback() { + if (baton->error_code == GIT_OK) { + v8::Local to; + + if (baton->out != NULL) { + to = GitRepository::New(baton->out, true); + } else { + to = Nan::Null(); + } + + v8::Local argv[2] = {Nan::Null(), to}; + callback->Call(2, argv, async_resource); + } else { + if (baton->error) { + v8::Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method repo has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("FilterSource.repo").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + if (baton->error->message) + free((void *)baton->error->message); + free((void *)baton->error); + } else if (baton->error_code < 0) { + v8::Local err = + Nan::To(Nan::Error("Method repo has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), + Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("FilterSource.repo").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + } else { + callback->Call(0, NULL, async_resource); + } + } + + delete baton; +} diff --git a/generate/templates/manual/include/str_array_converter.h b/generate/templates/manual/include/str_array_converter.h index 37f1bcc1d..26a82479d 100644 --- a/generate/templates/manual/include/str_array_converter.h +++ b/generate/templates/manual/include/str_array_converter.h @@ -14,8 +14,8 @@ class StrArrayConverter { static git_strarray *Convert (v8::Local val); private: - static git_strarray *ConvertArray(Array *val); - static git_strarray *ConvertString(v8::Local val); + static git_strarray *ConvertArray(v8::Local val); + static git_strarray *ConvertString(v8::Local val); static git_strarray *AllocStrArray(const size_t count); static git_strarray *ConstructStrArray(int argc, char** argv); }; diff --git a/generate/templates/manual/patches/convenient_patches.cc b/generate/templates/manual/patches/convenient_patches.cc index c7facba4e..795dca506 100644 --- a/generate/templates/manual/patches/convenient_patches.cc +++ b/generate/templates/manual/patches/convenient_patches.cc @@ -12,7 +12,7 @@ NAN_METHOD(GitPatch::ConvenientFromDiff) { baton->error_code = GIT_OK; baton->error = NULL; - baton->diff = Nan::ObjectWrap::Unwrap(info[0]->ToObject())->GetValue(); + baton->diff = Nan::ObjectWrap::Unwrap(Nan::To(info[0]).ToLocalChecked())->GetValue(); baton->out = new std::vector; baton->out->reserve(git_diff_num_deltas(baton->diff)); @@ -26,7 +26,7 @@ NAN_METHOD(GitPatch::ConvenientFromDiff) { } void GitPatch::ConvenientFromDiffWorker::Execute() { - giterr_clear(); + git_error_clear(); { LockMaster lockMaster(true, baton->diff); @@ -50,8 +50,8 @@ void GitPatch::ConvenientFromDiffWorker::Execute() { baton->error_code = result; - if (giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); + if (git_error_last() != NULL) { + baton->error = git_error_dup(git_error_last()); } delete baton->out; @@ -97,12 +97,12 @@ void GitPatch::ConvenientFromDiffWorker::HandleOKCallback() { if (baton->error) { Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method convenientFromDiff has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method convenientFromDiff has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("Patch.convenientFromDiff").ToLocalChecked()); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Patch.convenientFromDiff").ToLocalChecked()); Local argv[1] = { err }; @@ -118,9 +118,9 @@ void GitPatch::ConvenientFromDiffWorker::HandleOKCallback() { } if (baton->error_code < 0) { - Local err = Nan::Error("method convenientFromDiff has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("Patch.convenientFromDiff").ToLocalChecked()); + Local err = Nan::To(Nan::Error("method convenientFromDiff has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Patch.convenientFromDiff").ToLocalChecked()); Local argv[1] = { err }; @@ -129,5 +129,5 @@ void GitPatch::ConvenientFromDiffWorker::HandleOKCallback() { return; } - callback->Call(0, NULL); + Nan::Call(*callback, 0, NULL); } diff --git a/generate/templates/manual/remote/ls.cc b/generate/templates/manual/remote/ls.cc index 605447b10..8816e0150 100644 --- a/generate/templates/manual/remote/ls.cc +++ b/generate/templates/manual/remote/ls.cc @@ -20,7 +20,7 @@ NAN_METHOD(GitRemote::ReferenceList) void GitRemote::ReferenceListWorker::Execute() { - giterr_clear(); + git_error_clear(); { LockMaster lockMaster( @@ -37,7 +37,7 @@ void GitRemote::ReferenceListWorker::Execute() ); if (baton->error_code != GIT_OK) { - baton->error = git_error_dup(giterr_last()); + baton->error = git_error_dup(git_error_last()); delete baton->out; baton->out = NULL; return; @@ -85,9 +85,9 @@ void GitRemote::ReferenceListWorker::HandleOKCallback() } else if (baton->error_code < 0) { - Local err = Nan::Error("Reference List has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("Remote.referenceList").ToLocalChecked()); + Local err = Nan::To(Nan::Error("Reference List has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Remote.referenceList").ToLocalChecked()); Local argv[1] = { err }; diff --git a/generate/templates/manual/repository/get_references.cc b/generate/templates/manual/repository/get_references.cc new file mode 100644 index 000000000..8f03d60e1 --- /dev/null +++ b/generate/templates/manual/repository/get_references.cc @@ -0,0 +1,133 @@ +NAN_METHOD(GitRepository::GetReferences) +{ + if (info.Length() == 0 || !info[0]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + GetReferencesBaton* baton = new GetReferencesBaton; + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->out = new std::vector; + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[0])); + GetReferencesWorker *worker = new GetReferencesWorker(baton, callback); + worker->SaveToPersistent("repo", info.This()); + Nan::AsyncQueueWorker(worker); + return; +} + +void GitRepository::GetReferencesWorker::Execute() +{ + giterr_clear(); + + LockMaster lockMaster(true, baton->repo); + git_repository *repo = baton->repo; + + git_strarray reference_names; + baton->error_code = git_reference_list(&reference_names, repo); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + delete baton->out; + baton->out = NULL; + return; + } + + for (size_t reference_index = 0; reference_index < reference_names.count; ++reference_index) { + git_reference *reference; + baton->error_code = git_reference_lookup(&reference, repo, reference_names.strings[reference_index]); + + // stop execution and return if there is an error + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + // unwind and return + while (baton->out->size()) { + git_reference *referenceToFree = baton->out->back(); + baton->out->pop_back(); + git_reference_free(referenceToFree); + } + + git_strarray_free(&reference_names); + git_repository_free(repo); + delete baton->out; + baton->out = NULL; + return; + } + + if (git_reference_type(reference) == GIT_REF_SYMBOLIC) { + git_reference *resolved_reference; + int resolve_result = git_reference_resolve(&resolved_reference, reference); + git_reference_free(reference); + + // if we can't resolve the ref, then just ignore it + if (resolve_result == GIT_OK) { + baton->out->push_back(resolved_reference); + } + } else { + baton->out->push_back(reference); + } + } +} + +void GitRepository::GetReferencesWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + unsigned int size = baton->out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + git_reference *reference = baton->out->at(i); + Nan::Set( + result, + Nan::New(i), + GitRefs::New( + reference, + true, + Nan::To(GitRepository::New(git_reference_owner(reference), true)).ToLocalChecked() + ) + ); + } + + delete baton->out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Repository getReferences has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Repository.getReferences").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } +} diff --git a/generate/templates/manual/repository/get_remotes.cc b/generate/templates/manual/repository/get_remotes.cc new file mode 100644 index 000000000..9cad189a2 --- /dev/null +++ b/generate/templates/manual/repository/get_remotes.cc @@ -0,0 +1,134 @@ +NAN_METHOD(GitRepository::GetRemotes) +{ + if (info.Length() == 0 || !info[0]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + GetRemotesBaton* baton = new GetRemotesBaton; + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->out = new std::vector; + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[0])); + GetRemotesWorker *worker = new GetRemotesWorker(baton, callback); + worker->SaveToPersistent("repo", info.This()); + Nan::AsyncQueueWorker(worker); + return; +} + +void GitRepository::GetRemotesWorker::Execute() +{ + giterr_clear(); + + git_repository *repo; + { + LockMaster lockMaster(true, baton->repo); + baton->error_code = git_repository_open(&repo, git_repository_workdir(baton->repo)); + } + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + delete baton->out; + baton->out = NULL; + return; + } + + git_strarray remote_names; + baton->error_code = git_remote_list(&remote_names, repo); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + delete baton->out; + baton->out = NULL; + return; + } + + for (size_t remote_index = 0; remote_index < remote_names.count; ++remote_index) { + git_remote *remote; + baton->error_code = git_remote_lookup(&remote, repo, remote_names.strings[remote_index]); + + // stop execution and return if there is an error + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + // unwind and return + while (baton->out->size()) { + git_remote *remoteToFree = baton->out->back(); + baton->out->pop_back(); + git_remote_free(remoteToFree); + } + + git_strarray_free(&remote_names); + git_repository_free(repo); + delete baton->out; + baton->out = NULL; + return; + } + + baton->out->push_back(remote); + } +} + +void GitRepository::GetRemotesWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + unsigned int size = baton->out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + git_remote *remote = baton->out->at(i); + Nan::Set( + result, + Nan::New(i), + GitRemote::New( + remote, + true, + Nan::To(GitRepository::New(git_remote_owner(remote), true)).ToLocalChecked() + ) + ); + } + + delete baton->out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Repository refreshRemotes has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Repository.refreshRemotes").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } +} diff --git a/generate/templates/manual/repository/get_submodules.cc b/generate/templates/manual/repository/get_submodules.cc new file mode 100644 index 000000000..71de6948c --- /dev/null +++ b/generate/templates/manual/repository/get_submodules.cc @@ -0,0 +1,115 @@ +NAN_METHOD(GitRepository::GetSubmodules) +{ + if (info.Length() == 0 || !info[0]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + GetSubmodulesBaton* baton = new GetSubmodulesBaton; + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->out = new std::vector; + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[0])); + GetSubmodulesWorker *worker = new GetSubmodulesWorker(baton, callback); + worker->SaveToPersistent("repo", info.This()); + Nan::AsyncQueueWorker(worker); + return; +} + +struct submodule_foreach_payload { + git_repository *repo; + std::vector *out; +}; + +int foreachSubmoduleCB(git_submodule *submodule, const char *name, void *void_payload) { + submodule_foreach_payload *payload = (submodule_foreach_payload *)void_payload; + git_submodule *out; + + int result = git_submodule_lookup(&out, payload->repo, name); + if (result == GIT_OK) { + payload->out->push_back(out); + } + + return result; +} + +void GitRepository::GetSubmodulesWorker::Execute() +{ + giterr_clear(); + + LockMaster lockMaster(true, baton->repo); + + submodule_foreach_payload payload { baton->repo, baton->out }; + baton->error_code = git_submodule_foreach(baton->repo, foreachSubmoduleCB, (void *)&payload); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + while (baton->out->size()) { + git_submodule_free(baton->out->back()); + baton->out->pop_back(); + } + delete baton->out; + baton->out = NULL; + } +} + +void GitRepository::GetSubmodulesWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + unsigned int size = baton->out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + git_submodule *submodule = baton->out->at(i); + Nan::Set( + result, + Nan::New(i), + GitSubmodule::New( + submodule, + true, + Nan::To(GitRepository::New(git_submodule_owner(submodule), true)).ToLocalChecked() + ) + ); + } + + delete baton->out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Repository getSubmodules has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Repository.getSubmodules").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } +} diff --git a/generate/templates/manual/repository/refresh_references.cc b/generate/templates/manual/repository/refresh_references.cc new file mode 100644 index 000000000..730afadbc --- /dev/null +++ b/generate/templates/manual/repository/refresh_references.cc @@ -0,0 +1,673 @@ +int getOidOfReferenceCommit(git_oid *commitOid, git_reference *ref) { + git_object *commitObject; + int result = git_reference_peel(&commitObject, ref, GIT_OBJ_COMMIT); + + if (result != GIT_OK) { + return result; + } + + git_oid_cpy(commitOid, git_object_id(commitObject)); + git_object_free(commitObject); + return result; +} + +int asDirectReference(git_reference **out, git_reference *ref) { + if (git_reference_type(ref) != GIT_REF_SYMBOLIC) { + return git_reference_dup(out, ref); + } + + int error = git_reference_resolve(out, ref); + if (error != GIT_OK) { + *out = NULL; + } + + return GIT_OK; +} + +int lookupDirectReferenceByShorthand(git_reference **out, git_repository *repo, const char *shorthand) { + git_reference *ref = NULL; + int result = git_reference_dwim(&ref, repo, shorthand); + + if (result != GIT_OK) { + return result; + } + + result = asDirectReference(out, ref); + git_reference_free(ref); + return result; +} + +int lookupDirectReferenceByFullName(git_reference **out, git_repository *repo, const char *fullName) { + git_reference *ref = NULL; + int result = git_reference_lookup(&ref, repo, fullName); + + if (result != GIT_OK) { + return result; + } + + result = asDirectReference(out, ref); + git_reference_free(ref); + return result; +} + +char *getRemoteNameOfReference(git_reference *remoteReference) { + return strtok(strdup(git_reference_shorthand(remoteReference)), "/"); +} + +bool gitStrArrayContains(git_strarray *strarray, const char *string) { + for (size_t i = 0; i < strarray->count; ++i) { + if (strcmp(strarray->strings[i], string) == 0) { + return true; + } + } + return false; +} + +class RefreshedRefModel { +public: + RefreshedRefModel(git_reference *ref): + fullName(strdup(git_reference_name(ref))), + message(NULL), + sha(new char[GIT_OID_HEXSZ + 1]), + shorthand(strdup(git_reference_shorthand(ref))), + tagOdbBuffer(NULL), + tagOdbBufferLength(0), + type(NULL) + { + if (git_reference_is_branch(ref)) { + type = "branch"; + } else if (git_reference_is_remote(ref)) { + type = "remote"; + } else { + type = "tag"; + } + } + + static int fromReference(RefreshedRefModel **out, git_reference *ref, git_odb *odb) { + RefreshedRefModel *refModel = new RefreshedRefModel(ref); + const git_oid *referencedTargetOid = git_reference_target(ref); + + if (!git_reference_is_tag(ref)) { + git_oid_tostr(refModel->sha, GIT_OID_HEXSZ + 1, referencedTargetOid); + + *out = refModel; + return GIT_OK; + } + git_repository *repo = git_reference_owner(ref); + + git_tag *referencedTag; + if (git_tag_lookup(&referencedTag, repo, referencedTargetOid) == GIT_OK) { + refModel->message = strdup(git_tag_message(referencedTag)); + + git_odb_object *tagOdbObject; + if (git_odb_read(&tagOdbObject, odb, git_tag_id(referencedTag)) == GIT_OK) { + refModel->tagOdbBufferLength = git_odb_object_size(tagOdbObject); + refModel->tagOdbBuffer = new char[refModel->tagOdbBufferLength]; + std::memcpy(refModel->tagOdbBuffer, git_odb_object_data(tagOdbObject), refModel->tagOdbBufferLength); + git_odb_object_free(tagOdbObject); + } + + git_tag_free(referencedTag); + } + + git_oid peeledReferencedTargetOid; + int error = getOidOfReferenceCommit(&peeledReferencedTargetOid, ref); + if (error != GIT_OK) { + delete refModel; + return error; + } + + git_oid_tostr(refModel->sha, GIT_OID_HEXSZ + 1, &peeledReferencedTargetOid); + + *out = refModel; + return GIT_OK; + } + + static void ensureSignatureRegexes() { + if (!signatureRegexesBySignatureType.IsEmpty()) { + return; + } + + v8::Local gpgsigArray = Nan::New(2), + x509Array = Nan::New(1); + + Nan::Set( + gpgsigArray, + Nan::New(0), + Nan::New( + Nan::New("-----BEGIN PGP SIGNATURE-----[\\s\\S]+?-----END PGP SIGNATURE-----").ToLocalChecked(), + static_cast(v8::RegExp::Flags::kGlobal | v8::RegExp::Flags::kMultiline) + ).ToLocalChecked() + ); + + Nan::Set( + gpgsigArray, + Nan::New(1), + Nan::New( + Nan::New("-----BEGIN PGP MESSAGE-----[\\s\\S]+?-----END PGP MESSAGE-----").ToLocalChecked(), + static_cast(v8::RegExp::Flags::kGlobal | v8::RegExp::Flags::kMultiline) + ).ToLocalChecked() + ); + + Nan::Set( + x509Array, + Nan::New(0), + Nan::New( + Nan::New("-----BEGIN SIGNED MESSAGE-----[\\s\\S]+?-----END SIGNED MESSAGE-----").ToLocalChecked(), + static_cast(v8::RegExp::Flags::kGlobal | v8::RegExp::Flags::kMultiline) + ).ToLocalChecked() + ); + + v8::Local result = Nan::New(); + Nan::Set(result, Nan::New("gpgsig").ToLocalChecked(), gpgsigArray); + Nan::Set(result, Nan::New("x509").ToLocalChecked(), x509Array); + + signatureRegexesBySignatureType.Reset(result); + } + + v8::Local toJavascript(v8::Local signatureType) { + v8::Local result = Nan::New(); + + v8::Local jsFullName; + if (fullName == NULL) { + jsFullName = Nan::Null(); + } else { + jsFullName = Nan::New(fullName).ToLocalChecked(); + } + Nan::Set(result, Nan::New("fullName").ToLocalChecked(), jsFullName); + + v8::Local jsMessage; + if (message == NULL) { + jsMessage = Nan::Null(); + } else { + jsMessage = Nan::New(message).ToLocalChecked(); + } + Nan::Set(result, Nan::New("message").ToLocalChecked(), jsMessage); + + Nan::Set( + result, + Nan::New("sha").ToLocalChecked(), + Nan::New(sha).ToLocalChecked() + ); + + v8::Local jsShorthand; + if (shorthand == NULL) { + jsShorthand = Nan::Null(); + } else { + jsShorthand = Nan::New(shorthand).ToLocalChecked(); + } + Nan::Set(result, Nan::New("shorthand").ToLocalChecked(), jsShorthand); + + v8::Local jsTagSignature = Nan::Null(); + if (tagOdbBuffer != NULL && tagOdbBufferLength != 0) { + // tagOdbBuffer is already a copy, so we'd like to use NewBuffer instead, + // but we were getting segfaults and couldn't easily figure out why. :( + // We tried passing the tagOdbBuffer directly to NewBuffer and then nullifying tagOdbBuffer so that + // the destructor didn't double free, but that still segfaulted internally in Node. + v8::Local buffer = Nan::CopyBuffer(tagOdbBuffer, tagOdbBufferLength).ToLocalChecked(); + v8::Local toStringProp = Nan::Get(buffer, Nan::New("toString").ToLocalChecked()).ToLocalChecked(); + v8::Local jsTagOdbObjectString = Nan::To(Nan::CallAsFunction(Nan::To(toStringProp).ToLocalChecked(), buffer, 0, NULL).ToLocalChecked()).ToLocalChecked(); + + v8::Local _signatureRegexesBySignatureType = Nan::New(signatureRegexesBySignatureType); + v8::Local signatureRegexes = v8::Local::Cast(Nan::Get(_signatureRegexesBySignatureType, signatureType).ToLocalChecked()); + + for (uint32_t i = 0; i < signatureRegexes->Length(); ++i) { + v8::Local argv[] = { + Nan::Get(signatureRegexes, Nan::New(i)).ToLocalChecked() + }; + + v8::Local matchProp = Nan::Get(jsTagOdbObjectString, Nan::New("match").ToLocalChecked()).ToLocalChecked(); + v8::Local match = Nan::CallAsFunction(Nan::To(matchProp).ToLocalChecked(), jsTagOdbObjectString, 1, argv).ToLocalChecked(); + if (match->IsArray()) { + jsTagSignature = Nan::Get(Nan::To(match).ToLocalChecked(), 0).ToLocalChecked(); + break; + } + } + } + Nan::Set(result, Nan::New("tagSignature").ToLocalChecked(), jsTagSignature); + + v8::Local jsType; + if (type == NULL) { + jsType = Nan::Null(); + } else { + jsType = Nan::New(type).ToLocalChecked(); + } + Nan::Set(result, Nan::New("type").ToLocalChecked(), jsType); + + return result; + } + + ~RefreshedRefModel() { + if (fullName != NULL) { delete[] fullName; } + if (message != NULL) { delete[] message; } + delete[] sha; + if (shorthand != NULL) { delete[] shorthand; } + if (tagOdbBuffer != NULL) { delete[] tagOdbBuffer; } + } + + char *fullName, *message, *sha, *shorthand, *tagOdbBuffer; + size_t tagOdbBufferLength; + const char *type; + static Nan::Persistent signatureRegexesBySignatureType; +}; + +Nan::Persistent RefreshedRefModel::signatureRegexesBySignatureType; + +class UpstreamModel { +public: + UpstreamModel(const char *inputDownstreamFullName, const char *inputUpstreamFullName): + downstreamFullName((char *)strdup(inputDownstreamFullName)), + upstreamFullName((char *)strdup(inputUpstreamFullName)), + ahead(0), + behind(0) {} + + static bool fromReference(UpstreamModel **out, git_reference *ref) { + if (!git_reference_is_branch(ref)) { + return false; + } + + git_reference *upstream; + int result = git_branch_upstream(&upstream, ref); + if (result != GIT_OK) { + return false; + } + + UpstreamModel *upstreamModel = new UpstreamModel( + git_reference_name(ref), + git_reference_name(upstream) + ); + + git_oid localCommitOid; + result = getOidOfReferenceCommit(&localCommitOid, ref); + if (result != GIT_OK) { + delete upstreamModel; + return false; + } + + git_oid upstreamCommitOid; + result = getOidOfReferenceCommit(&upstreamCommitOid, upstream); + if (result != GIT_OK) { + delete upstreamModel; + return false; + } + + result = git_graph_ahead_behind( + &upstreamModel->ahead, + &upstreamModel->behind, + git_reference_owner(ref), + &localCommitOid, + &upstreamCommitOid + ); + + if (result != GIT_OK) { + delete upstreamModel; + return false; + } + + *out = upstreamModel; + return true; + } + + v8::Local toJavascript() { + v8::Local result = Nan::New(); + + v8::Local jsDownstreamFullName; + if (downstreamFullName == NULL) { + jsDownstreamFullName = Nan::Null(); + } else { + jsDownstreamFullName = Nan::New(downstreamFullName).ToLocalChecked(); + } + Nan::Set(result, Nan::New("downstreamFullName").ToLocalChecked(), jsDownstreamFullName); + + v8::Local jsUpstreamFullName; + if (upstreamFullName == NULL) { + jsUpstreamFullName = Nan::Null(); + } else { + jsUpstreamFullName = Nan::New(upstreamFullName).ToLocalChecked(); + } + Nan::Set(result, Nan::New("upstreamFullName").ToLocalChecked(), jsUpstreamFullName); + + Nan::Set(result, Nan::New("ahead").ToLocalChecked(), Nan::New(ahead)); + Nan::Set(result, Nan::New("behind").ToLocalChecked(), Nan::New(behind)); + return result; + } + + ~UpstreamModel() { + if (downstreamFullName != NULL) { delete[] downstreamFullName; } + if (upstreamFullName != NULL) { delete[] upstreamFullName; } + } + + char *downstreamFullName; + char *upstreamFullName; + size_t ahead; + size_t behind; +}; + +class RefreshReferencesData { +public: + RefreshReferencesData(): + headRefFullName(NULL), + cherrypick(NULL), + merge(NULL) {} + + ~RefreshReferencesData() { + while(refs.size()) { + delete refs.back(); + refs.pop_back(); + } + while(upstreamInfo.size()) { + delete upstreamInfo.back(); + upstreamInfo.pop_back(); + } + if (headRefFullName != NULL) { delete[] headRefFullName; } + if (cherrypick != NULL) { delete cherrypick; } + if (merge != NULL) { delete merge; } + } + + std::vector refs; + std::vector upstreamInfo; + char *headRefFullName; + RefreshedRefModel *cherrypick; + RefreshedRefModel *merge; +}; + +NAN_METHOD(GitRepository::RefreshReferences) +{ + v8::Local signatureType; + if (info.Length() == 2) { + if (!info[0]->IsString()) { + return Nan::ThrowError("Signature type must be \"gpgsig\" or \"x509\"."); + } + + v8::Local signatureTypeParam = Nan::To(info[0]).ToLocalChecked(); + if ( + Nan::Equals(signatureTypeParam, Nan::New("gpgsig").ToLocalChecked()) != Nan::Just(true) + && Nan::Equals(signatureTypeParam, Nan::New("x509").ToLocalChecked()) != Nan::Just(true) + ) { + return Nan::ThrowError("Signature type must be \"gpgsig\" or \"x509\"."); + } + signatureType = signatureTypeParam; + } else { + signatureType = Nan::New("gpgsig").ToLocalChecked(); + } + + if (info.Length() == 0 || (info.Length() == 1 && !info[0]->IsFunction()) || (info.Length() == 2 && !info[1]->IsFunction())) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + RefreshReferencesBaton* baton = new RefreshReferencesBaton; + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->out = (void *)new RefreshReferencesData; + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[0])); + RefreshReferencesWorker *worker = new RefreshReferencesWorker(baton, callback); + worker->SaveToPersistent("repo", info.This()); + worker->SaveToPersistent("signatureType", signatureType); + Nan::AsyncQueueWorker(worker); + return; +} + +void GitRepository::RefreshReferencesWorker::Execute() +{ + giterr_clear(); + + LockMaster lockMaster(true, baton->repo); + git_repository *repo = baton->repo; + RefreshReferencesData *refreshData = (RefreshReferencesData *)baton->out; + git_odb *odb; + + baton->error_code = git_repository_odb(&odb, repo); + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + delete refreshData; + baton->out = NULL; + return; + } + + // START Refresh HEAD + git_reference *headRef = NULL; + baton->error_code = lookupDirectReferenceByShorthand(&headRef, repo, "HEAD"); + + if (baton->error_code != GIT_OK || headRef == NULL) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + delete refreshData; + baton->out = NULL; + return; + } + + RefreshedRefModel *headModel; + baton->error_code = RefreshedRefModel::fromReference(&headModel, headRef, odb); + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + git_reference_free(headRef); + delete refreshData; + baton->out = NULL; + return; + } + refreshData->refs.push_back(headModel); + + refreshData->headRefFullName = strdup(git_reference_name(headRef)); + git_reference_free(headRef); + // END Refresh HEAD + + // START Refresh CHERRY_PICK_HEAD + git_reference *cherrypickRef = NULL; + if (lookupDirectReferenceByShorthand(&cherrypickRef, repo, "CHERRY_PICK_HEAD") == GIT_OK && cherrypickRef != NULL) { + baton->error_code = RefreshedRefModel::fromReference(&refreshData->cherrypick, cherrypickRef, odb); + git_reference_free(cherrypickRef); + } else { + cherrypickRef = NULL; + } + // END Refresh CHERRY_PICK_HEAD + + // START Refresh MERGE_HEAD + git_reference *mergeRef = NULL; + // fall through if cherry pick failed + if (baton->error_code == GIT_OK && lookupDirectReferenceByShorthand(&mergeRef, repo, "MERGE_HEAD") == GIT_OK && mergeRef != NULL) { + baton->error_code = RefreshedRefModel::fromReference(&refreshData->merge, mergeRef, odb); + git_reference_free(mergeRef); + } else { + mergeRef = NULL; + } + // END Refresh MERGE_HEAD + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + delete refreshData; + baton->out = NULL; + return; + } + + // Retrieve reference models and upstream info for each reference + git_strarray referenceNames; + baton->error_code = git_reference_list(&referenceNames, repo); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + delete refreshData; + baton->out = NULL; + return; + } + + git_strarray remoteNames; + baton->error_code = git_remote_list(&remoteNames, repo); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + git_strarray_free(&referenceNames); + delete refreshData; + baton->out = NULL; + return; + } + + for (size_t referenceIndex = 0; referenceIndex < referenceNames.count; ++referenceIndex) { + git_reference *reference; + baton->error_code = lookupDirectReferenceByFullName(&reference, repo, referenceNames.strings[referenceIndex]); + + if (baton->error_code != GIT_OK) { + break; + } + if (reference == NULL) { + // lookup found the reference but failed to resolve it directly + continue; + } + + UpstreamModel *upstreamModel; + if (UpstreamModel::fromReference(&upstreamModel, reference)) { + refreshData->upstreamInfo.push_back(upstreamModel); + } + + bool isBranch = git_reference_is_branch(reference); + bool isRemote = git_reference_is_remote(reference); + bool isTag = git_reference_is_tag(reference); + if ( + strcmp(referenceNames.strings[referenceIndex], headModel->fullName) == 0 + || (!isBranch && !isRemote && !isTag) + ) { + git_reference_free(reference); + continue; + } + + if (isRemote) { + char *remoteNameOfRef = getRemoteNameOfReference(reference); + bool isFromExistingRemote = gitStrArrayContains(&remoteNames, remoteNameOfRef); + delete[] remoteNameOfRef; + if (!isFromExistingRemote) { + git_reference_free(reference); + continue; + } + } + + RefreshedRefModel *refreshedRefModel; + baton->error_code = RefreshedRefModel::fromReference(&refreshedRefModel, reference, odb); + git_reference_free(reference); + + if (baton->error_code == GIT_OK) { + refreshData->refs.push_back(refreshedRefModel); + } else { + baton->error_code = GIT_OK; + } + } + + git_odb_free(odb); + git_strarray_free(&remoteNames); + git_strarray_free(&referenceNames); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + delete refreshData; + baton->out = NULL; + return; + } +} + +void GitRepository::RefreshReferencesWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + RefreshedRefModel::ensureSignatureRegexes(); + RefreshReferencesData *refreshData = (RefreshReferencesData *)baton->out; + v8::Local result = Nan::New(); + + Nan::Set( + result, + Nan::New("headRefFullName").ToLocalChecked(), + Nan::New(refreshData->headRefFullName).ToLocalChecked() + ); + + v8::Local signatureType = Nan::To(GetFromPersistent("signatureType")).ToLocalChecked(); + + unsigned int numRefs = refreshData->refs.size(); + v8::Local refs = Nan::New(numRefs); + for (unsigned int i = 0; i < numRefs; ++i) { + RefreshedRefModel *refreshedRefModel = refreshData->refs[i]; + Nan::Set(refs, Nan::New(i), refreshedRefModel->toJavascript(signatureType)); + } + Nan::Set(result, Nan::New("refs").ToLocalChecked(), refs); + + unsigned int numUpstreamInfo = refreshData->upstreamInfo.size(); + v8::Local upstreamInfo = Nan::New(numUpstreamInfo); + for (unsigned int i = 0; i < numUpstreamInfo; ++i) { + UpstreamModel *upstreamModel = refreshData->upstreamInfo[i]; + Nan::Set(upstreamInfo, Nan::New(i), upstreamModel->toJavascript()); + } + Nan::Set(result, Nan::New("upstreamInfo").ToLocalChecked(), upstreamInfo); + + if (refreshData->cherrypick != NULL) { + Nan::Set( + result, + Nan::New("cherrypick").ToLocalChecked(), + refreshData->cherrypick->toJavascript(signatureType) + ); + } else { + Nan::Set(result, Nan::New("cherrypick").ToLocalChecked(), Nan::Null()); + } + + if (refreshData->merge != NULL) { + Nan::Set( + result, + Nan::New("merge").ToLocalChecked(), + refreshData->merge->toJavascript(signatureType) + ); + } else { + Nan::Set(result, Nan::New("merge").ToLocalChecked(), Nan::Null()); + } + + delete refreshData; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Repository refreshReferences has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Repository.refreshReferences").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } +} diff --git a/generate/templates/manual/revwalk/commit_walk.cc b/generate/templates/manual/revwalk/commit_walk.cc new file mode 100644 index 000000000..91fe7f38c --- /dev/null +++ b/generate/templates/manual/revwalk/commit_walk.cc @@ -0,0 +1,123 @@ +NAN_METHOD(GitRevwalk::CommitWalk) { + if (info.Length() == 0 || !info[0]->IsNumber()) { + return Nan::ThrowError("Max count is required and must be a number."); + } + + if (info.Length() == 1 || !info[1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + CommitWalkBaton* baton = new CommitWalkBaton; + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->max_count = Nan::To(info[0]).FromJust(); + baton->out = new std::vector; + baton->out->reserve(baton->max_count); + baton->walk = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[1])); + CommitWalkWorker *worker = new CommitWalkWorker(baton, callback); + worker->SaveToPersistent("fastWalk", info.This()); + + Nan::AsyncQueueWorker(worker); + return; +} + +void GitRevwalk::CommitWalkWorker::Execute() { + giterr_clear(); + + for (int i = 0; i < baton->max_count; i++) { + git_oid next_commit_id; + baton->error_code = git_revwalk_next(&next_commit_id, baton->walk); + + if (baton->error_code == GIT_ITEROVER) { + baton->error_code = GIT_OK; + return; + } + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + while (baton->out->size()) { + git_commit_free(baton->out->back()); + baton->out->pop_back(); + } + + delete baton->out; + baton->out = NULL; + + return; + } + + git_commit *commit; + baton->error_code = git_commit_lookup(&commit, git_revwalk_repository(baton->walk), &next_commit_id); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + while (baton->out->size()) { + git_commit_free(baton->out->back()); + baton->out->pop_back(); + } + + delete baton->out; + baton->out = NULL; + + return; + } + + baton->out->push_back(commit); + } +} + +void GitRevwalk::CommitWalkWorker::HandleOKCallback() { + if (baton->out != NULL) { + unsigned int size = baton->out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + git_commit *commit = baton->out->at(i); + Nan::Set( + result, + Nan::New(i), + GitCommit::New( + commit, + true, + Nan::To(GitRepository::New(git_commit_owner(commit), true)).ToLocalChecked() + ) + ); + } + + delete baton->out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } else if (baton->error) { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } else if (baton->error_code < 0) { + Local err = Nan::To(Nan::Error("Revwalk commitWalk has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.commitWalk").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } else { + callback->Call(0, NULL, async_resource); + } +} diff --git a/generate/templates/manual/revwalk/fast_walk.cc b/generate/templates/manual/revwalk/fast_walk.cc index 8969bcb0f..002251852 100644 --- a/generate/templates/manual/revwalk/fast_walk.cc +++ b/generate/templates/manual/revwalk/fast_walk.cc @@ -30,7 +30,7 @@ void GitRevwalk::FastWalkWorker::Execute() for (int i = 0; i < baton->max_count; i++) { git_oid *nextCommit = (git_oid *)malloc(sizeof(git_oid)); - giterr_clear(); + git_error_clear(); baton->error_code = git_revwalk_next(nextCommit, baton->walk); if (baton->error_code != GIT_OK) @@ -40,7 +40,7 @@ void GitRevwalk::FastWalkWorker::Execute() free(nextCommit); if (baton->error_code != GIT_ITEROVER) { - baton->error = git_error_dup(giterr_last()); + baton->error = git_error_dup(git_error_last()); while(!baton->out->empty()) { @@ -90,12 +90,12 @@ void GitRevwalk::FastWalkWorker::HandleOKCallback() { Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method fastWalk has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method fastWalk has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fastWalk").ToLocalChecked()); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fastWalk").ToLocalChecked()); Local argv[1] = { err }; @@ -131,24 +131,24 @@ void GitRevwalk::FastWalkWorker::HandleOKCallback() continue; } - Local nodeObj = node->ToObject(); + Local nodeObj = Nan::To(node).ToLocalChecked(); Local checkValue = GetPrivate(nodeObj, Nan::New("NodeGitPromiseError").ToLocalChecked()); if (!checkValue.IsEmpty() && !checkValue->IsNull() && !checkValue->IsUndefined()) { Local argv[1] = { - checkValue->ToObject() + Nan::To(checkValue).ToLocalChecked() }; callback->Call(1, argv, async_resource); callbackFired = true; break; } - Local properties = nodeObj->GetPropertyNames(); + Local properties = Nan::GetPropertyNames(nodeObj).ToLocalChecked(); for (unsigned int propIndex = 0; propIndex < properties->Length(); ++propIndex) { - Local propName = properties->Get(propIndex)->ToString(); - Local nodeToQueue = nodeObj->Get(propName); + Local propName = Nan::To(Nan::Get(properties, propIndex).ToLocalChecked()).ToLocalChecked(); + Local nodeToQueue = Nan::Get(nodeObj, propName).ToLocalChecked(); if (!nodeToQueue->IsUndefined()) { workerArguments.push(nodeToQueue); @@ -158,9 +158,9 @@ void GitRevwalk::FastWalkWorker::HandleOKCallback() if (!callbackFired) { - Local err = Nan::Error("Method next has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fastWalk").ToLocalChecked()); + Local err = Nan::To(Nan::Error("Method next has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fastWalk").ToLocalChecked()); Local argv[1] = { err }; diff --git a/generate/templates/manual/revwalk/file_history_walk.cc b/generate/templates/manual/revwalk/file_history_walk.cc index 557cb38bc..d8d2935df 100644 --- a/generate/templates/manual/revwalk/file_history_walk.cc +++ b/generate/templates/manual/revwalk/file_history_walk.cc @@ -1,3 +1,183 @@ +// Note: commit is not owned by this class (must be freed elsewhere) +class FileHistoryEvent { +public: + FileHistoryEvent( + git_delta_t inputType, + bool inputExistsInCurrentTree, + bool inputIsMergeCommit, + git_commit *inputCommit, + const char *inputFrom, + const char *inputTo + ): + type(inputType), + existsInCurrentTree(inputExistsInCurrentTree), + isMergeCommit(inputIsMergeCommit), + from(inputFrom == NULL ? NULL : strdup(inputFrom)), + to(inputTo == NULL ? NULL : strdup(inputTo)), + commit(inputCommit) + { + if (inputCommit != NULL) { + const int error = git_commit_dup(&commit, inputCommit); + assert(error == GIT_OK); + } + } + + ~FileHistoryEvent() { + if (commit != NULL) { + git_commit_free(commit); + } + } + + v8::Local toJavascript() { + v8::Local historyEntry = Nan::New(); + v8::Local owners = Nan::New(1); + Nan::Set( + owners, + Nan::New(owners->Length()), + Nan::To(GitRepository::New( + git_commit_owner(commit), + true + )).ToLocalChecked() + ); + Nan::Set(historyEntry, Nan::New("commit").ToLocalChecked(), GitCommit::New(commit, true, owners)); + commit = NULL; + Nan::Set(historyEntry, Nan::New("status").ToLocalChecked(), Nan::New(type)); + Nan::Set(historyEntry, Nan::New("isMergeCommit").ToLocalChecked(), Nan::New(isMergeCommit)); + if (type == GIT_DELTA_RENAMED) { + if (from != NULL) { + Nan::Set(historyEntry, Nan::New("oldName").ToLocalChecked(), Nan::New(from).ToLocalChecked()); + } + if (to != NULL) { + Nan::Set(historyEntry, Nan::New("newName").ToLocalChecked(), Nan::New(to).ToLocalChecked()); + } + } + return historyEntry; + } + + static int buildHistoryEvent( + FileHistoryEvent **fileHistoryEvent, + git_repository *repo, + git_commit *currentCommit, + git_tree *currentTree, + git_tree *parentTree, + const char *filePath + ) { + int errorCode; + git_tree_entry *currentEntry; + if (git_tree_entry_bypath(¤tEntry, currentTree, filePath) != GIT_OK) { + currentEntry = NULL; + } + git_tree_entry *parentEntry; + if (git_tree_entry_bypath(&parentEntry, parentTree, filePath) != GIT_OK) { + parentEntry = NULL; + } + + if (!currentEntry && !parentEntry) { + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_UNMODIFIED, false, false, currentCommit, NULL, NULL); + return GIT_OK; + } + + // The filePath was added + if (currentEntry && !parentEntry) { + git_diff *diff; + if ((errorCode = git_diff_tree_to_tree(&diff, repo, parentTree, currentTree, NULL)) != GIT_OK) { + git_tree_entry_free(currentEntry); + return errorCode; + } + if ((errorCode = git_diff_find_similar(diff, NULL)) != GIT_OK) { + git_diff_free(diff); + git_tree_entry_free(currentEntry); + return errorCode; + } + const size_t numDeltas = git_diff_num_deltas(diff); + for (size_t i = 0; i < numDeltas; ++i) { + const git_diff_delta *delta = git_diff_get_delta(diff, i); + if (delta->new_file.path != NULL && std::strcmp(delta->new_file.path, filePath) == 0) { + if (delta->status == GIT_DELTA_RENAMED + || (delta->old_file.path != NULL && std::strcmp(delta->old_file.path, filePath) != 0)) { + *fileHistoryEvent = new FileHistoryEvent( + GIT_DELTA_RENAMED, + true, + false, + currentCommit, + delta->old_file.path, + delta->new_file.path + ); + git_diff_free(diff); + git_tree_entry_free(currentEntry); + return GIT_OK; + } + break; + } + } + git_diff_free(diff); + git_tree_entry_free(currentEntry); + + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_ADDED, true, false, currentCommit, NULL, NULL); + return GIT_OK; + } + + // The filePath was deleted + if (!currentEntry && parentEntry) { + git_diff *diff; + if ((errorCode = git_diff_tree_to_tree(&diff, repo, parentTree, currentTree, NULL)) != GIT_OK) { + git_tree_entry_free(parentEntry); + return errorCode; + } + if ((errorCode = git_diff_find_similar(diff, NULL)) != GIT_OK) { + git_diff_free(diff); + git_tree_entry_free(parentEntry); + return errorCode; + } + const size_t numDeltas = git_diff_num_deltas(diff); + for (size_t i = 0; i < numDeltas; ++i) { + const git_diff_delta *delta = git_diff_get_delta(diff, i); + if (delta->old_file.path != NULL && std::strcmp(delta->old_file.path, filePath) == 0) { + if (delta->status == GIT_DELTA_RENAMED + || (delta->new_file.path != NULL && std::strcmp(delta->new_file.path, filePath) != 0)) { + *fileHistoryEvent = new FileHistoryEvent( + GIT_DELTA_RENAMED, + false, + false, + currentCommit, + delta->old_file.path, + delta->new_file.path + ); + git_diff_free(diff); + git_tree_entry_free(parentEntry); + return GIT_OK; + } + break; + } + } + git_diff_free(diff); + git_tree_entry_free(parentEntry); + + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_DELETED, false, false, currentCommit, NULL, NULL); + return GIT_OK; + } + + if (git_oid_cmp(git_tree_entry_id(currentEntry), git_tree_entry_id(parentEntry)) != 0 + || git_tree_entry_filemode(currentEntry) != git_tree_entry_filemode(parentEntry) + ) { + git_tree_entry_free(parentEntry); + git_tree_entry_free(currentEntry); + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_MODIFIED, true, false, currentCommit, NULL, NULL); + return GIT_OK; + } + + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_UNMODIFIED, true, false, currentCommit, NULL, NULL); + git_tree_entry_free(parentEntry); + git_tree_entry_free(currentEntry); + return GIT_OK; + } + + git_delta_t type; + bool existsInCurrentTree, isMergeCommit; + const char *from, *to; + git_commit *commit; +}; + NAN_METHOD(GitRevwalk::FileHistoryWalk) { if (info.Length() == 0 || !info[0]->IsString()) { @@ -16,10 +196,10 @@ NAN_METHOD(GitRevwalk::FileHistoryWalk) baton->error_code = GIT_OK; baton->error = NULL; - String::Utf8Value from_js_file_path(info[0]->ToString()); + Nan::Utf8String from_js_file_path(Nan::To(info[0]).ToLocalChecked()); baton->file_path = strdup(*from_js_file_path); baton->max_count = Nan::To(info[1]).FromJust(); - baton->out = new std::vector< std::pair > *>; + baton->out = new std::vector; baton->out->reserve(baton->max_count); baton->walk = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); @@ -34,251 +214,224 @@ NAN_METHOD(GitRevwalk::FileHistoryWalk) void GitRevwalk::FileHistoryWalkWorker::Execute() { git_repository *repo = git_revwalk_repository(baton->walk); - git_oid *nextOid = (git_oid *)malloc(sizeof(git_oid)); - giterr_clear(); + git_oid currentOid; + git_error_clear(); for ( - unsigned int i = 0; - i < baton->max_count && (baton->error_code = git_revwalk_next(nextOid, baton->walk)) == GIT_OK; - ++i + unsigned int revwalkIterations = 0; + revwalkIterations < baton->max_count && (baton->error_code = git_revwalk_next(¤tOid, baton->walk)) == GIT_OK; + ++revwalkIterations ) { - // check if this commit has the file - git_commit *nextCommit; - - if ((baton->error_code = git_commit_lookup(&nextCommit, repo, nextOid)) != GIT_OK) { + git_commit *currentCommit; + if ((baton->error_code = git_commit_lookup(¤tCommit, repo, ¤tOid)) != GIT_OK) { break; } - git_tree *thisTree, *parentTree; - if ((baton->error_code = git_commit_tree(&thisTree, nextCommit)) != GIT_OK) { - git_commit_free(nextCommit); + git_tree *currentTree; + if ((baton->error_code = git_commit_tree(¤tTree, currentCommit)) != GIT_OK) { + git_commit_free(currentCommit); break; } - git_diff *diffs; - git_diff_options opts = GIT_DIFF_OPTIONS_INIT; - char *file_path = strdup(baton->file_path); - opts.pathspec.strings = &file_path; - opts.pathspec.count = 1; - git_commit *parent; - unsigned int parents = git_commit_parentcount(nextCommit); - if (parents > 1) { - git_commit_free(nextCommit); - continue; - } else if (parents == 1) { - if ((baton->error_code = git_commit_parent(&parent, nextCommit, 0)) != GIT_OK) { - git_commit_free(nextCommit); - break; + const unsigned int parentCount = git_commit_parentcount(currentCommit); + if (parentCount == 0) { + git_tree_entry* entry; + if (git_tree_entry_bypath(&entry, currentTree, baton->file_path) == GIT_OK) { + baton->out->push_back(new FileHistoryEvent(GIT_DELTA_ADDED, false, false, currentCommit, NULL, NULL)); + git_tree_entry_free(entry); } - if ( - (baton->error_code = git_commit_tree(&parentTree, parent)) != GIT_OK || - (baton->error_code = git_diff_tree_to_tree(&diffs, repo, parentTree, thisTree, &opts)) != GIT_OK - ) { - git_commit_free(nextCommit); - git_commit_free(parent); + git_commit_free(currentCommit); + git_tree_free(currentTree); + continue; + } + + if (parentCount == 1) { + git_commit *parentCommit; + if ((baton->error_code = git_commit_parent(&parentCommit, currentCommit, 0)) != GIT_OK) { + git_commit_free(currentCommit); + git_tree_free(currentTree); break; } - } else { - if ((baton->error_code = git_diff_tree_to_tree(&diffs, repo, NULL, thisTree, &opts)) != GIT_OK) { - git_commit_free(nextCommit); + + git_tree *parentTree; + if ((baton->error_code = git_commit_tree(&parentTree, parentCommit)) != GIT_OK) { + git_commit_free(currentCommit); + git_commit_free(parentCommit); + git_tree_free(currentTree); break; } - } - - free(file_path); - opts.pathspec.strings = NULL; - opts.pathspec.count = 0; - bool flag = false; - bool doRenamedPass = false; - unsigned int numDeltas = git_diff_num_deltas(diffs); - for (unsigned int j = 0; j < numDeltas; ++j) { - git_patch *nextPatch; - baton->error_code = git_patch_from_diff(&nextPatch, diffs, j); - if (baton->error_code < GIT_OK) { + FileHistoryEvent *fileHistoryEvent; + if ((baton->error_code = FileHistoryEvent::buildHistoryEvent( + &fileHistoryEvent, + repo, + currentCommit, + currentTree, + parentTree, + baton->file_path + )) != GIT_OK) { + git_commit_free(currentCommit); + git_commit_free(parentCommit); + git_tree_free(currentTree); + git_tree_free(parentTree); break; } - if (nextPatch == NULL) { - continue; + if (fileHistoryEvent->type != GIT_DELTA_UNMODIFIED) { + baton->out->push_back(fileHistoryEvent); } - const git_diff_delta *delta = git_patch_get_delta(nextPatch); - bool isEqualOldFile = !strncmp(delta->old_file.path, baton->file_path, strlen(baton->file_path)); - bool isEqualNewFile = !strncmp(delta->new_file.path, baton->file_path, strlen(baton->file_path)); + git_commit_free(currentCommit); + git_commit_free(parentCommit); + git_tree_free(currentTree); + git_tree_free(parentTree); + continue; + } - if (isEqualNewFile) { - if (delta->status == GIT_DELTA_ADDED || delta->status == GIT_DELTA_DELETED) { - doRenamedPass = true; - break; - } - std::pair > *historyEntry; - if (!isEqualOldFile) { - historyEntry = new std::pair >( - nextCommit, - std::pair(strdup(delta->old_file.path), delta->status) - ); - } else { - historyEntry = new std::pair >( - nextCommit, - std::pair(strdup(delta->new_file.path), delta->status) - ); - } - baton->out->push_back(historyEntry); - flag = true; + std::pair firstMatchingParentIndex(false, 0); + bool fileExistsInCurrent = false, fileExistsInSomeParent = false; + for (unsigned int parentIndex = 0; parentIndex < parentCount; ++parentIndex) { + git_commit *parentCommit; + if ((baton->error_code = git_commit_parent(&parentCommit, currentCommit, parentIndex)) != GIT_OK) { + break; } - git_patch_free(nextPatch); - - if (flag) { + git_tree *parentTree; + if ((baton->error_code = git_commit_tree(&parentTree, parentCommit)) != GIT_OK) { + git_commit_free(parentCommit); break; } - } - if (doRenamedPass) { - git_diff_free(diffs); + FileHistoryEvent *fileHistoryEvent; + if ((baton->error_code = FileHistoryEvent::buildHistoryEvent( + &fileHistoryEvent, + repo, + currentCommit, + currentTree, + parentTree, + baton->file_path + )) != GIT_OK) { + git_tree_free(parentTree); + git_commit_free(parentCommit); + break; + } - if (parents == 1) { - if ((baton->error_code = git_diff_tree_to_tree(&diffs, repo, parentTree, thisTree, NULL)) != GIT_OK) { - git_commit_free(nextCommit); - break; - } - if ((baton->error_code = git_diff_find_similar(diffs, NULL)) != GIT_OK) { - git_commit_free(nextCommit); + switch (fileHistoryEvent->type) { + case GIT_DELTA_ADDED: { + fileExistsInCurrent = true; break; } - } else { - if ((baton->error_code = git_diff_tree_to_tree(&diffs, repo, NULL, thisTree, NULL)) != GIT_OK) { - git_commit_free(nextCommit); + case GIT_DELTA_MODIFIED: { + fileExistsInCurrent = true; + fileExistsInSomeParent = true; break; } - if((baton->error_code = git_diff_find_similar(diffs, NULL)) != GIT_OK) { - git_commit_free(nextCommit); + case GIT_DELTA_DELETED: { + fileExistsInSomeParent = true; break; } - } - - flag = false; - numDeltas = git_diff_num_deltas(diffs); - for (unsigned int j = 0; j < numDeltas; ++j) { - git_patch *nextPatch; - baton->error_code = git_patch_from_diff(&nextPatch, diffs, j); - - if (baton->error_code < GIT_OK) { + case GIT_DELTA_RENAMED: { + if (fileHistoryEvent->existsInCurrentTree) { + fileExistsInCurrent = true; + } else { + fileExistsInSomeParent = true; + } break; } - - if (nextPatch == NULL) { - continue; - } - - const git_diff_delta *delta = git_patch_get_delta(nextPatch); - bool isEqualOldFile = !strncmp(delta->old_file.path, baton->file_path, strlen(baton->file_path)); - bool isEqualNewFile = !strncmp(delta->new_file.path, baton->file_path, strlen(baton->file_path)); - int oldLen = strlen(delta->old_file.path); - int newLen = strlen(delta->new_file.path); - char *outPair = new char[oldLen + newLen + 2]; - strcpy(outPair, delta->new_file.path); - outPair[newLen] = '\n'; - outPair[newLen + 1] = '\0'; - strcat(outPair, delta->old_file.path); - - if (isEqualNewFile) { - std::pair > *historyEntry; - if (!isEqualOldFile || delta->status == GIT_DELTA_RENAMED) { - historyEntry = new std::pair >( - nextCommit, - std::pair(strdup(outPair), delta->status) - ); - } else { - historyEntry = new std::pair >( - nextCommit, - std::pair(strdup(delta->new_file.path), delta->status) - ); + case GIT_DELTA_UNMODIFIED: { + if (fileHistoryEvent->existsInCurrentTree) { + fileExistsInCurrent = true; + fileExistsInSomeParent = true; } - baton->out->push_back(historyEntry); - flag = true; - } else if (isEqualOldFile) { - std::pair > *historyEntry; - historyEntry = new std::pair >( - nextCommit, - std::pair(strdup(outPair), delta->status) - ); - baton->out->push_back(historyEntry); - flag = true; + firstMatchingParentIndex = std::make_pair(true, parentIndex); + break; } - - delete[] outPair; - - git_patch_free(nextPatch); - - if (flag) { + default: { break; } } - } - git_diff_free(diffs); + delete fileHistoryEvent; + git_commit_free(parentCommit); + git_tree_free(parentTree); - if (!flag && nextCommit != NULL) { - git_commit_free(nextCommit); + if (firstMatchingParentIndex.first) { + break; + } } if (baton->error_code != GIT_OK) { + git_tree_free(currentTree); + git_commit_free(currentCommit); break; } - } - free(nextOid); + if (!firstMatchingParentIndex.first) { + assert(fileExistsInCurrent || fileExistsInSomeParent); + git_delta_t mergeType = GIT_DELTA_UNREADABLE; // It will never result in this case because of the assertion above. + if (fileExistsInCurrent && fileExistsInSomeParent) { + mergeType = GIT_DELTA_MODIFIED; + } else if (fileExistsInCurrent) { + mergeType = GIT_DELTA_ADDED; + } else if (fileExistsInSomeParent) { + mergeType = GIT_DELTA_DELETED; + } - if (baton->error_code != GIT_OK) { - if (baton->error_code != GIT_ITEROVER) { - baton->error = git_error_dup(giterr_last()); + FileHistoryEvent *fileHistoryEvent = new FileHistoryEvent( + mergeType, + mergeType != GIT_DELTA_DELETED, + true, + currentCommit, + NULL, + NULL + ); + baton->out->push_back(fileHistoryEvent); + git_tree_free(currentTree); + git_commit_free(currentCommit); + continue; + } - while(!baton->out->empty()) - { - std::pair > *pairToFree = baton->out->back(); - baton->out->pop_back(); - git_commit_free(pairToFree->first); - free(pairToFree->second.first); - free(pairToFree); + assert(firstMatchingParentIndex.first); + for (unsigned int parentIndex = 0; parentIndex < parentCount; ++parentIndex) { + if (parentIndex == firstMatchingParentIndex.second) { + continue; } - delete baton->out; + const git_oid *parentOid = git_commit_parent_id(currentCommit, parentIndex); + assert(parentOid != NULL); + git_revwalk_hide(baton->walk, parentOid); + } + git_commit_free(currentCommit); + git_tree_free(currentTree); + } - baton->out = NULL; + if (baton->error_code != GIT_OK && baton->error_code != GIT_ITEROVER) { + // Something went wrong in our loop, discard everything in the async worker + for (unsigned int i = 0; i < baton->out->size(); ++i) { + delete static_cast(baton->out->at(i)); } - } else { - baton->error_code = GIT_OK; + delete baton->out; + baton->out = NULL; + baton->error = git_error_dup(git_error_last()); } + free((void *)baton->file_path); + baton->file_path = NULL; } void GitRevwalk::FileHistoryWalkWorker::HandleOKCallback() { if (baton->out != NULL) { - unsigned int size = baton->out->size(); - Local result = Nan::New(size); + const unsigned int size = baton->out->size(); + v8::Local result = Nan::New(size); for (unsigned int i = 0; i < size; i++) { - Local historyEntry = Nan::New(); - std::pair > *batonResult = baton->out->at(i); - Nan::Set(historyEntry, Nan::New("commit").ToLocalChecked(), GitCommit::New(batonResult->first, true)); - Nan::Set(historyEntry, Nan::New("status").ToLocalChecked(), Nan::New(batonResult->second.second)); - if (batonResult->second.second == GIT_DELTA_RENAMED) { - char *namePair = batonResult->second.first; - char *split = strchr(namePair, '\n'); - *split = '\0'; - char *oldName = split + 1; - - Nan::Set(historyEntry, Nan::New("oldName").ToLocalChecked(), Nan::New(oldName).ToLocalChecked()); - Nan::Set(historyEntry, Nan::New("newName").ToLocalChecked(), Nan::New(namePair).ToLocalChecked()); - } - Nan::Set(result, Nan::New(i), historyEntry); - - free(batonResult->second.first); - free(batonResult); + FileHistoryEvent *batonResult = static_cast(baton->out->at(i)); + Nan::Set(result, Nan::New(i), batonResult->toJavascript()); + delete batonResult; } - Local argv[2] = { + Nan::Set(result, Nan::New("reachedEndOfHistory").ToLocalChecked(), Nan::New(baton->error_code == GIT_ITEROVER)); + + v8::Local argv[2] = { Nan::Null(), result }; @@ -289,15 +442,15 @@ void GitRevwalk::FileHistoryWalkWorker::HandleOKCallback() } if (baton->error) { - Local err; + v8::Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method fileHistoryWalk has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method fileHistoryWalk has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fileHistoryWalk").ToLocalChecked()); - Local argv[1] = { + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fileHistoryWalk").ToLocalChecked()); + v8::Local argv[1] = { err }; callback->Call(1, argv, async_resource); @@ -311,10 +464,10 @@ void GitRevwalk::FileHistoryWalkWorker::HandleOKCallback() } if (baton->error_code < 0) { - Local err = Nan::Error("Method next has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fileHistoryWalk").ToLocalChecked()); - Local argv[1] = { + v8::Local err = Nan::To(Nan::Error("Method next has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fileHistoryWalk").ToLocalChecked()); + v8::Local argv[1] = { err }; callback->Call(1, argv, async_resource); diff --git a/generate/templates/manual/src/filter_registry.cc b/generate/templates/manual/src/filter_registry.cc index d2d2db933..67e958d03 100644 --- a/generate/templates/manual/src/filter_registry.cc +++ b/generate/templates/manual/src/filter_registry.cc @@ -54,8 +54,8 @@ NAN_METHOD(GitFilterRegistry::GitFilterRegister) { FilterRegisterBaton *baton = new FilterRegisterBaton; - baton->filter = Nan::ObjectWrap::Unwrap(info[1]->ToObject())->GetValue(); - String::Utf8Value name(info[0]->ToString()); + baton->filter = Nan::ObjectWrap::Unwrap(Nan::To(info[1]).ToLocalChecked())->GetValue(); + Nan::Utf8String name(Nan::To(info[0]).ToLocalChecked()); baton->filter_name = (char *)malloc(name.length() + 1); memcpy((void *)baton->filter_name, *name, name.length()); @@ -64,28 +64,28 @@ NAN_METHOD(GitFilterRegistry::GitFilterRegister) { baton->error_code = GIT_OK; baton->filter_priority = Nan::To(info[2]).FromJust(); - Nan::New(GitFilterRegistry::persistentHandle)->Set(info[0]->ToString(), info[1]->ToObject()); + Nan::Set(Nan::New(GitFilterRegistry::persistentHandle), Nan::To(info[0]).ToLocalChecked(), Nan::To(info[1]).ToLocalChecked()); Nan::Callback *callback = new Nan::Callback(Local::Cast(info[3])); RegisterWorker *worker = new RegisterWorker(baton, callback); - worker->SaveToPersistent("filter_name", info[0]->ToObject()); - worker->SaveToPersistent("filter_priority", info[2]->ToObject()); + worker->SaveToPersistent("filter_name", Nan::To(info[0]).ToLocalChecked()); + worker->SaveToPersistent("filter_priority", Nan::To(info[2]).ToLocalChecked()); AsyncLibgit2QueueWorker(worker); return; } void GitFilterRegistry::RegisterWorker::Execute() { - giterr_clear(); + git_error_clear(); { LockMaster lockMaster(/*asyncAction: */true, baton->filter_name, baton->filter); int result = git_filter_register(baton->filter_name, baton->filter, baton->filter_priority); baton->error_code = result; - if (result != GIT_OK && giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); + if (result != GIT_OK && git_error_last() != NULL) { + baton->error = git_error_dup(git_error_last()); } } } @@ -102,12 +102,12 @@ void GitFilterRegistry::RegisterWorker::HandleOKCallback() { else if (baton->error) { v8::Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method register has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method register has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.register").ToLocalChecked()); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.register").ToLocalChecked()); v8::Local argv[1] = { err }; @@ -117,9 +117,9 @@ void GitFilterRegistry::RegisterWorker::HandleOKCallback() { free((void *)baton->error); } else if (baton->error_code < 0) { - v8::Local err = Nan::Error("Method register has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.register").ToLocalChecked()); + v8::Local err = Nan::To(Nan::Error("Method register has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.register").ToLocalChecked()); v8::Local argv[1] = { err }; @@ -144,7 +144,7 @@ NAN_METHOD(GitFilterRegistry::GitFilterUnregister) { } FilterUnregisterBaton *baton = new FilterUnregisterBaton; - String::Utf8Value name(info[0]->ToString()); + Nan::Utf8String name(Nan::To(info[0]).ToLocalChecked()); baton->filter_name = (char *)malloc(name.length() + 1); memcpy((void *)baton->filter_name, *name, name.length()); @@ -163,15 +163,15 @@ NAN_METHOD(GitFilterRegistry::GitFilterUnregister) { } void GitFilterRegistry::UnregisterWorker::Execute() { - giterr_clear(); + git_error_clear(); { LockMaster lockMaster(/*asyncAction: */true, baton->filter_name); int result = git_filter_unregister(baton->filter_name); baton->error_code = result; - if (result != GIT_OK && giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); + if (result != GIT_OK && git_error_last() != NULL) { + baton->error = git_error_dup(git_error_last()); } } } @@ -188,12 +188,12 @@ void GitFilterRegistry::UnregisterWorker::HandleOKCallback() { else if (baton->error) { v8::Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method register has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method register has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.unregister").ToLocalChecked()); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.unregister").ToLocalChecked()); v8::Local argv[1] = { err }; @@ -203,9 +203,9 @@ void GitFilterRegistry::UnregisterWorker::HandleOKCallback() { free((void *)baton->error); } else if (baton->error_code < 0) { - v8::Local err = Nan::Error("Method unregister has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.unregister").ToLocalChecked()); + v8::Local err = Nan::To(Nan::Error("Method unregister has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.unregister").ToLocalChecked()); v8::Local argv[1] = { err }; diff --git a/generate/templates/manual/src/git_buf_converter.cc b/generate/templates/manual/src/git_buf_converter.cc index 0c1969504..1558d39fe 100644 --- a/generate/templates/manual/src/git_buf_converter.cc +++ b/generate/templates/manual/src/git_buf_converter.cc @@ -10,7 +10,7 @@ using namespace node; git_buf *GitBufConverter::Convert(Local val) { if (val->IsString() || val->IsStringObject()) { - v8::String::Utf8Value param1(val->ToString()); + Nan::Utf8String param1(Nan::To(val).ToLocalChecked()); std::string v8String = std::string(*param1); const size_t size = sizeof(git_buf); diff --git a/generate/templates/manual/src/nodegit_wrapper.cc b/generate/templates/manual/src/nodegit_wrapper.cc index 26ead60da..69aed4f94 100644 --- a/generate/templates/manual/src/nodegit_wrapper.cc +++ b/generate/templates/manual/src/nodegit_wrapper.cc @@ -67,7 +67,7 @@ NAN_METHOD(NodeGitWrapper::JSNewFunction) { instance = new cppClass(static_cast( Local::Cast(info[0])->Value()), Nan::To(info[1]).FromJust(), - info.Length() >= 3 && !info[2].IsEmpty() && info[2]->IsObject() ? info[2]->ToObject() : Local() + info.Length() >= 3 && !info[2].IsEmpty() && info[2]->IsObject() ? Nan::To(info[2]).ToLocalChecked() : Local() ); } diff --git a/generate/templates/manual/src/promise_completion.cc b/generate/templates/manual/src/promise_completion.cc index fd34dfa77..22203b41d 100644 --- a/generate/templates/manual/src/promise_completion.cc +++ b/generate/templates/manual/src/promise_completion.cc @@ -9,10 +9,10 @@ Nan::Persistent PromiseCompletion::promiseRejected; void PromiseCompletion::InitializeComponent() { v8::Local newTemplate = Nan::New(New); newTemplate->InstanceTemplate()->SetInternalFieldCount(1); - newFn.Reset(newTemplate->GetFunction()); + newFn.Reset(Nan::GetFunction(newTemplate).ToLocalChecked()); - promiseFulfilled.Reset(Nan::New(PromiseFulfilled)->GetFunction()); - promiseRejected.Reset(Nan::New(PromiseRejected)->GetFunction()); + promiseFulfilled.Reset(Nan::GetFunction(Nan::New(PromiseFulfilled)).ToLocalChecked()); + promiseRejected.Reset(Nan::GetFunction(Nan::New(PromiseRejected)).ToLocalChecked()); } bool PromiseCompletion::ForwardIfPromise(v8::Local result, AsyncBaton *baton, Callback callback) @@ -21,7 +21,7 @@ bool PromiseCompletion::ForwardIfPromise(v8::Local result, AsyncBaton // check if the result is a promise if (!result.IsEmpty() && result->IsObject()) { - Nan::MaybeLocal maybeThenProp = Nan::Get(result->ToObject(), Nan::New("then").ToLocalChecked()); + Nan::MaybeLocal maybeThenProp = Nan::Get(Nan::To(result).ToLocalChecked(), Nan::New("then").ToLocalChecked()); if (!maybeThenProp.IsEmpty()) { v8::Local thenProp = maybeThenProp.ToLocalChecked(); if(thenProp->IsFunction()) { @@ -54,7 +54,7 @@ void PromiseCompletion::Setup(v8::Local thenFn, v8::Localcallback = callback; this->baton = baton; - v8::Local promise = result->ToObject(); + v8::Local promise = Nan::To(result).ToLocalChecked(); v8::Local thisHandle = handle(); @@ -64,7 +64,7 @@ void PromiseCompletion::Setup(v8::Local thenFn, v8::Local PromiseCompletion::Bind(Nan::Persistent &func v8::Local argv[1] = { object }; - return scope.Escape(bind->Call(Nan::New(function), 1, argv)); + return scope.Escape(Nan::Call(bind, Nan::To(Nan::New(function)).ToLocalChecked(), 1, argv).ToLocalChecked()); } // calls the callback stored in the PromiseCompletion, passing the baton that @@ -90,7 +90,7 @@ void PromiseCompletion::CallCallback(bool isFulfilled, const Nan::FunctionCallba resultOfPromise = info[0]; } - PromiseCompletion *promiseCompletion = ObjectWrap::Unwrap(info.This()->ToObject()); + PromiseCompletion *promiseCompletion = ObjectWrap::Unwrap(Nan::To(info.This()).ToLocalChecked()); (*promiseCompletion->callback)(isFulfilled, promiseCompletion->baton, resultOfPromise); } diff --git a/generate/templates/manual/src/str_array_converter.cc b/generate/templates/manual/src/str_array_converter.cc index c66f901c3..eb75aa41d 100644 --- a/generate/templates/manual/src/str_array_converter.cc +++ b/generate/templates/manual/src/str_array_converter.cc @@ -9,15 +9,15 @@ using namespace v8; using namespace node; -git_strarray *StrArrayConverter::Convert(Local val) { - if (!val->BooleanValue()) { +git_strarray *StrArrayConverter::Convert(v8::Local val) { + if (!Nan::To(val).FromJust()) { return NULL; } else if (val->IsArray()) { - return ConvertArray(Array::Cast(*val)); + return ConvertArray(v8::Local::Cast(val)); } else if (val->IsString() || val->IsStringObject()) { - return ConvertString(val->ToString()); + return ConvertString(Nan::To(val).ToLocalChecked()); } else { return NULL; @@ -33,18 +33,18 @@ git_strarray * StrArrayConverter::AllocStrArray(const size_t count) { return result; } -git_strarray *StrArrayConverter::ConvertArray(Array *val) { +git_strarray *StrArrayConverter::ConvertArray(v8::Local val) { git_strarray *result = AllocStrArray(val->Length()); for(size_t i = 0; i < result->count; i++) { - Nan::Utf8String entry(val->Get(i)); + Nan::Utf8String entry(Nan::Get(val, i).ToLocalChecked()); result->strings[i] = strdup(*entry); } return result; } -git_strarray* StrArrayConverter::ConvertString(Local val) { +git_strarray* StrArrayConverter::ConvertString(v8::Local val) { char *strings[1]; Nan::Utf8String utf8String(val); diff --git a/generate/templates/partials/async_function.cc b/generate/templates/partials/async_function.cc index c4cdb115d..9a1ce26fe 100644 --- a/generate/templates/partials/async_function.cc +++ b/generate/templates/partials/async_function.cc @@ -69,7 +69,7 @@ NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) { worker->SaveToPersistent("{{ arg.name }}", info.This()); {%elsif not arg.isCallbackFunction %} if (!info[{{ arg.jsArg }}]->IsUndefined() && !info[{{ arg.jsArg }}]->IsNull()) - worker->SaveToPersistent("{{ arg.name }}", info[{{ arg.jsArg }}]->ToObject()); + worker->SaveToPersistent("{{ arg.name }}", Nan::To(info[{{ arg.jsArg }}]).ToLocalChecked()); {%endif%} {%endif%} {%endeach%} @@ -79,7 +79,7 @@ NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) { } void {{ cppClassName }}::{{ cppFunctionName }}Worker::Execute() { - giterr_clear(); + git_error_clear(); { LockMaster lockMaster( @@ -107,15 +107,15 @@ void {{ cppClassName }}::{{ cppFunctionName }}Worker::Execute() { {%if return.isResultOrError %} baton->error_code = result; - if (result < GIT_OK && giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); + if (result < GIT_OK && git_error_last() != NULL) { + baton->error = git_error_dup(git_error_last()); } {%elsif return.isErrorCode %} baton->error_code = result; - if (result != GIT_OK && giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); + if (result != GIT_OK && git_error_last() != NULL) { + baton->error = git_error_dup(git_error_last()); } {%elsif not return.cType == 'void' %} @@ -163,12 +163,12 @@ void {{ cppClassName }}::{{ cppFunctionName }}Worker::HandleOKCallback() { if (baton->error) { v8::Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method {{ jsFunctionName }} has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method {{ jsFunctionName }} has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("{{ jsClassName }}.{{ jsFunctionName }}").ToLocalChecked()); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("{{ jsClassName }}.{{ jsFunctionName }}").ToLocalChecked()); v8::Local argv[1] = { err }; @@ -205,22 +205,22 @@ void {{ cppClassName }}::{{ cppFunctionName }}Worker::HandleOKCallback() { continue; } - v8::Local nodeObj = node->ToObject(); + v8::Local nodeObj = Nan::To(node).ToLocalChecked(); v8::Local checkValue = GetPrivate(nodeObj, Nan::New("NodeGitPromiseError").ToLocalChecked()); if (!checkValue.IsEmpty() && !checkValue->IsNull() && !checkValue->IsUndefined()) { v8::Local argv[1] = { - checkValue->ToObject() + Nan::To(checkValue).ToLocalChecked() }; callback->Call(1, argv, async_resource); callbackFired = true; break; } - v8::Local properties = nodeObj->GetPropertyNames(); + v8::Local properties = Nan::GetPropertyNames(nodeObj).ToLocalChecked(); for (unsigned int propIndex = 0; propIndex < properties->Length(); ++propIndex) { - v8::Local propName = properties->Get(propIndex)->ToString(); - v8::Local nodeToQueue = nodeObj->Get(propName); + v8::Local propName = Nan::To(Nan::Get(properties, propIndex).ToLocalChecked()).ToLocalChecked(); + v8::Local nodeToQueue = Nan::Get(nodeObj, propName).ToLocalChecked(); if (!nodeToQueue->IsUndefined()) { workerArguments.push(nodeToQueue); } @@ -228,9 +228,9 @@ void {{ cppClassName }}::{{ cppFunctionName }}Worker::HandleOKCallback() { } if (!callbackFired) { - v8::Local err = Nan::Error("Method {{ jsFunctionName }} has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - err->Set(Nan::New("errorFunction").ToLocalChecked(), Nan::New("{{ jsClassName }}.{{ jsFunctionName }}").ToLocalChecked()); + v8::Local err = Nan::To(Nan::Error("Method {{ jsFunctionName }} has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("{{ jsClassName }}.{{ jsFunctionName }}").ToLocalChecked()); v8::Local argv[1] = { err }; @@ -283,7 +283,7 @@ void {{ cppClassName }}::{{ cppFunctionName }}Worker::HandleOKCallback() { {%if arg.cppClassName == "GitBuf" %} {%if cppFunctionName == "Set" %} {%else%} - git_buf_free(baton->{{ arg.name }}); + git_buf_dispose(baton->{{ arg.name }}); free((void *)baton->{{ arg.name }}); {%endif%} {%endif%} diff --git a/generate/templates/partials/callback_helpers.cc b/generate/templates/partials/callback_helpers.cc index 1abfaa991..c3810371c 100644 --- a/generate/templates/partials/callback_helpers.cc +++ b/generate/templates/partials/callback_helpers.cc @@ -30,32 +30,27 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(void {% endif %} {% endeach %} - v8::Local argv[{{ cbFunction.args|jsArgsCount }}] = { - {% each cbFunction.args|argsInfo as arg %} - {% if arg | isPayload %} - {%-- payload is always the last arg --%} - // payload is null because we can use closure scope in javascript - Nan::Undefined() - {% elsif arg.isJsArg %} - {% if arg.isEnum %} - Nan::New((int)baton->{{ arg.name }}), - {% elsif arg.isLibgitType %} - {{ arg.cppClassName }}::New(baton->{{ arg.name }}, false), - {% elsif arg.cType == "size_t" %} - // HACK: NAN should really have an overload for Nan::New to support size_t - Nan::New((unsigned int)baton->{{ arg.name }}), - {% elsif arg.cppClassName == 'String' %} - Nan::New(baton->{{ arg.name }}).ToLocalChecked(), - {% else %} - Nan::New(baton->{{ arg.name }}), - {% endif %} + v8::Local argv[{{ cbFunction.args|callbackArgsCount }}] = { + {% each cbFunction.args|callbackArgsInfo as arg %} + {% if not arg.firstArg %}, {% endif %} + {% if arg.isEnum %} + Nan::New((int)baton->{{ arg.name }}) + {% elsif arg.isLibgitType %} + {{ arg.cppClassName }}::New(baton->{{ arg.name }}, false) + {% elsif arg.cType == "size_t" %} + // HACK: NAN should really have an overload for Nan::New to support size_t + Nan::New((unsigned int)baton->{{ arg.name }}) + {% elsif arg.cppClassName == 'String' %} + Nan::New(baton->{{ arg.name }}).ToLocalChecked() + {% else %} + Nan::New(baton->{{ arg.name }}) {% endif %} {% endeach %} }; Nan::TryCatch tryCatch; // TODO This should take an async_resource, but we will need to figure out how to pipe the correct context into this - Nan::MaybeLocal maybeResult = Nan::Call(*callback, {{ cbFunction.args|jsArgsCount }}, argv); + Nan::MaybeLocal maybeResult = Nan::Call(*callback, {{ cbFunction.args|callbackArgsCount }}, argv); v8::Local result; if (!maybeResult.IsEmpty()) { result = maybeResult.ToLocalChecked(); @@ -71,7 +66,7 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(void } else if (!result->IsNull() && !result->IsUndefined()) { {% if _return.isOutParam %} - {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); + {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(Nan::To(result).ToLocalChecked()); wrapper->selfFreeing = false; *baton->{{ _return.name }} = wrapper->GetValue(); @@ -105,7 +100,7 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_promiseComp } else if (!result->IsNull() && !result->IsUndefined()) { {% if _return.isOutParam %} - {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); + {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(Nan::To(result).ToLocalChecked()); wrapper->selfFreeing = false; *baton->{{ _return.name }} = wrapper->GetValue(); diff --git a/generate/templates/partials/convert_from_v8.cc b/generate/templates/partials/convert_from_v8.cc index 7153b2a9a..cad28ebfc 100644 --- a/generate/templates/partials/convert_from_v8.cc +++ b/generate/templates/partials/convert_from_v8.cc @@ -19,7 +19,7 @@ {%endif%} {%if cppClassName == 'String'%} - String::Utf8Value {{ name }}(info[{{ jsArg }}]->ToString()); + Nan::Utf8String {{ name }}(Nan::To(info[{{ jsArg }}]).ToLocalChecked()); // malloc with one extra byte so we can add the terminating null character C-strings expect: from_{{ name }} = ({{ cType }}) malloc({{ name }}.length() + 1); // copy the characters from the nodejs string into our C-string (used instead of strdup or strcpy because nulls in @@ -36,7 +36,7 @@ from_{{ name }} = GitBufConverter::Convert(info[{{ jsArg }}]); {%elsif cppClassName == 'Wrapper'%} - String::Utf8Value {{ name }}(info[{{ jsArg }}]->ToString()); + Nan::Utf8String {{ name }}(Nan::To(info[{{ jsArg }}]).ToLocalChecked()); // malloc with one extra byte so we can add the terminating null character C-strings expect: from_{{ name }} = ({{ cType }}) malloc({{ name }}.length() + 1); // copy the characters from the nodejs string into our C-string (used instead of strdup or strcpy because nulls in @@ -47,18 +47,18 @@ memset((void *)(((char *)from_{{ name }}) + {{ name }}.length()), 0, 1); {%elsif cppClassName == 'Array'%} - Array *tmp_{{ name }} = Array::Cast(*info[{{ jsArg }}]); - from_{{ name }} = ({{ cType }})malloc(tmp_{{ name }}->Length() * sizeof({{ cType|replace '**' '*' }})); + v8::Local tmp_{{ name }} = v8::Local::Cast(info[{{ jsArg }}]); + from_{{ name }} = ({{ cType }})malloc(tmp_{{ name }}->Length() * sizeof({{ cType|unPointer }})); for (unsigned int i = 0; i < tmp_{{ name }}->Length(); i++) { {%-- // FIXME: should recursively call convertFromv8. --%} - from_{{ name }}[i] = Nan::ObjectWrap::Unwrap<{{ arrayElementCppClassName }}>(tmp_{{ name }}->Get(Nan::New(static_cast(i)))->ToObject())->GetValue(); + from_{{ name }}[i] = {%if not cType|isDoublePointer %}*{%endif%}Nan::ObjectWrap::Unwrap<{{ arrayElementCppClassName }}>(Nan::To(Nan::Get(tmp_{{ name }}, Nan::New(static_cast(i))).ToLocalChecked()).ToLocalChecked())->GetValue(); } {%elsif cppClassName == 'Function'%} {%elsif cppClassName == 'Buffer'%} - from_{{ name }} = Buffer::Data(info[{{ jsArg }}]->ToObject()); + from_{{ name }} = Buffer::Data(Nan::To(info[{{ jsArg }}]).ToLocalChecked()); {%elsif cppClassName|isV8Value %} {%if cType|isPointer %} @@ -69,14 +69,14 @@ {%elsif cppClassName == 'GitOid'%} if (info[{{ jsArg }}]->IsString()) { // Try and parse in a string to a git_oid - String::Utf8Value oidString(info[{{ jsArg }}]->ToString()); + Nan::Utf8String oidString(Nan::To(info[{{ jsArg }}]).ToLocalChecked()); git_oid *oidOut = (git_oid *)malloc(sizeof(git_oid)); if (git_oid_fromstr(oidOut, (const char *) strdup(*oidString)) != GIT_OK) { free(oidOut); - if (giterr_last()) { - return Nan::ThrowError(giterr_last()->message); + if (git_error_last()) { + return Nan::ThrowError(git_error_last()->message); } else { return Nan::ThrowError("Unknown Error"); } @@ -89,10 +89,10 @@ {%endif%} } else { - {%if cType|isDoublePointer %}*{%endif%}from_{{ name }} = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info[{{ jsArg }}]->ToObject())->GetValue(); + {%if cType|isDoublePointer %}*{%endif%}from_{{ name }} = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(Nan::To(info[{{ jsArg }}]).ToLocalChecked())->GetValue(); } {%else%} - {%if cType|isDoublePointer %}*{%endif%}from_{{ name }} = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info[{{ jsArg }}]->ToObject())->GetValue(); + {%if cType|isDoublePointer %}*{%endif%}from_{{ name }} = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(Nan::To(info[{{ jsArg }}]).ToLocalChecked())->GetValue(); {%endif%} {%if isBoolean %} diff --git a/generate/templates/partials/convert_to_v8.cc b/generate/templates/partials/convert_to_v8.cc index 908f99018..a7a251938 100644 --- a/generate/templates/partials/convert_to_v8.cc +++ b/generate/templates/partials/convert_to_v8.cc @@ -5,6 +5,9 @@ to = Nan::New({{= parsedName =}}, {{ size }}).ToLocalChecked(); {% elsif cType == 'char **' %} to = Nan::New(*{{= parsedName =}}).ToLocalChecked(); + {% elsif cType == 'char' %} + char convertToNullTerminated[2] = { {{= parsedName =}}, '\0' }; + to = Nan::New(convertToNullTerminated).ToLocalChecked(); {% else %} to = Nan::New({{= parsedName =}}).ToLocalChecked(); {% endif %} @@ -18,8 +21,19 @@ {% endif %} {% elsif cppClassName|isV8Value %} - - {% if isCppClassIntType %} + {% if cType|isArrayType %} + v8::Local tmpArray = Nan::New({{ cType|toSizeOfArray }}); + for (unsigned int i = 0; i < {{ cType|toSizeOfArray }}; i++) { + v8::Local element; + {% if isCppClassIntType %} + element = Nan::New<{{ cppClassName }}>(({{ parsedClassName }}){{= parsedName =}}[i]); + {% else %} + element = Nan::New<{{ cppClassName }}>({% if needsDereference %}*{% endif %}{{= parsedName =}}[i]); + {% endif %} + Nan::Set(tmpArray, Nan::New(i), element); + } + to = tmpArray; + {% elsif isCppClassIntType %} to = Nan::New<{{ cppClassName }}>(({{ parsedClassName }}){{= parsedName =}}); {% else %} to = Nan::New<{{ cppClassName }}>({% if needsDereference %}*{% endif %}{{= parsedName =}}); @@ -54,47 +68,46 @@ } {% endif %} {% else %} - {% if copy %} - if ({{= parsedName =}} != NULL) { - {{= parsedName =}} = ({{ cType|replace '**' '*' }} {% if not cType|isPointer %}*{% endif %}){{ copy }}({{= parsedName =}}); - } + {% if cType|isArrayType %} + v8::Local tmpArray = Nan::New({{ cType|toSizeOfArray }}); + for (unsigned int i = 0; i < {{ cType|toSizeOfArray }}; i++) { {% endif %} - - if ({{= parsedName =}} != NULL) { + if ({{ cType|asElementPointer parsedName }} != NULL) { {% if hasOwner %} v8::Local owners = Nan::New(0); {% if ownedBy %} {% if isAsync %} {% each ownedBy as owner %} - Nan::Set(owners, Nan::New(owners->Length()), this->GetFromPersistent("{{= owner =}}")->ToObject()); + {%-- If the owner of this object is "this" in an async method, it will be stored in the persistent handle by name. --%} + Nan::Set(owners, Nan::New(owners->Length()), Nan::To(this->GetFromPersistent("{{= owner =}}")).ToLocalChecked()); {% endeach %} {% else %} {% each ownedByIndices as ownedByIndex %} - Nan::Set(owners, Nan::New(owners->Length()), info[{{= ownedByIndex =}}]->ToObject()); + Nan::Set(owners, Nan::New(owners->Length()), Nan::To(info[{{= ownedByIndex =}}]).ToLocalChecked()); {% endeach %} {% endif %} {% endif %} {%if isAsync %} {% elsif ownedByThis %} + {%-- If the owner of this object is "this", it will be retrievable from the info object in a sync method. --%} Nan::Set(owners, owners->Length(), info.This()); {% endif %} {% if ownerFn | toBool %} Nan::Set( owners, Nan::New(owners->Length()), - {{= ownerFn.singletonCppClassName =}}::New( - {{= ownerFn.name =}}({{= parsedName =}}), + Nan::To({{= ownerFn.singletonCppClassName =}}::New( + {{= ownerFn.name =}}({{ cType|asElementPointer parsedName }}), true - )->ToObject() + )).ToLocalChecked() ); {% endif %} {% endif %} - // {{= cppClassName }} {{= parsedName }} {% if cppClassName == 'Wrapper' %} - to = {{ cppClassName }}::New({{= parsedName =}}); + to = {{ cppClassName }}::New({{ cType|asElementPointer parsedName }}); {% else %} to = {{ cppClassName }}::New( - {{= parsedName =}}, + {{ cType|asElementPointer parsedName }}, {{ selfFreeing|toBool }} {% if hasOwner %} , owners @@ -105,6 +118,10 @@ else { to = Nan::Null(); } - + {% if cType|isArrayType %} + Nan::Set(tmpArray, Nan::New(i), to); + } + to = tmpArray; + {% endif %} {% endif %} // end convert_to_v8 block diff --git a/generate/templates/partials/field_accessors.cc b/generate/templates/partials/field_accessors.cc index 6325587d3..35b583bdc 100644 --- a/generate/templates/partials/field_accessors.cc +++ b/generate/templates/partials/field_accessors.cc @@ -39,11 +39,11 @@ } {% elsif field.isLibgitType %} - v8::Local {{ field.name }}(value->ToObject()); + v8::Local {{ field.name }}(Nan::To(value).ToLocalChecked()); wrapper->{{ field.name }}.Reset({{ field.name }}); - wrapper->raw->{{ field.name }} = {% if not field.cType | isPointer %}*{% endif %}{% if field.cppClassName == 'GitStrarray' %}StrArrayConverter::Convert({{ field.name }}->ToObject()){% else %}Nan::ObjectWrap::Unwrap<{{ field.cppClassName }}>({{ field.name }}->ToObject())->GetValue(){% endif %}; + wrapper->raw->{{ field.name }} = {% if not field.cType | isPointer %}*{% endif %}{% if field.cppClassName == 'GitStrarray' %}StrArrayConverter::Convert(Nan::To({{ field.name }}).ToLocalChecked()){% else %}Nan::ObjectWrap::Unwrap<{{ field.cppClassName }}>(Nan::To({{ field.name }}).ToLocalChecked())->GetValue(){% endif %}; {% elsif field.isCallbackFunction %} Nan::Callback *callback = NULL; @@ -72,7 +72,7 @@ Nan::MaybeLocal maybeObjectWaitForResult = Nan::Get(object, Nan::New("waitForResult").ToLocalChecked()); if(!maybeObjectWaitForResult.IsEmpty()) { Local objectWaitForResult = maybeObjectWaitForResult.ToLocalChecked(); - waitForResult = (bool)objectWaitForResult->BooleanValue(); + waitForResult = Nan::To(objectWaitForResult).FromJust(); } } } @@ -92,7 +92,7 @@ if (wrapper->GetValue()->{{ field.name }}) { } - String::Utf8Value str(value); + Nan::Utf8String str(value); wrapper->GetValue()->{{ field.name }} = strdup(*str); {% elsif field.isCppClassIntType %} @@ -179,92 +179,34 @@ return; } - {% each field.args|argsInfo as arg %} - {% if arg.name == "payload" %} - {%-- Do nothing --%} - {% elsif arg.isJsArg %} - {% if arg.cType == "const char *" %} - if (baton->{{ arg.name }} == NULL) { - baton->{{ arg.name }} = ""; - } - {% elsif arg.cppClassName == "String" %} - v8::Local src; - if (baton->{{ arg.name }} == NULL) { - src = Nan::Null(); - } - else { - src = Nan::New(*baton->{{ arg.name }}).ToLocalChecked(); - } - {% endif %} - {% endif %} - {% endeach %} - - {% if field.isSelfReferential %} - {% if field.args|jsArgsCount|subtract 2| setUnsigned == 0 %} - v8::Local *argv = NULL; - {% else %} - v8::Local argv[{{ field.args|jsArgsCount|subtract 2| setUnsigned }}] = { - {% endif %} + {% if field.args|callbackArgsCount == 0 %} + v8::Local *argv = NULL; {% else %} - v8::Local argv[{{ field.args|jsArgsCount }}] = { - {% endif %} - {% each field.args|argsInfo as arg %} - {% if field.isSelfReferential %} - {% if not arg.firstArg %} - {% if field.args|jsArgsCount|subtract 1|or 0 %} - {% if arg.cppClassName == "String" %} - {%-- src is always the last arg --%} - src - {% elsif arg.isJsArg %} - {% if arg.isEnum %} - Nan::New((int)baton->{{ arg.name }}), - {% elsif arg.isLibgitType %} - {{ arg.cppClassName }}::New(baton->{{ arg.name }}, false), - {% elsif arg.cType == "size_t" %} - Nan::New((unsigned int)baton->{{ arg.name }}), - {% elsif arg.name == "payload" %} - {%-- skip, filters should not have a payload --%} - {% else %} - Nan::New(baton->{{ arg.name }}), - {% endif %} - {% endif %} - {% endif %} - {% endif %} - {% else %} - {% if arg.name == "payload" %} - {%-- payload is always the last arg --%} - Nan::New(instance->{{ fields|payloadFor field.name }}) - {% elsif arg.isJsArg %} - {% if arg.isEnum %} - Nan::New((int)baton->{{ arg.name }}), - {% elsif arg.isLibgitType %} - {{ arg.cppClassName }}::New(baton->{{ arg.name }}, false), - {% elsif arg.cType == "size_t" %} - // HACK: NAN should really have an overload for Nan::New to support size_t - Nan::New((unsigned int)baton->{{ arg.name }}), - {% elsif arg.cppClassName == "String" %} - Nan::New(baton->{{ arg.name }}).ToLocalChecked(), - {% else %} - Nan::New(baton->{{ arg.name }}), - {% endif %} + v8::Local argv[{{ field.args|callbackArgsCount }}] = { + {% each field.args|callbackArgsInfo as arg %} + {% if not arg.firstArg %},{% endif %} + {% if arg.isEnum %} + Nan::New((int)baton->{{ arg.name }}) + {% elsif arg.isLibgitType %} + {{ arg.cppClassName }}::New(baton->{{ arg.name }}, false) + {% elsif arg.cType == "size_t" %} + // HACK: NAN should really have an overload for Nan::New to support size_t + Nan::New((unsigned int)baton->{{ arg.name }}) + {% elsif arg.cppClassName == "String" %} + baton->{{ arg.name }} == NULL + ? Nan::EmptyString() + : Nan::New({%if arg.cType | isDoublePointer %}*{% endif %}baton->{{ arg.name }}).ToLocalChecked() + {% else %} + Nan::New(baton->{{ arg.name }}) {% endif %} - {% endif %} - {% endeach %} - {% if not field.isSelfReferential %} - }; - {% elsif field.args|jsArgsCount|subtract 2| setUnsigned > 0 %} + {% endeach %} }; {% endif %} Nan::TryCatch tryCatch; // TODO This should take an async_resource, but we will need to figure out how to pipe the correct context into this - {% if field.isSelfReferential %} - Nan::MaybeLocal maybeResult = Nan::Call(*(instance->{{ field.name }}.GetCallback()), {{ field.args|jsArgsCount|subtract 2| setUnsigned }}, argv); - {% else %} - Nan::MaybeLocal maybeResult = Nan::Call(*(instance->{{ field.name }}.GetCallback()), {{ field.args|jsArgsCount }}, argv); - {% endif %} - + Nan::MaybeLocal maybeResult = Nan::Call(*(instance->{{ field.name }}.GetCallback()), {{ field.args|callbackArgsCount }}, argv); v8::Local result; if (!maybeResult.IsEmpty()) { result = maybeResult.ToLocalChecked(); @@ -283,7 +225,7 @@ } else if (!result->IsNull() && !result->IsUndefined()) { {% if _return.isOutParam %} - {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); + {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(Nan::To(result).ToLocalChecked()); wrapper->selfFreeing = false; *baton->{{ _return.name }} = wrapper->GetValue(); @@ -319,7 +261,7 @@ } else if (!result->IsNull() && !result->IsUndefined()) { {% if _return.isOutParam %} - {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); + {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(Nan::To(result).ToLocalChecked()); wrapper->selfFreeing = false; *baton->{{ _return.name }} = wrapper->GetValue(); diff --git a/generate/templates/partials/fields.cc b/generate/templates/partials/fields.cc index 9d6e6e39d..437975084 100644 --- a/generate/templates/partials/fields.cc +++ b/generate/templates/partials/fields.cc @@ -1,21 +1,24 @@ {% each fields|fieldsInfo as field %} {% if not field.ignore %} + // start field block NAN_METHOD({{ cppClassName }}::{{ field.cppFunctionName }}) { v8::Local to; {% if field | isFixedLengthString %} char* {{ field.name }} = (char *)Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This())->GetValue()->{{ field.name }}; {% else %} - {{ field.cType }} - {% if not field.cppClassName|isV8Value %} - {% if not field.cType|isPointer %} - * + {% if field.cType|isArrayType %} + {{ field.cType|arrayTypeToPlainType }} *{{ field.name }} = + {% else %} + {{ field.cType }} + {% if not field.cppClassName|isV8Value %} + {% if not field.cType|isPointer %}*{% endif %} {% endif %} - {% endif %} - {{ field.name }} = - {% if not field.cppClassName|isV8Value %} - {% if not field.cType|isPointer %} - & + {{ field.name }} = + {% if not field.cppClassName|isV8Value %} + {% if field.cType|isArrayType %}{% elsif not field.cType|isPointer %} + & + {% endif %} {% endif %} {% endif %} Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This())->GetValue()->{{ field.name }}; @@ -24,5 +27,6 @@ {% partial convertToV8 field %} info.GetReturnValue().Set(to); } + // end field block {% endif %} {% endeach %} diff --git a/generate/templates/partials/sync_function.cc b/generate/templates/partials/sync_function.cc index 5f1306dae..4a76463ed 100644 --- a/generate/templates/partials/sync_function.cc +++ b/generate/templates/partials/sync_function.cc @@ -17,7 +17,7 @@ NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) { {%if not arg.isReturn %} {%partial convertFromV8 arg %} {%if arg.saveArg %} - v8::Local {{ arg.name }}(info[{{ arg.jsArg }}]->ToObject()); + v8::Local {{ arg.name }}(Nan::To(info[{{ arg.jsArg }}]).ToLocalChecked()); {{ cppClassName }} *thisObj = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This()); thisObj->{{ cppFunctionName }}_{{ arg.name }}.Reset({{ arg.name }}); @@ -31,7 +31,7 @@ NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) { if (Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This())->GetValue() != NULL) { {%endif%} - giterr_clear(); + git_error_clear(); { // lock master scope start LockMaster lockMaster( @@ -50,7 +50,7 @@ NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) { {%endeach%} ); - {%if .|hasReturnValue %} {{ return.cType }} result = {%endif%} + {%if .|hasReturnType %} {{ return.cType }} result = {%endif%} {{ cFunctionName }}( {%each args|argsInfo as arg %} {%if arg.isReturn %} @@ -67,20 +67,20 @@ NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) { {%endeach%} ); - {%if .|hasReturnValue |and return.isErrorCode %} + {%if .|hasReturnType |and return.isErrorCode %} if (result != GIT_OK) { {%each args|argsInfo as arg %} - {%if arg.shouldAlloc %} - free({{ arg.name }}); - {%elsif arg | isOid %} + {%if arg | isOid %} if (info[{{ arg.jsArg }}]->IsString()) { - free({{ arg.name }}); + free((void *)from_{{ arg.name }}); } + {%elsif arg.shouldAlloc %} + free({{ arg.name }}); {%endif%} {%endeach%} - if (giterr_last()) { - return Nan::ThrowError(giterr_last()->message); + if (git_error_last()) { + return Nan::ThrowError(git_error_last()->message); } else { return Nan::ThrowError("Unknown Error"); } diff --git a/generate/templates/templates/binding.gyp b/generate/templates/templates/binding.gyp index dc0e203e7..1b23ed2fd 100644 --- a/generate/templates/templates/binding.gyp +++ b/generate/templates/templates/binding.gyp @@ -1,21 +1,14 @@ { - "conditions": [ - ["(OS=='win' and node_root_dir.split('\\\\')[-1].startswith('iojs')) or (OS=='mac' and node_root_dir.split('/')[-1].startswith('iojs'))", { - "variables": { - "is_electron%": "1", - } - }, { - "variables": { - "is_electron%": "0", - } - }] - ], + "variables": { + "is_electron%": " target) { Nan::HandleScope scope; - v8::Local object = Nan::New(); + {% if functions|hasFunctionOnRootProto %} + v8::Local object = Nan::New({{ functions|getCPPFunctionForRootProto }}); + {% else %} + v8::Local object = Nan::New(); + {% endif %} {% each functions as function %} {% if not function.ignore %} @@ -87,7 +91,15 @@ using namespace node; {% endif %} {% endeach %} - Nan::Set(target, Nan::New("{{ jsClassName }}").ToLocalChecked(), object); + Nan::Set( + target, + Nan::New("{{ jsClassName }}").ToLocalChecked(), + {% if functions|hasFunctionOnRootProto %} + Nan::GetFunction(object).ToLocalChecked() + {% else %} + object + {% endif %} + ); } {% endif %} diff --git a/generate/templates/templates/nodegit.cc b/generate/templates/templates/nodegit.cc index c1eddd328..6a3fa8ef4 100644 --- a/generate/templates/templates/nodegit.cc +++ b/generate/templates/templates/nodegit.cc @@ -26,14 +26,11 @@ #if (NODE_MODULE_VERSION > 48) v8::Local GetPrivate(v8::Local object, v8::Local key) { - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - v8::Local context = isolate->GetCurrentContext(); - v8::Local privateKey = v8::Private::ForApi(isolate, key); v8::Local value; - v8::Maybe result = object->HasPrivate(context, privateKey); + Nan::Maybe result = Nan::HasPrivate(object, key); if (!(result.IsJust() && result.FromJust())) return v8::Local(); - if (object->GetPrivate(context, privateKey).ToLocal(&value)) + if (Nan::GetPrivate(object, key).ToLocal(&value)) return value; return v8::Local(); } @@ -43,10 +40,7 @@ v8::Local value) { if (value.IsEmpty()) return; - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - v8::Local context = isolate->GetCurrentContext(); - v8::Local privateKey = v8::Private::ForApi(isolate, key); - object->SetPrivate(context, privateKey, value); + Nan::SetPrivate(object, key, value); } #else v8::Local GetPrivate(v8::Local object, @@ -70,7 +64,7 @@ void LockMasterSetStatus(const FunctionCallbackInfo& info) { // convert the first argument to Status if(info.Length() >= 0 && info[0]->IsNumber()) { - v8::Local value = info[0]->ToInt32(v8::Isolate::GetCurrent()); + v8::Local value = Nan::To(info[0]).ToLocalChecked(); LockMaster::Status status = static_cast(value->Value()); if(status >= LockMaster::Disabled && status <= LockMaster::Enabled) { LockMaster::SetStatus(status); @@ -91,7 +85,7 @@ void LockMasterGetDiagnostics(const FunctionCallbackInfo& info) { // return a plain JS object with properties v8::Local result = Nan::New(); - result->Set(Nan::New("storedMutexesCount").ToLocalChecked(), Nan::New(diagnostics.storedMutexesCount)); + Nan::Set(result, Nan::New("storedMutexesCount").ToLocalChecked(), Nan::New(diagnostics.storedMutexesCount)); info.GetReturnValue().Set(result); } @@ -149,11 +143,11 @@ extern "C" void init(v8::Local target) { NODE_SET_METHOD(target, "getThreadSafetyDiagnostics", LockMasterGetDiagnostics); v8::Local threadSafety = Nan::New(); - threadSafety->Set(Nan::New("DISABLED").ToLocalChecked(), Nan::New((int)LockMaster::Disabled)); - threadSafety->Set(Nan::New("ENABLED_FOR_ASYNC_ONLY").ToLocalChecked(), Nan::New((int)LockMaster::EnabledForAsyncOnly)); - threadSafety->Set(Nan::New("ENABLED").ToLocalChecked(), Nan::New((int)LockMaster::Enabled)); + Nan::Set(threadSafety, Nan::New("DISABLED").ToLocalChecked(), Nan::New((int)LockMaster::Disabled)); + Nan::Set(threadSafety, Nan::New("ENABLED_FOR_ASYNC_ONLY").ToLocalChecked(), Nan::New((int)LockMaster::EnabledForAsyncOnly)); + Nan::Set(threadSafety, Nan::New("ENABLED").ToLocalChecked(), Nan::New((int)LockMaster::Enabled)); - target->Set(Nan::New("THREAD_SAFETY").ToLocalChecked(), threadSafety); + Nan::Set(target, Nan::New("THREAD_SAFETY").ToLocalChecked(), threadSafety); LockMaster::Initialize(); } diff --git a/generate/templates/templates/struct_content.cc b/generate/templates/templates/struct_content.cc index 9840cfe4f..0450447ac 100644 --- a/generate/templates/templates/struct_content.cc +++ b/generate/templates/templates/struct_content.cc @@ -67,6 +67,8 @@ using namespace std; this->raw->{{ fields|payloadFor field.name }} = NULL; {% endif %} } + {% elsif field.hasConstructor |or field.isLibgitType %} + this->{{ field.name }}.Reset(); {% endif %} {% endif %} {% endif %} @@ -78,10 +80,10 @@ void {{ cppClassName }}::ConstructFields() { {% if not field.ignore %} {% if not field.isEnum %} {% if field.hasConstructor |or field.isLibgitType %} - v8::Local {{ field.name }}Temp = {{ field.cppClassName }}::New( + v8::Local {{ field.name }}Temp = Nan::To({{ field.cppClassName }}::New( {%if not field.cType|isPointer %}&{%endif%}this->raw->{{ field.name }}, false - )->ToObject(); + )).ToLocalChecked(); this->{{ field.name }}.Reset({{ field.name }}Temp); {% elsif field.isCallbackFunction %} diff --git a/guides/cloning/README.md b/guides/cloning/README.md index 2b1fa508a..8b8390f23 100644 --- a/guides/cloning/README.md +++ b/guides/cloning/README.md @@ -85,7 +85,7 @@ to passthrough the certificate check. ``` javascript cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; } + certificateCheck: function() { return 0; } } }; ``` diff --git a/guides/cloning/gh-two-factor/README.md b/guides/cloning/gh-two-factor/README.md index a3b8bbb3f..a6d24d40d 100644 --- a/guides/cloning/gh-two-factor/README.md +++ b/guides/cloning/gh-two-factor/README.md @@ -101,7 +101,7 @@ to passthrough the certificate check. ``` javascript cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; } + certificateCheck: function() { return 0; } } }; ``` @@ -119,7 +119,7 @@ The `fetchOpts` object now looks like this: ``` javascript cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; }, + certificateCheck: function() { return 0; }, credentials: function() { return NodeGit.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic"); } diff --git a/guides/cloning/gh-two-factor/index.js b/guides/cloning/gh-two-factor/index.js index d723e52cc..1f34c5756 100644 --- a/guides/cloning/gh-two-factor/index.js +++ b/guides/cloning/gh-two-factor/index.js @@ -22,7 +22,7 @@ var cloneOptions = {}; // with libgit2 being able to verify certificates from GitHub. cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; }, + certificateCheck: function() { return 0; }, credentials: function() { return NodeGit.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic"); } diff --git a/guides/cloning/index.js b/guides/cloning/index.js index f6b7c7a37..ec455fbd7 100644 --- a/guides/cloning/index.js +++ b/guides/cloning/index.js @@ -18,7 +18,7 @@ var cloneOptions = {}; // with libgit2 being able to verify certificates from GitHub. cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; } + certificateCheck: function() { return 0; } } }; diff --git a/guides/cloning/ssh-with-agent/README.md b/guides/cloning/ssh-with-agent/README.md index b2cfbe8ce..46a72b823 100644 --- a/guides/cloning/ssh-with-agent/README.md +++ b/guides/cloning/ssh-with-agent/README.md @@ -83,7 +83,7 @@ to passthrough the certificate check. ``` javascript cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; } + certificateCheck: function() { return 0; } } }; ``` @@ -102,7 +102,7 @@ The `fetchOpts` object now looks like this: ``` javascript cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; }, + certificateCheck: function() { return 0; }, credentials: function(url, userName) { return NodeGit.Cred.sshKeyFromAgent(userName); } diff --git a/guides/cloning/ssh-with-agent/index.js b/guides/cloning/ssh-with-agent/index.js index f3926392c..b8f5a3aac 100644 --- a/guides/cloning/ssh-with-agent/index.js +++ b/guides/cloning/ssh-with-agent/index.js @@ -17,7 +17,7 @@ var cloneOptions = {}; // with libgit2 being able to verify certificates from GitHub. cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; }, + certificateCheck: function() { return 0; }, // Credentials are passed two arguments, url and username. We forward the // `userName` argument to the `sshKeyFromAgent` function to validate diff --git a/lib/attr.js b/lib/attr.js new file mode 100644 index 000000000..8ecdd5eee --- /dev/null +++ b/lib/attr.js @@ -0,0 +1,20 @@ +var util = require("util"); +var NodeGit = require("../"); + +NodeGit.Attr.STATES = {}; +var DEPRECATED_STATES = { + UNSPECIFIED_T: "UNSPECIFIED", + TRUE_T: "TRUE", + FALSE_T: "FALSE", + VALUE_T: "STRING" +}; + +Object.keys(DEPRECATED_STATES).forEach((key) => { + const newKey = DEPRECATED_STATES[key]; + Object.defineProperty(NodeGit.Attr.STATES, key, { + get: util.deprecate( + () => NodeGit.Attr.VALUE[newKey], + `Use NodeGit.Attr.VALUE.${newKey} instead of NodeGit.Attr.STATES.${key}.` + ) + }); +}); diff --git a/lib/blame.js b/lib/blame.js index 7893d0c87..520bb8ce7 100644 --- a/lib/blame.js +++ b/lib/blame.js @@ -11,6 +11,7 @@ var _file = Blame.file; * @param {Repository} repo that contains the file * @param {String} path to the file to get the blame of * @param {BlameOptions} [options] Options for the blame + * @return {Blame} the blame */ Blame.file = function(repo, path, options) { options = normalizeOptions(options, NodeGit.BlameOptions); diff --git a/lib/buf.js b/lib/buf.js new file mode 100644 index 000000000..28f34c2a3 --- /dev/null +++ b/lib/buf.js @@ -0,0 +1,11 @@ +const { Buf } = require("../"); + +/** + * Sets the content of a GitBuf to a string. + * @param {string} The utf8 value to set in the buffer. + * The string will be null terminated. + */ +Buf.prototype.setString = function(content) { + const buf = Buffer.from(content + "\0", "utf8"); + this.set(buf, buf.length); +}; diff --git a/lib/commit.js b/lib/commit.js index 232d771b0..033ecdfa1 100644 --- a/lib/commit.js +++ b/lib/commit.js @@ -1,9 +1,11 @@ var events = require("events"); +var fp = require("lodash/fp"); var NodeGit = require("../"); var Commit = NodeGit.Commit; var LookupWrapper = NodeGit.Utils.lookupWrapper; var _amend = Commit.prototype.amend; +var _parent = Commit.prototype.parent; /** * Retrieves the commit pointed to by the oid @@ -50,6 +52,167 @@ Commit.prototype.amend = function ( }); }; +/** + * Amend a commit with the given signature + * @async + * @param {String} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {String} messageEncoding + * @param {String} message + * @param {Tree|Oid} tree + * @param {Function} onSignature Callback to be called with string to be signed + * @return {Oid} +*/ +Commit.prototype.amendWithSignature = function( + updateRef, + author, + committer, + messageEncoding, + message, + tree, + onSignature +) { + let repo = this.repo; + let parentOids = this.parents(); + let _this = this; + let promises = []; + + if (tree instanceof NodeGit.Oid) { + promises.push(repo.getTree(tree)); + } else { + promises.push(Promise.resolve(tree)); + } + + parentOids.forEach(function (parentOid) { + promises.push(repo.getCommit(parentOid)); + }); + + let treeObject; + let parents; + let commitContent; + let commit; + let skippedSigning; + let resolvedAuthor; + let resolvedCommitter; + let resolvedMessageEncoding; + let resolvedMessage; + let resolvedTree; + + let createCommitPromise = Promise.all(promises) + .then(function(results) { + treeObject = fp.head(results); + parents = fp.tail(results); + return _this.getTree(); + }) + .then(function(commitTreeResult) { + let commitTree = commitTreeResult; + + let truthyArgs = fp.omitBy( + fp.isNil, + { + author, + committer, + messageEncoding, + message, + tree: treeObject + } + ); + + let commitFields = { + author: _this.author(), + committer: _this.committer(), + messageEncoding: _this.messageEncoding(), + message: _this.message(), + tree: commitTree + }; + + ({ + author: resolvedAuthor, + committer: resolvedCommitter, + messageEncoding: resolvedMessageEncoding, + message: resolvedMessage, + tree: resolvedTree + } = fp.assign( + commitFields, + truthyArgs + )); + + return Commit.createBuffer( + repo, + resolvedAuthor, + resolvedCommitter, + resolvedMessageEncoding, + resolvedMessage, + resolvedTree, + parents.length, + parents + ); + }) + .then(function(commitContentResult) { + commitContent = commitContentResult; + if (!commitContent.endsWith("\n")) { + commitContent += "\n"; + } + return onSignature(commitContent); + }) + .then(function({ code, field, signedData }) { + switch (code) { + case NodeGit.Error.CODE.OK: + return Commit.createWithSignature( + repo, + commitContent, + signedData, + field + ); + case NodeGit.Error.CODE.PASSTHROUGH: + skippedSigning = true; + return Commit.create( + repo, + updateRef, + resolvedAuthor, + resolvedCommitter, + resolvedMessageEncoding, + resolvedMessage, + resolvedTree, + parents.length, + parents + ); + default: { + const error = new Error( + `Commit.amendWithSignature threw with error code ${code}` + ); + error.errno = code; + throw error; + } + } + }); + + if (!updateRef) { + return createCommitPromise; + } + + return createCommitPromise + .then(function(commitOid) { + if (skippedSigning) { + return commitOid; + } + + return repo.getCommit(commitOid) + .then(function(commitResult) { + commit = commitResult; + return repo.getReference(updateRef); + }).then(function(ref) { + return ref.setTarget( + commitOid, + `commit (amend): ${commit.summary()}` + ); + }).then(function() { + return commitOid; + }); + }); +}; + /** * Retrieve the commit time as a Date object. * @return {Date} @@ -232,6 +395,21 @@ Commit.prototype.history = function() { return event; }; +/** + * Get the specified parent of the commit. + * + * @param {number} the position of the parent, starting from 0 + * @async + * @return {Commit} the parent commit at the specified position + */ +Commit.prototype.parent = function (id) { + var repository = this.repo; + return _parent.call(this, id).then(function(parent) { + parent.repo = repository; + return parent; + }); +}; + /** * Retrieve the commit's parent shas. * diff --git a/lib/config.js b/lib/config.js index 1527ede7b..10838522a 100644 --- a/lib/config.js +++ b/lib/config.js @@ -1,3 +1,4 @@ +var util = require("util"); var NodeGit = require("../"); var Config = NodeGit.Config; @@ -6,3 +7,19 @@ var Config = NodeGit.Config; Config.prototype.getString = function() { return this.getStringBuf.apply(this, arguments); }; + +NodeGit.Enums.CVAR = {}; +var DEPRECATED_CVAR_ENUMS = [ + "FALSE", + "TRUE", + "INT32", + "STRING" +]; +DEPRECATED_CVAR_ENUMS.forEach((key) => { + Object.defineProperty(NodeGit.Enums.CVAR, key, { + get: util.deprecate( + () => Config.MAP[key], + `Use NodeGit.Config.MAP.${key} instead of NodeGit.Enums.CVAR.${key}.` + ) + }); +}); diff --git a/lib/error.js b/lib/error.js new file mode 100644 index 000000000..819299681 --- /dev/null +++ b/lib/error.js @@ -0,0 +1,17 @@ +var util = require("util"); +var NodeGit = require("../"); + +// Deprecated ----------------------------------------------------------------- + +// In 0.28.0 git_error was majorly refactored to have better naming in libgit2 +// We will continue to support the old enum entries but with a deprecation +// warning as they will go away soon. +Object.keys(NodeGit.Error.CODE).forEach((key) => { + Object.defineProperty(NodeGit.Error.CODE, `GITERR_${key}`, { + get: util.deprecate( + () => NodeGit.Error.CODE[key], + `Use NodeGit.Error.CODE.${key} instead of ` + + `NodeGit.Error.CODE.GETERR_${key}.` + ) + }); +}); diff --git a/lib/index.js b/lib/index.js index cb87784d3..ad37cea78 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,3 +1,4 @@ +var util = require("util"); var NodeGit = require("../"); var Index = NodeGit.Index; @@ -32,3 +33,71 @@ Index.prototype.removeAll = function(pathspec, matchedCallback) { Index.prototype.updateAll = function(pathspec, matchedCallback) { return _updateAll.call(this, pathspec || "*", matchedCallback, null); }; + +// Deprecated ----------------------------------------------------------------- + +NodeGit.Index.CAP = {}; +Object.keys(NodeGit.Index.CAPABILITY).forEach((key) => { + Object.defineProperty(NodeGit.Index.CAP, key, { + get: util.deprecate( + () => NodeGit.Index.CAPABILITY[key], + `Use NodeGit.Index.CAPABILITY.${key} instead of ` + + `NodeGit.Index.CAP.${key}.` + ) + }); +}); + +NodeGit.Enums.INDXENTRY_FLAG = {}; +Object.defineProperty(NodeGit.Enums.INDXENTRY_FLAG, "IDXENTRY_EXTENDED", { + get: util.deprecate( + () => NodeGit.Index.ENTRY_FLAG.ENTRY_EXTENDED, + "Use NodeGit.Index.ENTRY_FLAG.ENTRY_EXTENDED instead of " + + "NodeGit.Enums.INDXENTRY_FLAG.IDXENTRY_EXTENDED." + ) +}); +Object.defineProperty(NodeGit.Enums.INDXENTRY_FLAG, "IDXENTRY_VALID", { + get: util.deprecate( + () => NodeGit.Index.ENTRY_FLAG.ENTRY_VALID, + "Use NodeGit.Index.ENTRY_FLAG.ENTRY_VALID instead of " + + "NodeGit.Enums.INDXENTRY_FLAG.IDXENTRY_VALID." + ) +}); + +NodeGit.Enums.IDXENTRY_EXTENDED_FLAG = {}; +var EXTENDED_FLAGS_MAP = { + IDXENTRY_INTENT_TO_ADD: "ENTRY_INTENT_TO_ADD", + IDXENTRY_SKIP_WORKTREE: "ENTRY_SKIP_WORKTREE", + S: "S", + IDXENTRY_UPTODATE: "ENTRY_UPTODATE" +}; +Object.keys(EXTENDED_FLAGS_MAP).forEach((key) => { + const newKey = EXTENDED_FLAGS_MAP[key]; + Object.defineProperty(NodeGit.Enums.IDXENTRY_EXTENDED_FLAG, key, { + get: util.deprecate( + () => NodeGit.Index.ENTRY_EXTENDED_FLAG[newKey], + `Use NodeGit.Index.ENTRY_EXTENDED_FLAG.${newKey} instead of ` + + `NodeGit.Enums.IDXENTRY_EXTENDED_FLAG.${key}.` + ) + }); +}); + +var DEPRECATED_EXTENDED_FLAGS = { + IDXENTRY_EXTENDED2: 32768, + IDXENTRY_UPDATE: 1, + IDXENTRY_REMOVE: 2, + IDXENTRY_ADDED: 8, + IDXENTRY_HASHED: 16, + IDXENTRY_UNHASHED: 32, + IDXENTRY_WT_REMOVE: 64, + IDXENTRY_CONFLICTED: 128, + IDXENTRY_UNPACKED: 256, + IDXENTRY_NEW_SKIP_WORKTREE: 512, +}; +Object.keys(DEPRECATED_EXTENDED_FLAGS).forEach((key) => { + Object.defineProperty(NodeGit.Enums.IDXENTRY_EXTENDED_FLAG, key, { + get: util.deprecate( + () => DEPRECATED_EXTENDED_FLAGS[key], + "LibGit2 has removed this flag for public usage." + ) + }); +}); diff --git a/lib/object.js b/lib/object.js index 85917987a..680aebd12 100644 --- a/lib/object.js +++ b/lib/object.js @@ -1,3 +1,4 @@ +var util = require("util"); var NodeGit = require("../"); var Obj = NodeGit.Object; @@ -33,3 +34,12 @@ Obj.prototype.isTag = function() { Obj.prototype.isTree = function() { return this.type() == Obj.TYPE.TREE; }; + +// Deprecated ----------------------------------------------------------------- + +Object.defineProperty(Obj.TYPE, "BAD", { + get: util.deprecate( + () => Obj.TYPE.INVALID, + "Use NodeGit.Object.TYPE.INVALID instead of NodeGit.Object.TYPE.BAD." + ) +}); diff --git a/lib/rebase.js b/lib/rebase.js index 28882ea6c..731f54bd5 100644 --- a/lib/rebase.js +++ b/lib/rebase.js @@ -7,25 +7,10 @@ var _init = Rebase.init; var _open = Rebase.open; var _abort = Rebase.prototype.abort; var _commit = Rebase.prototype.commit; -/** - * Initializes a rebase - * @async - * @param {Repository} repo The repository to perform the rebase - * @param {AnnotatedCommit} branch The terminal commit to rebase, or NULL to - * rebase the current branch - * @param {AnnotatedCommit} upstream The commit to begin rebasing from, or NULL - * to rebase all reachable commits - * @param {AnnotatedCommit} onto The branch to rebase onto, or NULL to rebase - * onto the given upstream - * @param {RebaseOptions} options Options to specify how rebase is performed, - * or NULL - * @param {Function} callback - * @return {Remote} - */ function defaultRebaseOptions(options, checkoutStrategy) { - var checkoutOptions; - var mergeOptions; + let checkoutOptions; + let mergeOptions; if (options) { options = shallowClone(options); @@ -34,6 +19,42 @@ function defaultRebaseOptions(options, checkoutStrategy) { delete options.checkoutOptions; delete options.mergeOptions; + if (options.signingCb) { + let signingCb = options.signingCb; + options.signingCb = function ( + signatureBuf, + signatureFieldBuf, + commitContent + ) { + try { + const signingCbResult = signingCb(commitContent); + + return Promise.resolve(signingCbResult) + .then(function({ code, field, signedData }) { + if (code === NodeGit.Error.CODE.OK) { + signatureBuf.setString(signedData); + if (field) { + signatureFieldBuf.setString(field); + } + } + + return code; + }) + .catch(function(error) { + if (error && error.code) { + return error.code; + } + return NodeGit.Error.CODE.ERROR; + }); + } catch (error) { + if (error && error.code) { + return error.code; + } + return NodeGit.Error.CODE.ERROR; + } + }; + } + options = normalizeOptions(options, NodeGit.RebaseOptions); } else { options = normalizeOptions({}, NodeGit.RebaseOptions); @@ -61,12 +82,38 @@ function defaultRebaseOptions(options, checkoutStrategy) { return options; } +// Save options on the rebase object. If we don't do this, +// the options may be cleaned up and cause a segfault +// when Rebase.prototype.commit is called. +const lockOptionsOnRebase = (options) => (rebase) => { + Object.defineProperty(rebase, "options", { + value: options, + writable: false + }); + return rebase; +}; + +/** + * Initializes a rebase + * @async + * @param {Repository} repo The repository to perform the rebase + * @param {AnnotatedCommit} branch The terminal commit to rebase, or NULL to + * rebase the current branch + * @param {AnnotatedCommit} upstream The commit to begin rebasing from, or NULL + * to rebase all reachable commits + * @param {AnnotatedCommit} onto The branch to rebase onto, or NULL to rebase + * onto the given upstream + * @param {RebaseOptions} options Options to specify how rebase is performed, + * or NULL + * @return {Remote} + */ Rebase.init = function(repository, branch, upstream, onto, options) { options = defaultRebaseOptions( options, NodeGit.Checkout.STRATEGY.FORCE ); - return _init(repository, branch, upstream, onto, options); + return _init(repository, branch, upstream, onto, options) + .then(lockOptionsOnRebase(options)); }; /** @@ -75,7 +122,6 @@ Rebase.init = function(repository, branch, upstream, onto, options) { * @async * @param {Repository} repo The repository that has a rebase in-progress * @param {RebaseOptions} options Options to specify how rebase is performed - * @param {Function} callback * @return {Remote} */ Rebase.open = function(repository, options) { @@ -83,7 +129,8 @@ Rebase.open = function(repository, options) { options, NodeGit.Checkout.STRATEGY.SAFE ); - return _open(repository, options); + return _open(repository, options) + .then(lockOptionsOnRebase(options)); }; Rebase.prototype.commit = function(author, committer, encoding, message) { @@ -93,4 +140,3 @@ Rebase.prototype.commit = function(author, committer, encoding, message) { Rebase.prototype.abort = function() { return _abort.call(this); }; - diff --git a/lib/reference.js b/lib/reference.js index 821ace32f..af3e00621 100644 --- a/lib/reference.js +++ b/lib/reference.js @@ -1,3 +1,4 @@ +var util = require("util"); var NodeGit = require("../"); var LookupWrapper = NodeGit.Utils.lookupWrapper; @@ -29,7 +30,7 @@ Reference.lookup = LookupWrapper(Reference); * @return {Boolean} */ Reference.prototype.isConcrete = function() { - return this.type() == Reference.TYPE.OID; + return this.type() == Reference.TYPE.DIRECT; }; /** @@ -63,3 +64,150 @@ Reference.prototype.isValid = function() { Reference.prototype.toString = function() { return this.name(); }; + +const getTerminal = (repo, refName, depth = 10, prevRef = null) => { + if (depth <= 0) { + return Promise.resolve({ + error: NodeGit.Error.CODE.ENOTFOUND, + out: prevRef + }); + } + + return NodeGit.Reference.lookup(repo, refName) + .then((ref) => { + if (ref.type() === NodeGit.Reference.TYPE.DIRECT) { + return { + error: NodeGit.Error.CODE.OK, + out: ref + }; + } else { + return getTerminal(repo, ref.symbolicTarget(), depth - 1, ref) + .then(({ error, out }) => { + if (error === NodeGit.Error.CODE.ENOTFOUND && !out) { + return { error, out: ref }; + } else { + return { error, out }; + } + }); + } + }) + .catch((error) => { + return { + error: error.errno, + out: null + }; + }); +}; + +const getSignatureForReflog = (repo) => { + const { email, name } = repo.ident(); + if (email && name) { + return Promise.resolve(NodeGit.Signature.now(name, email)); + } + + return NodeGit.Signature.default(repo) + .catch(() => NodeGit.Signature.now("unknown", "unknown")); +}; + +/** + * Given a reference name, follows symbolic links and updates the direct + * reference to point to a given OID. Updates the reflog with a given message. + * + * @async + * @param {Repository} repo The repo where the reference and objects live + * @param {String} refName The reference name to update + * @param {Oid} oid The target OID that the reference will point to + * @param {String} logMessage The reflog message to be writted + * @param {Signature} signature Optional signature to use for the reflog entry + */ +Reference.updateTerminal = function ( + repo, + refName, + oid, + logMessage, + signature +) { + let signatureToUse; + let promiseChain = Promise.resolve(); + + if (!signature) { + promiseChain = promiseChain + .then(() => getSignatureForReflog(repo)) + .then((sig) => { + signatureToUse = sig; + return Promise.resolve(); + }); + } else { + signatureToUse = signature; + } + + return promiseChain + .then(() => getTerminal(repo, refName)) + .then(({ error, out }) => { + if (error === NodeGit.Error.CODE.ENOTFOUND && out) { + return NodeGit.Reference.create( + repo, + out.symbolicTarget(), + oid, + 0, + logMessage + ); + } else if (error === NodeGit.Error.CODE.ENOTFOUND) { + return NodeGit.Reference.create( + repo, + refName, + oid, + 0, + logMessage + ); + } else { + return NodeGit.Reference.createMatching( + repo, + out.name(), + oid, + 1, + out.target(), + logMessage + ); + } + }) + .then(() => NodeGit.Reflog.read(repo, refName)) + .then((reflog) => { + // Janky, but works. Ideally, we would want to generate the correct reflog + // entry in the first place, rather than drop the most recent entry and + // write the correct one. + // NOTE: There is a theoretical race condition that could happen here. + // We may want to consider some kind of transactional logic to make sure + // that the reflog on disk isn't modified before we can write back. + reflog.drop(0, 1); + reflog.append(oid, signatureToUse, logMessage); + return reflog.write(); + }); +}; + +// Deprecated ----------------------------------------------------------------- + +Object.defineProperty(NodeGit.Reference.TYPE, "OID", { + get: util.deprecate( + () => NodeGit.Reference.TYPE.DIRECT, + "Use NodeGit.Reference.TYPE.DIRECT instead of NodeGit.Reference.TYPE.OID." + ) +}); + +Object.defineProperty(NodeGit.Reference.TYPE, "LISTALL", { + get: util.deprecate( + () => NodeGit.Reference.TYPE.ALL, + "Use NodeGit.Reference.TYPE.ALL instead of NodeGit.Reference.TYPE.LISTALL." + ) +}); + +NodeGit.Reference.NORMALIZE = {}; +Object.keys(NodeGit.Reference.FORMAT).forEach((key) => { + Object.defineProperty(NodeGit.Reference.NORMALIZE, `REF_FORMAT_${key}`, { + get: util.deprecate( + () => NodeGit.Reference.FORMAT[key], + `Use NodeGit.Reference.FORMAT.${key} instead of ` + + `NodeGit.Reference.NORMALIZE.REF_FORMAT_${key}.` + ) + }); +}); diff --git a/lib/remote.js b/lib/remote.js index b7c897957..510ce9b8b 100644 --- a/lib/remote.js +++ b/lib/remote.js @@ -1,3 +1,4 @@ +var util = require("util"); var NodeGit = require("../"); var normalizeFetchOptions = NodeGit.Utils.normalizeFetchOptions; var normalizeOptions = NodeGit.Utils.normalizeOptions; @@ -6,6 +7,7 @@ var shallowClone = NodeGit.Utils.shallowClone; var Remote = NodeGit.Remote; var _connect = Remote.prototype.connect; +var _createWithOpts = Remote.createWithOpts; var _download = Remote.prototype.download; var _fetch = Remote.prototype.fetch; var _push = Remote.prototype.push; @@ -45,6 +47,11 @@ Remote.prototype.connect = function( return _connect.call(this, direction, callbacks, proxyOpts, customHeaders); }; +Remote.createWithOpts = function(url, options) { + return _createWithOpts(url, normalizeOptions( + options, NodeGit.RemoteCreateOptions)); +}; + /** * Connects to a remote * @@ -176,3 +183,22 @@ Remote.prototype.upload = function(refSpecs, opts) { return _upload.call(this, refSpecs, opts); }; + + +NodeGit.Remote.COMPLETION_TYPE = {}; +var DEPRECATED_STATES = { + COMPLETION_DOWNLOAD: "DOWNLOAD", + COMPLETION_INDEXING: "INDEXING", + COMPLETION_ERROR: "ERROR" +}; + +Object.keys(DEPRECATED_STATES).forEach((key) => { + const newKey = DEPRECATED_STATES[key]; + Object.defineProperty(NodeGit.Remote.COMPLETION_TYPE, key, { + get: util.deprecate( + () => NodeGit.Remote.COMPLETION[newKey], + `Use NodeGit.Remote.COMPLETION.${newKey} instead of ` + + `NodeGit.Remote.COMPLETION_TYPE.${key}.` + ) + }); +}); diff --git a/lib/repository.js b/lib/repository.js index d5e941134..aa7c406e4 100644 --- a/lib/repository.js +++ b/lib/repository.js @@ -174,6 +174,22 @@ function getPathHunks(repo, index, filePath, isStaged, additionalDiffOptions) { }); } +function getReflogMessageForCommit(commit) { + var parentCount = commit.parentcount(); + var summary = commit.summary(); + var commitType; + + if (parentCount >= 2) { + commitType = " (merge)"; + } else if (parentCount == 0) { + commitType = " (initial)"; + } else { + commitType = ""; + } + + return `commit${commitType}: ${summary}`; +} + /** * Goes through a rebase's rebase operations and commits them if there are * no merge conflicts @@ -333,44 +349,19 @@ Repository.initExt = function(repo_path, opts) { }; -Repository.getReferences = function(repo, type, refNamesOnly, callback) { - return Reference.list(repo).then(function(refList) { - var refFilterPromises = []; - var filteredRefs = []; - - refList.forEach(function(refName) { - refFilterPromises.push(Reference.lookup(repo, refName) - .then(function(ref) { - if (type == Reference.TYPE.LISTALL || ref.type() == type) { - if (refNamesOnly) { - filteredRefs.push(refName); - return; - } - - if (ref.isSymbolic()) { - return ref.resolve().then(function(resolvedRef) { - resolvedRef.repo = repo; - - filteredRefs.push(resolvedRef); - }) - .catch(function() { - // If we can't resolve the ref then just ignore it. - }); - } - else { - filteredRefs.push(ref); - } - } - }) - ); +Repository.getReferences = function(repo, type, refNamesOnly) { + return repo.getReferences().then(function(refList) { + var filteredRefList = refList.filter(function(reference) { + return type === Reference.TYPE.ALL || reference.type === type; }); - return Promise.all(refFilterPromises).then(function() { - if (typeof callback === "function") { - callback(null, filteredRefs); - } - return filteredRefs; - }, callback); + if (refNamesOnly) { + return filteredRefList.map(function(reference) { + return reference.name(); + }); + } + + return filteredRefList; }); }; @@ -439,38 +430,56 @@ Repository.prototype.checkoutRef = function(reference, opts) { * promise, finish() will be called when the * promise resolves. This callback will be * provided a detailed overview of the rebase + * @param {RebaseOptions} rebaseOptions Options to initialize the rebase object + * with * @return {Oid|Index} A commit id for a succesful merge or an index for a * rebase with conflicts */ Repository.prototype.continueRebase = function( signature, beforeNextFn, - beforeFinishFn + beforeFinishFn, + rebaseOptions ) { - var repo = this; + const repo = this; - signature = signature || repo.defaultSignature(); + let rebase; + let promiseChain = Promise.resolve(); - var rebase; - return repo.refreshIndex() - .then(function(index) { + if (!signature) { + promiseChain = promiseChain + .then(() => repo.defaultSignature()) + .then((signatureResult) => { + signature = signatureResult; + }); + } + + return promiseChain + .then(() => repo.refreshIndex()) + .then((index) => { if (index.hasConflicts()) { throw index; } - return NodeGit.Rebase.open(repo); + return NodeGit.Rebase.open(repo, rebaseOptions); }) - .then(function(_rebase) { + .then((_rebase) => { rebase = _rebase; return rebase.commit(null, signature) - .catch(function() { - // Ignore all errors to prevent - // this routine from choking now - // that we made rebase.commit - // asynchronous + .catch((e) => { + // If the first commit on continueRebase is a + // "patch already applied" error, + // interpret that as an explicit "skip commit" + // and ignore the error. + const errno = fp.get(["errno"], e); + if (errno === NodeGit.Error.CODE.EAPPLIED) { + return; + } + + throw e; }); }) - .then(function() { + .then(() => { return performRebase( repo, rebase, @@ -479,7 +488,7 @@ Repository.prototype.continueRebase = function( beforeFinishFn ); }) - .then(function(error) { + .then((error) => { if (error) { throw error; } @@ -521,6 +530,7 @@ Repository.prototype.createBranch = function(name, commit, force) { /** * Create a blob from a buffer * + * @async * @param {Buffer} buffer * @return {Oid} */ @@ -622,6 +632,128 @@ Repository.prototype.createCommitBuffer = function( }); }; +/** + * Create a commit that is digitally signed + * + * @async + * @param {String} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {String} message + * @param {Tree|Oid|String} Tree + * @param {Array} parents + * @param {Function} onSignature Callback to be called with string to be signed + * @return {Oid} The oid of the commit + */ +Repository.prototype.createCommitWithSignature = function( + updateRef, + author, + committer, + message, + tree, + parents, + onSignature +) { + + var repo = this; + var promises = []; + var commitContent; + var skippedSigning; + + parents = parents || []; + + promises.push(repo.getTree(tree)); + + parents.forEach(function(parent) { + promises.push(repo.getCommit(parent)); + }); + + const createCommitPromise = Promise.all(promises).then(function(results) { + tree = results[0]; + + // Get the normalized values for our input into the function + var parentsLength = parents.length; + parents = []; + + for (var i = 0; i < parentsLength; i++) { + parents.push(results[i + 1]); + } + + return Commit.createBuffer( + repo, + author, + committer, + null /* use default message encoding */, + message, + tree, + parents.length, + parents + ); + }).then(function(commitContentResult) { + commitContent = commitContentResult; + if (!commitContent.endsWith("\n")) { + commitContent += "\n"; + } + return onSignature(commitContent); + }).then(function({ code, field, signedData }) { + switch (code) { + case NodeGit.Error.CODE.OK: + return Commit.createWithSignature( + repo, + commitContent, + signedData, + field + ); + case NodeGit.Error.CODE.PASSTHROUGH: + skippedSigning = true; + return Commit.create( + repo, + updateRef, + author, + committer, + null /* use default message encoding */, + message, + tree, + parents.length, + parents + ); + default: { + const error = new Error( + "Repository.prototype.createCommitWithSignature " + + `threw with error code ${code}` + ); + error.errno = code; + throw error; + } + } + }); + + if (!updateRef) { + return createCommitPromise; + } + + return createCommitPromise + .then(function(commitOid) { + if (skippedSigning) { + return commitOid; + } + + return repo.getCommit(commitOid) + .then(function(commitResult) { + return Reference.updateTerminal( + repo, + updateRef, + commitOid, + getReflogMessageForCommit(commitResult), + committer + ); + }) + .then(function() { + return commitOid; + }); + }); +}; + /** * Creates a new commit on HEAD from the list of passed in files * @@ -704,8 +836,7 @@ Repository.prototype.createLightweightTag = function(oid, name, callback) { * Instantiate a new revision walker for browsing the Repository"s history. * See also `Commit.prototype.history()` * - * @param {String|Oid} String sha or Oid - * @return {RevWalk} + * @return {Revwalk} */ Repository.prototype.createRevWalk = function() { return Revwalk.create(this); @@ -722,31 +853,40 @@ Repository.prototype.createRevWalk = function() { * @return {Tag} */ Repository.prototype.createTag = function(oid, name, message, callback) { - var repository = this; - var signature = repository.defaultSignature(); + const repository = this; + let signature = null; - return Commit.lookup(repository, oid) - .then(function(commit) { + return repository.defaultSignature() + .then((signatureResult) => { + signature = signatureResult; + return Commit.lookup(repository, oid); + }) + .then((commit) => { // Final argument is `force` which overwrites any previous tag return Tag.create(repository, name, commit, signature, message, 0); }) - .then(function(tagOid) { + .then((tagOid) => { return repository.getTag(tagOid, callback); }); }; /** * Gets the default signature for the default user and now timestamp + * + * @async * @return {Signature} */ Repository.prototype.defaultSignature = function() { - var result = NodeGit.Signature.default(this); - - if (!result || !result.name()) { - result = NodeGit.Signature.now("unknown", "unknown@example.com"); - } - - return result; + return NodeGit.Signature.default(this) + .then((result) => { + if (!result || !result.name()) { + result = NodeGit.Signature.now("unknown", "unknown@example.com"); + } + return result; + }) + .catch(() => { + return NodeGit.Signature.now("unknown", "unknown@example.com"); + }); }; /** @@ -903,7 +1043,7 @@ Repository.prototype.fetchAll = function( var certificateCheck = remoteCallbacks.certificateCheck; var transferProgress = remoteCallbacks.transferProgress; - return repo.getRemotes() + return repo.getRemoteNames() .then(function(remotes) { return remotes.reduce(function(fetchPromise, remote) { var wrappedFetchOptions = shallowClone(fetchOptions); @@ -1113,8 +1253,8 @@ Repository.prototype.getReferenceCommit = function(name, callback) { * @param {Reference.TYPE} type Type of reference to look up * @return {Array} */ -Repository.prototype.getReferenceNames = function(type, callback) { - return Repository.getReferences(this, type, true, callback); +Repository.prototype.getReferenceNames = function(type) { + return Repository.getReferences(this, type, true); }; /** @@ -1124,9 +1264,6 @@ Repository.prototype.getReferenceNames = function(type, callback) { * @param {Reference.TYPE} type Type of reference to look up * @return {Array} */ -Repository.prototype.getReferences = function(type, callback) { - return Repository.getReferences(this, type, false, callback); -}; /** * Gets a remote from the repo @@ -1163,7 +1300,7 @@ Repository.prototype.getRemote = function(remote, callback) { * @param {Function} Optional callback * @return {Object} Promise object. */ -Repository.prototype.getRemotes = function(callback) { +Repository.prototype.getRemoteNames = function(callback) { return Remote.list(this).then(function(remotes) { if (typeof callback === "function") { callback(null, remotes); @@ -1399,6 +1536,8 @@ Repository.prototype.isReverting = function() { * promise, finish() will be called when the * promise resolves. This callback will be * provided a detailed overview of the rebase + * @param {RebaseOptions} rebaseOptions Options to initialize the rebase object + * with * @return {Oid|Index} A commit id for a succesful merge or an index for a * rebase with conflicts */ @@ -1412,12 +1551,21 @@ Repository.prototype.rebaseBranches = function( rebaseOptions ) { - var repo = this; - var branchCommit; - var upstreamCommit; - var ontoCommit; - var mergeOptions = (rebaseOptions || {}).mergeOptions; - signature = signature || repo.defaultSignature(); + const repo = this; + let branchCommit; + let upstreamCommit; + let ontoCommit; + let mergeOptions = (rebaseOptions || {}).mergeOptions; + + let promiseChain = Promise.resolve(); + + if (!signature) { + promiseChain = promiseChain + .then(() => repo.defaultSignature()) + .then((signatureResult) => { + signature = signatureResult; + }); + } return Promise.all([ repo.getReference(branch), @@ -1510,6 +1658,7 @@ Repository.prototype.refreshIndex = function(callback) { * @param {Signature} signature * @param {Merge.PREFERENCE} mergePreference * @param {MergeOptions} mergeOptions + * @param {MergeBranchOptions} mergeBranchOptions * @return {Oid|Index} A commit id for a succesful merge or an index for a * merge with conflicts */ @@ -1519,23 +1668,42 @@ Repository.prototype.mergeBranches = function( signature, mergePreference, mergeOptions, - processMergeMessageCallback + mergeBranchOptions ) { - var repo = this; - var fromBranch; - var toBranch; - processMergeMessageCallback = processMergeMessageCallback || + const repo = this; + let fromBranch; + let toBranch; + // Support old parameter `processMergeMessageCallback` + const isOldOptionParameter = typeof mergeBranchOptions === "function"; + if (isOldOptionParameter) { + console.error("DeprecationWarning: Repository#mergeBranches parameter " + + "processMergeMessageCallback, use MergeBranchOptions"); + } + const processMergeMessageCallback = mergeBranchOptions && + (isOldOptionParameter ? + mergeBranchOptions : + mergeBranchOptions.processMergeMessageCallback) || function (message) { return message; }; + const signingCallback = mergeBranchOptions && mergeBranchOptions.signingCb; mergePreference = mergePreference || NodeGit.Merge.PREFERENCE.NONE; mergeOptions = normalizeOptions(mergeOptions, NodeGit.MergeOptions); - signature = signature || repo.defaultSignature(); + let promiseChain = Promise.resolve(); - return Promise.all([ - repo.getBranch(to), - repo.getBranch(from) - ]).then(function(objects) { + if (!signature) { + promiseChain = promiseChain + .then(() => repo.defaultSignature()) + .then((signatureResult) => { + signature = signatureResult; + }); + } + + return promiseChain.then(() => Promise.all([ + repo.getBranch(to), + repo.getBranch(from) + ])) + .then((objects) => { toBranch = objects[0]; fromBranch = objects[1]; @@ -1544,12 +1712,12 @@ Repository.prototype.mergeBranches = function( repo.getBranchCommit(fromBranch) ]); }) - .then(function(branchCommits) { + .then((branchCommits) => { var toCommitOid = branchCommits[0].toString(); var fromCommitOid = branchCommits[1].toString(); return NodeGit.Merge.base(repo, toCommitOid, fromCommitOid) - .then(function(baseCommit) { + .then((baseCommit) => { if (baseCommit.toString() == fromCommitOid) { // The commit we're merging to is already in our history. // nothing to do so just return the commit the branch is on @@ -1565,7 +1733,7 @@ Repository.prototype.mergeBranches = function( fromBranch.shorthand(); return branchCommits[1].getTree() - .then(function(tree) { + .then((tree) => { if (toBranch.isHead()) { // Checkout the tree if we're on the branch var opts = { @@ -1575,11 +1743,11 @@ Repository.prototype.mergeBranches = function( return NodeGit.Checkout.tree(repo, tree, opts); } }) - .then(function() { + .then(() => { return toBranch.setTarget( fromCommitOid, message) - .then(function() { + .then(() => { return fromCommitOid; }); }); @@ -1588,10 +1756,10 @@ Repository.prototype.mergeBranches = function( var updateHead; // We have to merge. Lets do it! return NodeGit.Reference.lookup(repo, "HEAD") - .then(function(headRef) { + .then((headRef) => { return headRef.resolve(); }) - .then(function(headRef) { + .then((headRef) => { updateHead = !!headRef && (headRef.name() === toBranch.name()); return NodeGit.Merge.commits( repo, @@ -1600,7 +1768,7 @@ Repository.prototype.mergeBranches = function( mergeOptions ); }) - .then(function(index) { + .then((index) => { // if we have conflicts then throw the index if (index.hasConflicts()) { throw index; @@ -1609,7 +1777,7 @@ Repository.prototype.mergeBranches = function( // No conflicts so just go ahead with the merge return index.writeTreeTo(repo); }) - .then(function(oid) { + .then((oid) => { var mergeDecorator; if (fromBranch.isTag()) { mergeDecorator = "tag"; @@ -1633,7 +1801,18 @@ Repository.prototype.mergeBranches = function( return Promise.all([oid, processMergeMessageCallback(message)]); }) - .then(function([oid, message]) { + .then(([oid, message]) => { + if (signingCallback) { + return repo.createCommitWithSignature( + toBranch.name(), + signature, + signature, + message, + oid, + [toCommitOid, fromCommitOid], + signingCallback + ); + } return repo.createCommit( toBranch.name(), signature, @@ -1643,25 +1822,25 @@ Repository.prototype.mergeBranches = function( [toCommitOid, fromCommitOid] ); }) - .then(function(commit) { + .then((commit) => { // we've updated the checked out branch, so make sure we update // head so that our index isn't messed up if (updateHead) { return repo.getBranch(to) - .then(function(branch) { + .then((branch) => { return repo.getBranchCommit(branch); }) - .then(function(branchCommit) { + .then((branchCommit) => { return branchCommit.getTree(); }) - .then(function(tree) { + .then((tree) => { var opts = { checkoutStrategy: NodeGit.Checkout.STRATEGY.SAFE | NodeGit.Checkout.STRATEGY.RECREATE_MISSING }; return NodeGit.Checkout.tree(repo, tree, opts); }) - .then(function() { + .then(() => { return commit; }); } diff --git a/lib/signature.js b/lib/signature.js index 7fc8e274d..4dfe84a36 100644 --- a/lib/signature.js +++ b/lib/signature.js @@ -1,11 +1,38 @@ var NodeGit = require("../"); var Signature = NodeGit.Signature; +const toPaddedDoubleDigitString = (number) => { + if (number < 10) { + return `0${number}`; + } + + return `${number}`; +}; + /** * Standard string representation of an author. - * - * @return {string} Representation of the author. + * @param {Boolean} withTime Whether or not to include timestamp + * @return {String} Representation of the author. */ -Signature.prototype.toString = function() { - return this.name().toString() + " <" + this.email().toString() + ">"; +Signature.prototype.toString = function(withTime) { + const name = this.name().toString(); + const email = this.email().toString(); + + let stringifiedSignature = `${name} <${email}>`; + + if (!withTime) { + return stringifiedSignature; + } + + const when = this.when(); + const offset = when.offset(); + const offsetMagnitude = Math.abs(offset); + const time = when.time(); + + const sign = (offset < 0 || when.sign() === "-") ? "-" : "+"; + const hours = toPaddedDoubleDigitString(Math.floor(offsetMagnitude / 60)); + const minutes = toPaddedDoubleDigitString(offsetMagnitude % 60); + + stringifiedSignature += ` ${time} ${sign}${hours}${minutes}`; + return stringifiedSignature; }; diff --git a/lib/tag.js b/lib/tag.js index bf8ddff49..4c21f45aa 100644 --- a/lib/tag.js +++ b/lib/tag.js @@ -2,11 +2,134 @@ var NodeGit = require("../"); var LookupWrapper = NodeGit.Utils.lookupWrapper; var Tag = NodeGit.Tag; +const signatureRegexesBySignatureType = { + gpgsig: [ + /-----BEGIN PGP SIGNATURE-----[\s\S]+?-----END PGP SIGNATURE-----/gm, + /-----BEGIN PGP MESSAGE-----[\s\S]+?-----END PGP MESSAGE-----/gm, + ], + x509: [ + /-----BEGIN SIGNED MESSAGE-----[\s\S]+?-----END SIGNED MESSAGE-----/gm, + ] +}; + /** -* Retrieves the tag pointed to by the oid -* @async -* @param {Repository} repo The repo that the tag lives in -* @param {String|Oid|Tag} id The tag to lookup -* @return {Tag} -*/ + * Retrieves the tag pointed to by the oid + * @async + * @param {Repository} repo The repo that the tag lives in + * @param {String|Oid|Tag} id The tag to lookup + * @return {Tag} + */ Tag.lookup = LookupWrapper(Tag); + +/** + * @async + * @param {Repository} repo + * @param {String} tagName + * @param {Oid} target + * @param {Signature} tagger + * @return {String} + */ +Tag.createBuffer = function(repo, tagName, target, tagger, message) { + return NodeGit.Object.lookup(repo, target, NodeGit.Object.TYPE.ANY) + .then((object) => { + if (!NodeGit.Object.typeisloose(object.type())) { + throw new Error("Object must be a loose type"); + } + + const id = object.id().toString(); + const objectType = NodeGit.Object.type2String(object.type()); + const lines = [ + `object ${id}`, + `type ${objectType}`, + `tag ${tagName}`, + `tagger ${tagger.toString(true)}\n`, + `${message}${message.endsWith("\n") ? "" : "\n"}` + ]; + return lines.join("\n"); + }); +}; + +/** + * @async + * @param {Repository} repo + * @param {String} tagName + * @param {Oid} target + * @param {Signature} tagger + * @param {String} message + * @param {Number} force + * @param {Function} signingCallback Takes a string and returns a string + * representing the signed message + * @return {Oid} + */ +Tag.createWithSignature = function( + repo, + tagName, + target, + tagger, + message, + force, + signingCallback +) { + let tagBuffer; + return Tag.createBuffer(repo, tagName, target, tagger, message) + .then((tagBufferResult) => { + tagBuffer = tagBufferResult; + return signingCallback(tagBuffer); + }) + .then(({ code, signedData }) => { + switch (code) { + case NodeGit.Error.CODE.OK: { + const normalizedEnding = signedData.endsWith("\n") ? "" : "\n"; + const signedTagString = tagBuffer + signedData + normalizedEnding; + return Tag.createFromBuffer(repo, signedTagString, force); + } + case NodeGit.Error.CODE.PASSTHROUGH: + return Tag.create( + repo, + tagName, + target, + tagger, + message, + force + ); + default: { + const error = new Error( + `Tag.createWithSignature threw with error code ${code}` + ); + error.errno = code; + throw error; + } + } + }); +}; + +/** + * Retrieves the signature of an annotated tag + * @async + * @param {String} signatureType + * @return {String|null} + */ +Tag.prototype.extractSignature = function(signatureType = "gpgsig") { + const id = this.id(); + const repo = this.repo; + const signatureRegexes = signatureRegexesBySignatureType[signatureType]; + if (!signatureRegexes) { + throw new Error("Unsupported signature type"); + } + + return repo.odb().then((odb) => { + return odb.read(id); + }).then((odbObject) => { + const odbData = odbObject.toString(); + + for (const regex of signatureRegexes) { + const matchResult = odbData.match(regex); + + if (matchResult !== null) { + return matchResult[0]; + } + } + + throw new Error("this tag is not signed"); + }); +}; diff --git a/lifecycleScripts/preinstall.js b/lifecycleScripts/preinstall.js index 6d481658b..870cf1558 100644 --- a/lifecycleScripts/preinstall.js +++ b/lifecycleScripts/preinstall.js @@ -8,14 +8,22 @@ module.exports = function prepareForBuild() { console.log("[nodegit] Running pre-install script"); return exec("npm -v") - .then(function(npmVersion) { - if (npmVersion.split(".")[0] < 3) { - console.log("[nodegit] npm@2 installed, pre-loading required packages"); - return exec("npm install --ignore-scripts"); - } + .then( + function(npmVersion) { + if (npmVersion.split(".")[0] < 3) { + console.log( + "[nodegit] npm@2 installed, pre-loading required packages" + ); + return exec("npm install --ignore-scripts"); + } - return Promise.resolve(); - }) + return Promise.resolve(); + }, + function() { + // We're installing via yarn, so don't + // care about compability with npm@2 + } + ) .then(function() { if (buildFlags.isGitRepo) { var submodules = require(local("submodules")); diff --git a/package-lock.json b/package-lock.json index 7f93cb65c..a54150f19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nodegit", - "version": "0.24.0", + "version": "0.25.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -258,6 +258,14 @@ "private": "^0.1.8", "slash": "^1.0.0", "source-map": "^0.5.7" + }, + "dependencies": { + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + } } }, "babel-generator": { @@ -876,14 +884,6 @@ "safe-buffer": "^5.1.1" } }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "requires": { - "inherits": "~2.0.0" - } - }, "boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -1334,9 +1334,9 @@ "dev": true }, "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -1394,6 +1394,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, "requires": { "ms": "2.0.0" } @@ -1905,14 +1906,14 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", "dev": true, "optional": true, "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" }, "dependencies": { "abbrev": { @@ -1933,7 +1934,7 @@ "optional": true }, "are-we-there-yet": { - "version": "1.1.4", + "version": "1.1.5", "bundled": true, "dev": true, "optional": true, @@ -1957,7 +1958,7 @@ } }, "chownr": { - "version": "1.0.1", + "version": "1.1.1", "bundled": true, "dev": true, "optional": true @@ -1984,16 +1985,16 @@ "optional": true }, "debug": { - "version": "2.6.9", + "version": "4.1.1", "bundled": true, "dev": true, "optional": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "deep-extend": { - "version": "0.5.1", + "version": "0.6.0", "bundled": true, "dev": true, "optional": true @@ -2042,7 +2043,7 @@ } }, "glob": { - "version": "7.1.2", + "version": "7.1.3", "bundled": true, "dev": true, "optional": true, @@ -2062,12 +2063,12 @@ "optional": true }, "iconv-lite": { - "version": "0.4.21", + "version": "0.4.24", "bundled": true, "dev": true, "optional": true, "requires": { - "safer-buffer": "^2.1.0" + "safer-buffer": ">= 2.1.2 < 3" } }, "ignore-walk": { @@ -2128,16 +2129,16 @@ "dev": true }, "minipass": { - "version": "2.2.4", + "version": "2.3.5", "bundled": true, "dev": true, "requires": { - "safe-buffer": "^5.1.1", + "safe-buffer": "^5.1.2", "yallist": "^3.0.0" } }, "minizlib": { - "version": "1.1.0", + "version": "1.2.1", "bundled": true, "dev": true, "optional": true, @@ -2154,35 +2155,42 @@ } }, "ms": { - "version": "2.0.0", + "version": "2.1.1", "bundled": true, "dev": true, "optional": true }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true, + "optional": true + }, "needle": { - "version": "2.2.0", + "version": "2.3.0", "bundled": true, "dev": true, "optional": true, "requires": { - "debug": "^2.1.2", + "debug": "^4.1.0", "iconv-lite": "^0.4.4", "sax": "^1.2.4" } }, "node-pre-gyp": { - "version": "0.10.0", + "version": "0.12.0", "bundled": true, "dev": true, "optional": true, "requires": { "detect-libc": "^1.0.2", "mkdirp": "^0.5.1", - "needle": "^2.2.0", + "needle": "^2.2.1", "nopt": "^4.0.1", "npm-packlist": "^1.1.6", "npmlog": "^4.0.2", - "rc": "^1.1.7", + "rc": "^1.2.7", "rimraf": "^2.6.1", "semver": "^5.3.0", "tar": "^4" @@ -2199,13 +2207,13 @@ } }, "npm-bundled": { - "version": "1.0.3", + "version": "1.0.6", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { - "version": "1.1.10", + "version": "1.4.1", "bundled": true, "dev": true, "optional": true, @@ -2280,12 +2288,12 @@ "optional": true }, "rc": { - "version": "1.2.7", + "version": "1.2.8", "bundled": true, "dev": true, "optional": true, "requires": { - "deep-extend": "^0.5.1", + "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" @@ -2315,16 +2323,16 @@ } }, "rimraf": { - "version": "2.6.2", + "version": "2.6.3", "bundled": true, "dev": true, "optional": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" } }, "safe-buffer": { - "version": "5.1.1", + "version": "5.1.2", "bundled": true, "dev": true }, @@ -2341,7 +2349,7 @@ "optional": true }, "semver": { - "version": "5.5.0", + "version": "5.7.0", "bundled": true, "dev": true, "optional": true @@ -2392,17 +2400,17 @@ "optional": true }, "tar": { - "version": "4.4.1", + "version": "4.4.8", "bundled": true, "dev": true, "optional": true, "requires": { - "chownr": "^1.0.1", + "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", + "safe-buffer": "^5.1.2", "yallist": "^3.0.2" } }, @@ -2413,12 +2421,12 @@ "optional": true }, "wide-align": { - "version": "1.1.2", + "version": "1.1.3", "bundled": true, "dev": true, "optional": true, "requires": { - "string-width": "^1.0.2" + "string-width": "^1.0.2 || 2" } }, "wrappy": { @@ -2427,23 +2435,12 @@ "dev": true }, "yallist": { - "version": "3.0.2", + "version": "3.0.3", "bundled": true, "dev": true } } }, - "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -2575,26 +2572,17 @@ "dev": true }, "handlebars": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", - "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", + "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", "dev": true, "requires": { - "async": "^2.5.0", + "neo-async": "^2.6.0", "optimist": "^0.6.1", "source-map": "^0.6.1", "uglify-js": "^3.1.4" }, "dependencies": { - "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "dev": true, - "requires": { - "lodash": "^4.17.10" - } - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -3149,9 +3137,9 @@ "dev": true }, "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -3230,10 +3218,19 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", + "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", + "requires": { + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + } + } }, "jsonfile": { "version": "2.4.0", @@ -3341,9 +3338,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", + "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==" }, "log-driver": { "version": "1.2.7", @@ -3446,18 +3443,10 @@ } } }, - "minizlib": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.1.0.tgz", - "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", - "requires": { - "minipass": "^2.2.1" - } - }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "requires": { "for-in": "^1.0.2", @@ -3551,12 +3540,13 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true }, "nan": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", - "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==" + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" }, "nanomatch": { "version": "1.2.13", @@ -3602,15 +3592,28 @@ } }, "needle": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.4.tgz", - "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz", + "integrity": "sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg==", "requires": { - "debug": "^2.1.2", + "debug": "^3.2.6", "iconv-lite": "^0.4.4", "sax": "^1.2.4" }, "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", @@ -3618,12 +3621,17 @@ } } }, + "neo-async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", + "dev": true + }, "node-gyp": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", - "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-4.0.0.tgz", + "integrity": "sha512-2XiryJ8sICNo6ej8d0idXDEMKfVfFK7kekGCtJAuelGsYHQxhj13KTf95swTCN2dZ/4lTfZ84Fu31jqJEEgjWA==", "requires": { - "fstream": "^1.0.0", "glob": "^7.0.3", "graceful-fs": "^4.1.2", "mkdirp": "^0.5.0", @@ -3633,14 +3641,14 @@ "request": "^2.87.0", "rimraf": "2", "semver": "~5.3.0", - "tar": "^2.0.0", + "tar": "^4.4.8", "which": "1" } }, "node-pre-gyp": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz", - "integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.13.0.tgz", + "integrity": "sha512-Md1D3xnEne8b/HGVQkZZwV27WUi1ZRuZBij24TNaZwUPU3ZAFtvT6xxJGaUVillfmMKnn5oD1HoGsp2Ftik7SQ==", "requires": { "detect-libc": "^1.0.2", "mkdirp": "^0.5.1", @@ -3662,25 +3670,6 @@ "abbrev": "1", "osenv": "^0.1.4" } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "tar": { - "version": "4.4.6", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.6.tgz", - "integrity": "sha512-tMkTnh9EdzxyfW+6GK6fCahagXsnYk6kE6S9Gr9pjVdys769+laCTbodXDhPAjzVtEBazRgP0gYqOjnk9dQzLg==", - "requires": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.3", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } } } }, @@ -3719,14 +3708,14 @@ } }, "npm-bundled": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", - "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", + "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==" }, "npm-packlist": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.11.tgz", - "integrity": "sha512-CxKlZ24urLkJk+9kCm48RTQ7L4hsmgSVzEk0TLGPzzyuFxD7VNgy5Sl24tOLMzQv773a/NeJ1ce1DKeacqffEA==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.4.tgz", + "integrity": "sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw==", "requires": { "ignore-walk": "^3.0.1", "npm-bundled": "^1.0.1" @@ -4787,9 +4776,9 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -5093,13 +5082,32 @@ "dev": true }, "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", - "requires": { - "block-stream": "*", - "fstream": "^1.0.2", - "inherits": "2" + "version": "4.4.8", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", + "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + }, + "dependencies": { + "minizlib": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", + "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "requires": { + "minipass": "^2.2.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } } }, "tar-fs": { @@ -5292,20 +5300,20 @@ "optional": true }, "uglify-js": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", - "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "version": "3.5.15", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.15.tgz", + "integrity": "sha512-fe7aYFotptIddkwcm6YuA0HmknBZ52ZzOsUxZEdhhkSsz7RfjHDX2QDxwKTiv4JQ5t5NhfmpgAK+J7LiDhKSqg==", "dev": true, "optional": true, "requires": { - "commander": "~2.17.1", + "commander": "~2.20.0", "source-map": "~0.6.1" }, "dependencies": { "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "dev": true, "optional": true }, @@ -5331,38 +5339,15 @@ "dev": true }, "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } + "set-value": "^2.0.1" } }, "unique-stream": { diff --git a/package.json b/package.json index 8fc88751b..b055e829f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegit", "description": "Node.js libgit2 asynchronous native bindings", - "version": "0.24.0", + "version": "0.25.0", "homepage": "http://nodegit.org", "keywords": [ "libgit2", @@ -39,10 +39,11 @@ }, "dependencies": { "fs-extra": "^7.0.0", - "lodash": "^4.17.11", - "nan": "^2.11.1", - "node-gyp": "^3.8.0", - "node-pre-gyp": "^0.11.0", + "json5": "^2.1.0", + "lodash": "^4.17.14", + "nan": "^2.14.0", + "node-gyp": "^4.0.0", + "node-pre-gyp": "^0.13.0", "promisify-node": "~0.3.0", "ramda": "^0.25.0", "request-promise-native": "^1.0.5", diff --git a/test/tests/checkout.js b/test/tests/checkout.js index e3815a35f..e821016da 100644 --- a/test/tests/checkout.js +++ b/test/tests/checkout.js @@ -109,60 +109,63 @@ describe("Checkout", function() { }); it("can checkout an index with conflicts", function() { - var test = this; + const test = this; - var testBranchName = "test"; - var ourCommit; + const testBranchName = "test"; + let ourCommit; + let signature; - return test.repository.getBranchCommit(checkoutBranchName) - .then(function(commit) { + return test.repository.defaultSignature() + .then((signatureResult) => { + signature = signatureResult; + return test.repository.getBranchCommit(checkoutBranchName); + }) + .then((commit) => { ourCommit = commit; return test.repository.createBranch(testBranchName, commit.id()); }) - .then(function() { + .then(() => { return test.repository.checkoutBranch(testBranchName); }) - .then(function(branch) { + .then((branch) => { fse.writeFileSync(packageJsonPath, "\n"); return test.repository.refreshIndex() - .then(function(index) { + .then((index) => { return index.addByPath(packageJsonName) - .then(function() { + .then(() => { return index.write(); }) - .then(function() { + .then(() => { return index.writeTree(); }); }); }) - .then(function(oid) { + .then((oid) => { assert.equal(oid.toString(), "85135ab398976a4d5be6a8704297a45f2b1e7ab2"); - var signature = test.repository.defaultSignature(); - return test.repository.createCommit("refs/heads/" + testBranchName, signature, signature, "we made breaking changes", oid, [ourCommit]); }) - .then(function(commit) { + .then((commit) => { return Promise.all([ test.repository.getBranchCommit(testBranchName), test.repository.getBranchCommit("master") ]); }) - .then(function(commits) { + .then((commits) => { return NodeGit.Merge.commits(test.repository, commits[0], commits[1], null); }) - .then(function(index) { + .then((index) => { assert.ok(index); assert.ok(index.hasConflicts && index.hasConflicts()); return NodeGit.Checkout.index(test.repository, index); }) - .then(function() { + .then(() => { // Verify that the conflict has been written to disk var conflictedContent = fse.readFileSync(packageJsonPath, "utf-8"); @@ -178,7 +181,7 @@ describe("Checkout", function() { return Checkout.head(test.repository, opts); }) - .then(function() { + .then(() => { var finalContent = fse.readFileSync(packageJsonPath, "utf-8"); assert.equal(finalContent, "\n"); }); diff --git a/test/tests/clone.js b/test/tests/clone.js index 03a03ade9..e86663e1c 100644 --- a/test/tests/clone.js +++ b/test/tests/clone.js @@ -43,9 +43,7 @@ describe("Clone", function() { var opts = { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } } }; @@ -202,9 +200,7 @@ describe("Clone", function() { var opts = { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } } }; @@ -221,9 +217,7 @@ describe("Clone", function() { var opts = { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - }, + certificateCheck: () => 0, credentials: function(url, userName) { return NodeGit.Cred.sshKeyFromAgent(userName); } @@ -243,9 +237,7 @@ describe("Clone", function() { var opts = { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - }, + certificateCheck: () => 0, credentials: function(url, userName) { return NodeGit.Cred.sshKeyNew( userName, @@ -269,9 +261,7 @@ describe("Clone", function() { var opts = { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - }, + certificateCheck: () => 0, credentials: function(url, userName) { return NodeGit.Cred.sshKeyNew( userName, @@ -296,9 +286,7 @@ describe("Clone", function() { var opts = { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } } }; @@ -328,9 +316,7 @@ describe("Clone", function() { return Clone(url, clonePath, { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - }, + certificateCheck: () => 0, credentials: function() { if (firstPass) { firstPass = false; diff --git a/test/tests/commit.js b/test/tests/commit.js index d6e6a5ce7..237471923 100644 --- a/test/tests/commit.js +++ b/test/tests/commit.js @@ -17,6 +17,7 @@ describe("Commit", function() { var Oid = NodeGit.Oid; var reposPath = local("../repos/workdir"); + var newRepoPath = local("../repos/new"); var oid = "fce88902e66c72b5b93e75bdb5ae717038b221f6"; function reinitialize(test) { @@ -127,6 +128,18 @@ describe("Commit", function() { assert.equal(this.commit.timeOffset(), 780); }); + it("can call getTree on a parent commit", function() { + return this.commit.parent(0) + .then(function(parent) { + return parent.getTree(); + }) + .then(function(tree) { + assert.equal( + tree.id().toString(), "327ff68e59f94f0c25d2c62fb0938efa01e8a107" + ); + }); + }); + it("can create a commit", function() { var test = this; var expectedCommitId = "315e77328ef596f3bc065d8ac6dd2c72c09de8a5"; @@ -450,6 +463,242 @@ describe("Commit", function() { }); }); + describe("amendWithSignature", function() { + it("can amend with signature", function() { + const signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "\n" + + "iQJHBAEBCAAxFiEEKdxGpJ93wnkLaBKfURjJKedOfEMFAlxPKUYTHHN0ZXZla0Bh\n" + + "eG9zb2Z0LmNvbQAKCRBRGMkp5058Q3vcD/0Uf6P68g98Kbvsgjg/aidM1ujruXaw\n" + + "X5WSsCAw+wWGICOj0n+KBnmQruI4HSFz3zykEshuOpcBv1X/+huwDeB/hBqonCU8\n" + + "QdexCdWR70YbT1bufesUwV9v1qwE4WOmFxWXgwh55K0wDRkc0u2aLcwrJkIEEVfs\n" + + "HqZyFzU4kwbGekY/m7d1DsBhWyKEGW9/25WMYmjWOWOiaFjeBaHLlxiEM8KGnMLH\n" + + "wx37NuFuaABgi23AAcBGdeWy04TEuU4S51+bHM3RotrZ2cryW2lEbkkXodhIJcq0\n" + + "RgrStCbvR0ehnOPdYSiRbxK8JNLZuNjHlK2g7wVi+C83vwMQuhU4H6OlYHGVr664\n" + + "4YzL83FdIo7wiMOFd2OOMLlCfHgTun60FvjCs4WHjrwH1fQl287FRPLa/4olBSQP\n" + + "yUXJaZdxm4cB4L/1pmbb/J/XUiOio3MpaN3GFm2hZloUlag1uPDBtCxTl5odvj4a\n" + + "GOmTBWznXxF/zrKnQVSvv+EccNxYFc0VVjAxGgNqPzIxDAKtw1lE5pbBkFpFpNHz\n" + + "StmwZkP9QIJY4hJYQfM+pzHLe8xjexL+Kh/TrYXgY1m/4vJe0HJSsnRnaR8Yfqhh\n" + + "LReqo94VHRYXR0rZQv4py0D9TrWaI8xHLve6ewhLPNRzyaI9fNrinbcPYZZOWnRi\n" + + "ekgUBx+BX6nJOw==\n" + + "=4Hy5\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var repo; + var oid; + var commit; + var message; + var parents; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + message = headCommit.message() + "\n"; + parents = headCommit.parents(); + + return headCommit.amendWithSignature( + null, + null, + null, + null, + null, + null, + onSignature + ); + }) + .then(function(oidResult) { + oid = oidResult; + return NodeGit.Commit.lookup(repo, oid); + }) + .then(function(commitResult) { + commit = commitResult; + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signatureInfo.signature, signedData); + assert.equal(commit.message(), message); + assert.deepEqual(commit.parents(), parents); + }); + }); + + it("will respects overridden arguments", function() { + const signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "\n" + + "iQJHBAEBCAAxFiEEKdxGpJ93wnkLaBKfURjJKedOfEMFAlxPKUYTHHN0ZXZla0Bh\n" + + "eG9zb2Z0LmNvbQAKCRBRGMkp5058Q3vcD/0Uf6P68g98Kbvsgjg/aidM1ujruXaw\n" + + "X5WSsCAw+wWGICOj0n+KBnmQruI4HSFz3zykEshuOpcBv1X/+huwDeB/hBqonCU8\n" + + "QdexCdWR70YbT1bufesUwV9v1qwE4WOmFxWXgwh55K0wDRkc0u2aLcwrJkIEEVfs\n" + + "HqZyFzU4kwbGekY/m7d1DsBhWyKEGW9/25WMYmjWOWOiaFjeBaHLlxiEM8KGnMLH\n" + + "wx37NuFuaABgi23AAcBGdeWy04TEuU4S51+bHM3RotrZ2cryW2lEbkkXodhIJcq0\n" + + "RgrStCbvR0ehnOPdYSiRbxK8JNLZuNjHlK2g7wVi+C83vwMQuhU4H6OlYHGVr664\n" + + "4YzL83FdIo7wiMOFd2OOMLlCfHgTun60FvjCs4WHjrwH1fQl287FRPLa/4olBSQP\n" + + "yUXJaZdxm4cB4L/1pmbb/J/XUiOio3MpaN3GFm2hZloUlag1uPDBtCxTl5odvj4a\n" + + "GOmTBWznXxF/zrKnQVSvv+EccNxYFc0VVjAxGgNqPzIxDAKtw1lE5pbBkFpFpNHz\n" + + "StmwZkP9QIJY4hJYQfM+pzHLe8xjexL+Kh/TrYXgY1m/4vJe0HJSsnRnaR8Yfqhh\n" + + "LReqo94VHRYXR0rZQv4py0D9TrWaI8xHLve6ewhLPNRzyaI9fNrinbcPYZZOWnRi\n" + + "ekgUBx+BX6nJOw==\n" + + "=4Hy5\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var repo; + var oid; + var commit; + var message; + var parents; + var commitTree; + + var author = NodeGit.Signature.create( + "Scooby Doo", + "scoob@mystery.com", + 123456789, + 60 + ); + var committer = NodeGit.Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + var tree = Oid.fromString("f4661419a6fbbe865f78644fec722c023ce4b65f"); + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + message = headCommit.message() + "\n"; + parents = headCommit.parents(); + + return headCommit.amendWithSignature( + null, + author, + committer, + null, + null, + tree, + onSignature + ); + }) + .then(function(oidResult) { + oid = oidResult; + return NodeGit.Commit.lookup(repo, oid); + }) + .then(function(commitResult) { + commit = commitResult; + return commit.getTree(); + }) + .then(function(commitTreeResult) { + commitTree = commitTreeResult; + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signatureInfo.signature, signedData); + assert.equal(commit.message(), message); + assert.deepEqual(commit.parents(), parents); + assert.deepEqual(commitTree.id(), tree); + assert.deepEqual(commit.author(), author); + assert.deepEqual(commit.committer(), committer); + }); + }); + + it("can optionally skip signing process", function() { + const onSignature = () => ({ + code: NodeGit.Error.CODE.PASSTHROUGH + }); + + var repo; + var oid; + var commit; + var message; + var parents; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + message = headCommit.message(); + parents = headCommit.parents(); + + return headCommit.amendWithSignature( + null, + null, + null, + null, + null, + null, + onSignature + ); + }) + .then(function(oidResult) { + oid = oidResult; + return NodeGit.Commit.lookup(repo, oid); + }) + .then(function(commitResult) { + commit = commitResult; + return commit.getSignature("gpgsig") + .then(function() { + assert.fail("Should not have a signature"); + }, function(error) { + if (error && error.message === "this commit is not signed") { + return; + } + throw error; + }); + }) + .then(function(signatureInfo) { + assert.equal(commit.message(), message); + assert.deepEqual(commit.parents(), parents); + }); + }); + + it("will throw if signing callback returns an error code", function() { + const onSignature = () => ({ + code: NodeGit.Error.CODE.ERROR + }); + + return NodeGit.Repository.open(reposPath) + .then(function(repo) { + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + return headCommit.amendWithSignature( + null, + null, + null, + null, + null, + null, + onSignature + ); + }) + .then(function() { + assert.fail("amendWithSignature should have failed."); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }); + }); + }); + it("has an owner", function() { var owner = this.commit.owner(); assert.ok(owner instanceof Repository); @@ -791,6 +1040,354 @@ describe("Commit", function() { }); describe("Commit's Signature", function() { + it("Can create a signed commit in a repo", function() { + var signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "Version: GnuPG v1.4.12 (Darwin)\n" + + "\n" + + "iQIcBAABAgAGBQJQ+FMIAAoJEH+LfPdZDSs1e3EQAJMjhqjWF+WkGLHju7pTw2al\n" + + "o6IoMAhv0Z/LHlWhzBd9e7JeCnanRt12bAU7yvYp9+Z+z+dbwqLwDoFp8LVuigl8\n" + + "JGLcnwiUW3rSvhjdCp9irdb4+bhKUnKUzSdsR2CK4/hC0N2i/HOvMYX+BRsvqweq\n" + + "AsAkA6dAWh+gAfedrBUkCTGhlNYoetjdakWqlGL1TiKAefEZrtA1TpPkGn92vbLq\n" + + "SphFRUY9hVn1ZBWrT3hEpvAIcZag3rTOiRVT1X1flj8B2vGCEr3RrcwOIZikpdaW\n" + + "who/X3xh/DGbI2RbuxmmJpxxP/8dsVchRJJzBwG+yhwU/iN3MlV2c5D69tls/Dok\n" + + "6VbyU4lm/ae0y3yR83D9dUlkycOnmmlBAHKIZ9qUts9X7mWJf0+yy2QxJVpjaTGG\n" + + "cmnQKKPeNIhGJk2ENnnnzjEve7L7YJQF6itbx5VCOcsGh3Ocb3YR7DMdWjt7f8pu\n" + + "c6j+q1rP7EpE2afUN/geSlp5i3x8aXZPDj67jImbVCE/Q1X9voCtyzGJH7MXR0N9\n" + + "ZpRF8yzveRfMH8bwAJjSOGAFF5XkcR/RNY95o+J+QcgBLdX48h+ZdNmUf6jqlu3J\n" + + "7KmTXXQcOVpN6dD3CmRFsbjq+x6RHwa8u1iGn+oIkX908r97ckfB/kHKH7ZdXIJc\n" + + "cpxtDQQMGYFpXK/71stq\n" + + "=ozeK\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var test = this; + var expectedCommitId = "ccb99bb20716ef7c37e92c7b8db029a7af7f747b"; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + null, + author, + committer, + "message", + treeOid, + [parent], + onSignature + ); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commit) { + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signedData, signatureInfo.signature); + return reinitialize(test); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); + + it("Can create a signed commit in a repo and update existing ref", + function() { + var signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "Version: GnuPG v1.4.12 (Darwin)\n" + + "\n" + + "iQIcBAABAgAGBQJQ+FMIAAoJEH+LfPdZDSs1e3EQAJMjhqjWF+WkGLHju7pTw2al\n" + + "o6IoMAhv0Z/LHlWhzBd9e7JeCnanRt12bAU7yvYp9+Z+z+dbwqLwDoFp8LVuigl8\n" + + "JGLcnwiUW3rSvhjdCp9irdb4+bhKUnKUzSdsR2CK4/hC0N2i/HOvMYX+BRsvqweq\n" + + "AsAkA6dAWh+gAfedrBUkCTGhlNYoetjdakWqlGL1TiKAefEZrtA1TpPkGn92vbLq\n" + + "SphFRUY9hVn1ZBWrT3hEpvAIcZag3rTOiRVT1X1flj8B2vGCEr3RrcwOIZikpdaW\n" + + "who/X3xh/DGbI2RbuxmmJpxxP/8dsVchRJJzBwG+yhwU/iN3MlV2c5D69tls/Dok\n" + + "6VbyU4lm/ae0y3yR83D9dUlkycOnmmlBAHKIZ9qUts9X7mWJf0+yy2QxJVpjaTGG\n" + + "cmnQKKPeNIhGJk2ENnnnzjEve7L7YJQF6itbx5VCOcsGh3Ocb3YR7DMdWjt7f8pu\n" + + "c6j+q1rP7EpE2afUN/geSlp5i3x8aXZPDj67jImbVCE/Q1X9voCtyzGJH7MXR0N9\n" + + "ZpRF8yzveRfMH8bwAJjSOGAFF5XkcR/RNY95o+J+QcgBLdX48h+ZdNmUf6jqlu3J\n" + + "7KmTXXQcOVpN6dD3CmRFsbjq+x6RHwa8u1iGn+oIkX908r97ckfB/kHKH7ZdXIJc\n" + + "cpxtDQQMGYFpXK/71stq\n" + + "=ozeK\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var test = this; + var expectedCommitId = "ccb99bb20716ef7c37e92c7b8db029a7af7f747b"; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + "HEAD", + author, + committer, + "message", + treeOid, + [parent], + onSignature); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commit) { + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signedData, signatureInfo.signature); + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + assert.equal(expectedCommitId, headCommit.id()); + return undoCommit() + .then(function(){ + return reinitialize(test); + }); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); + + it("Can create a signed commit in bare a repo and update non-existent ref", + function() { + var signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "\n" + + "iQIzBAABCAAdFiEEHYpzGBSIRCy6QrNr0R10kNTwiG8FAlxcuSoACgkQ0R10kNTw\n" + + "iG9sZA//Z6mrX5l//gjtn7Fy3Cg5khasNMZA15JUPzfoSyVkaYM7g/iZrJr4uZmm\n" + + "lrhqxTDP4SUEL6dMOT0fjAudulP19Stv0mUMOoQ9cfvU0DAuFlI1z2Ny9IR+3hJK\n" + + "XpIQCHZAAY9KrGajJvDO+WqukrMwKh2dwaQLgB2+cS7ehBpbW45+l+Bq4hTlULiJ\n" + + "ohZ2SQhqj65knErdbfJ2B7yVlQbfG2vbD6qN4qJOkJpkFRdDhLmGnNjUj+vcmYO2\n" + + "Be5CLyjuhYszzUqys6ix4UHr10KihFk31N17CgA2ZsDSzE3VsMCPlVPV9jWuMceJ\n" + + "0IFsJEXFR4SOlRAq23BxD7aaYao6AF/YBhCQnDiuiQLCJ7WdUAmja6VPyEajAjoX\n" + + "CkdDs1P4N9IeIPvJECn8Df4NEEkzW8sV3i96ryk066m1ZmZWemJ2zdGVbfR+AuFZ\n" + + "7QwgBRidj3thIk0geh9g10+pbRuTzxNXklqxq4DQb3VEXIIJMUcqtN1bUPEPiLyA\n" + + "SU3uJ1THyYznAVZy6aqw+mNq7Lg9gV65LRd0WtNqgneknDZoH3zXyzlcJexjHkRF\n" + + "qt4K6w9TDA2Erda3wE4BM4MCgl1Hc629kH3ROCyWTFuJAEZtNDJPgIc2LTRDhHNd\n" + + "+K937RhWU8lUnI2jJLmKdQDk2dnS1ZepFqA5Ynwza1qDSOgUqVw=\n" + + "=M81P\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var expectedCommitId = "ef11571eb3590007712c7ee3b4a11cd9c6094e30"; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + + return NodeGit.Repository.init(newRepoPath, 0) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + "HEAD", + author, + committer, + "message", + treeOid, + [], + onSignature); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commit) { + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signedData, signatureInfo.signature); + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + assert.equal(expectedCommitId, headCommit.id()); + }); + }); + + it("Can create a signed commit raw", function() { + var expectedCommitId = "cc1401eaac4e9e77190e98a9353b305f0c6313d8"; + + var signature = "-----BEGIN PGP SIGNATURE-----\n\n" + + "iQEcBAABCAAGBQJarBhIAAoJEE8pfTd/81lKQA4IAL8Mu5kc4B/MX9s4XB26Ahap\n" + + "n06kCx3RQ1KHMZIRomAjCnb48WieNVuy1y+Ut0RgfCxxrJ1ZnzFG3kF2bIKwIxNI\n" + + "tYIC76iWny+mrVnb2mjKYjn/3F4c4VJGENq9ITiV1WeE4yJ8dHw2ox2D+hACzTvQ\n" + + "KVroedk8BDFJxS6DFb20To35xbAVhwBnAGRcII4Wi5PPMFpqAhGLfq3Czv95ddSz\n" + + "BHlyp27+YWSpV0Og0dqOEhsdDYaPrOBGRcoRiqjue+l5tgK/QerLFZ4aovZzpuEP\n" + + "Xx1yZfqXIiy4Bo40qScSrdnmnp/kMq/NQGR3jYU+SleFHVKNFsya9UwurMaezY0=\n" + + "=eZzi\n-----END PGP SIGNATURE-----"; + + var commit_content = "tree f4661419a6fbbe865f78644fec722c023ce4b65f\n" + + "parent 32789a79e71fbc9e04d3eff7425e1771eb595150\n" + + "author Tyler Ang-Wanek 1521227848 -0700\n" + + "committer Tyler Ang-Wanek 1521227848 -0700\n\n" + + "GPG Signed commit\n"; + + var repo; + var commit; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return Commit.createWithSignature( + repo, + commit_content, + signature, + "gpgsig"); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commitResult) { + commit = commitResult; + return commit.getSignature(); + }) + .then(function(signatureInfoDefault) { + assert.equal(signature, signatureInfoDefault.signature); + assert.equal(commit_content, signatureInfoDefault.signedData); + + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signature, signatureInfo.signature); + assert.equal(commit_content, signatureInfo.signedData); + }); + }); + it("Can retrieve the gpg signature from a commit", function() { var expectedSignedData = "tree f4661419a6fbbe865f78644fec722c023ce4b65f\n" + @@ -827,5 +1424,173 @@ describe("Commit", function() { ); }); }); + + it("Can be optionally skipped to create without signature", function() { + const onSignature = () => ({ + code: NodeGit.Error.CODE.PASSTHROUGH + }); + + var test = this; + var expectedCommitId = "c9bffe040519231d32431c101bca4efc0917f64c"; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + null, + author, + committer, + "message", + treeOid, + [parent], + onSignature + ); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commit) { + return commit.getSignature("gpgsig") + .then(function() { + assert.fail("Should not have been able to retrieve gpgsig"); + }, function(error) { + if (error && error.message === "this commit is not signed") { + return; + } + throw error; + }); + }) + .then(function() { + return reinitialize(test); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); + + it("Will throw if the signing cb returns an error code", function() { + const onSignature = () => ({ + code: NodeGit.Error.CODE.ERROR + }); + + var test = this; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + null, + author, + committer, + "message", + treeOid, + [parent], + onSignature + ); + }) + .then(function() { + assert.fail("createCommitWithSignature should have failed."); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }) + .then(function() { + return reinitialize(test); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); }); }); diff --git a/test/tests/diff.js b/test/tests/diff.js index d9dfec7bc..7eb243fc9 100644 --- a/test/tests/diff.js +++ b/test/tests/diff.js @@ -414,7 +414,7 @@ describe("Diff", function() { }) .then(function([headTree, index]) { const diffOptions = new NodeGit.DiffOptions(); - if (index.caps() & Index.CAP.IGNORE_CASE !== 0) { + if (index.caps() & Index.CAPABILITY.IGNORE_CASE !== 0) { diffOptions.flags |= Diff.OPTION.IGNORE_CASE; } diff --git a/test/tests/filter.js b/test/tests/filter.js index 3a57acbef..62aa4e863 100644 --- a/test/tests/filter.js +++ b/test/tests/filter.js @@ -2,6 +2,7 @@ var assert = require("assert"); var fse = require("fs-extra"); var path = require("path"); var local = path.join.bind(path, __dirname); +var garbageCollect = require("../utils/garbage_collect.js"); describe("Filter", function() { var NodeGit = require("../../"); @@ -216,7 +217,7 @@ describe("Filter", function() { }, 0) .then(function(result) { assert.strictEqual(result, NodeGit.Error.CODE.OK); - global.gc(); + garbageCollect(); return fse.writeFile( packageJsonPath, @@ -338,7 +339,8 @@ describe("Filter", function() { return Checkout.head(test.repository, opts); }) .then(function() { - global.gc(); + garbageCollect(); + return Registry.unregister(filterName); }) .then(function(result) { @@ -476,10 +478,8 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(tempBuffer, length) - .then(function() { - return NodeGit.Error.CODE.PASSTHROUGH; - }); + to.set(tempBuffer, length); + return NodeGit.Error.CODE.PASSTHROUGH; }, check: function() { return NodeGit.Error.CODE.OK; @@ -522,10 +522,8 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(tempBuffer, length) - .then(function() { - return NodeGit.Error.CODE.OK; - }); + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; }, check: function(src, attr) { return NodeGit.Error.CODE.OK; @@ -568,10 +566,8 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(largeBuffer, largeBufferSize) - .then(function() { - return NodeGit.Error.CODE.OK; - }); + to.set(largeBuffer, largeBufferSize); + return NodeGit.Error.CODE.OK; }, check: function(src, attr) { return NodeGit.Error.CODE.OK; @@ -626,10 +622,8 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(tempBuffer, length) - .then(function() { - return NodeGit.Error.CODE.OK; - }); + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; }, check: function(src, attr) { return NodeGit.Error.CODE.OK; @@ -645,7 +639,7 @@ describe("Filter", function() { ); assert.notStrictEqual(readmeContent, message); fse.writeFileSync(readmePath, "whoa", "utf8"); - global.gc(); + garbageCollect(); var opts = { checkoutStrategy: Checkout.STRATEGY.FORCE, @@ -668,10 +662,8 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(tempBuffer, length) - .then(function() { - return NodeGit.Error.CODE.OK; - }); + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; }, check: function(src, attr) { return src.path() === "README.md" ? @@ -725,10 +717,8 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(tempBuffer, length) - .then(function() { - return NodeGit.Error.CODE.OK; - }); + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; }, check: function(src, attr) { return src.path() === "README.md" ? @@ -737,7 +727,7 @@ describe("Filter", function() { cleanup: function() {} }, 0) .then(function(result) { - global.gc(); + garbageCollect(); assert.strictEqual(result, NodeGit.Error.CODE.OK); }) .then(function() { @@ -754,7 +744,7 @@ describe("Filter", function() { ); }) .then(function(oid) { - global.gc(); + garbageCollect(); return test.repository.getHeadCommit(); }) .then(function(commit) { @@ -767,7 +757,7 @@ describe("Filter", function() { postInitializeReadmeContents, "testing commit contents" ); assert.strictEqual(commit.message(), "test commit"); - global.gc(); + garbageCollect(); return commit.getEntry("README.md"); }) @@ -854,7 +844,7 @@ describe("Filter", function() { ); assert.notEqual(packageContent, ""); - global.gc(); + garbageCollect(); return fse.writeFile( packageJsonPath, "Changing content to trigger checkout", @@ -956,10 +946,8 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(tempBuffer, length) - .then(function() { - return NodeGit.Error.CODE.OK; - }); + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; }, check: function(src, attr) { return NodeGit.Error.CODE.OK; @@ -999,10 +987,8 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(tempBuffer, length) - .then(function() { - return NodeGit.Error.CODE.OK; - }); + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; }, check: function(src, attr) { return NodeGit.Error.CODE.OK; @@ -1044,10 +1030,8 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(tempBuffer, length) - .then(function() { - return NodeGit.Error.CODE.OK; - }); + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; }, check: function(src, attr) { return NodeGit.Error.CODE.OK; @@ -1094,4 +1078,65 @@ describe("Filter", function() { }); }); }); + + describe("FilterSource", function() { + var message = "some new fancy filter"; + + before(function() { + var test = this; + return fse.readFile(readmePath, "utf8") + .then((function(content) { + test.originalReadmeContent = content; + })); + }); + + afterEach(function() { + this.timeout(15000); + return fse.writeFile(readmePath, this.originalReadmeContent); + }); + + it("a FilterSource has an async repo getter", function() { + var test = this; + + return Registry.register(filterName, { + apply: function(to, from, source) { + return source.repo() + .then(function() { + return NodeGit.Error.CODE.PASSTHROUGH; + }); + }, + check: function(source) { + return source.repo() + .then(function() { + return NodeGit.Error.CODE.OK; + }); + } + }, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + }) + .then(function() { + var readmeContent = fse.readFileSync( + packageJsonPath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, message); + + return fse.writeFile( + packageJsonPath, + "Changing content to trigger checkout" + ); + }) + .then(function() { + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: "package.json" + }; + return Checkout.head(test.repository, opts); + }) + .then(function() { + garbageCollect(); + }); + }); + }); }); diff --git a/test/tests/merge.js b/test/tests/merge.js index 80bb0589d..00387da82 100644 --- a/test/tests/merge.js +++ b/test/tests/merge.js @@ -646,9 +646,11 @@ describe("Merge", function() { ourSignature, NodeGit.Merge.PREFERENCE.NO_FASTFORWARD, null, - function(message) { - assert(message === "Merge branch 'theirs' into ours"); - return "We manipulated the message, HAH."; + { + processMergeMessageCallback: function(message) { + assert(message === "Merge branch 'theirs' into ours"); + return "We manipulated the message, HAH."; + } } ); }) @@ -803,9 +805,11 @@ describe("Merge", function() { ourSignature, NodeGit.Merge.PREFERENCE.NO_FASTFORWARD, null, - function(message) { - assert(message === "Merge branch 'theirs' into ours"); - return Promise.resolve("We manipulated the message, HAH."); + { + processMergeMessageCallback: function(message) { + assert(message === "Merge branch 'theirs' into ours"); + return Promise.resolve("We manipulated the message, HAH."); + } } ); }) diff --git a/test/tests/rebase.js b/test/tests/rebase.js index ae9aab1d1..87749f539 100644 --- a/test/tests/rebase.js +++ b/test/tests/rebase.js @@ -3,6 +3,10 @@ var path = require("path"); var local = path.join.bind(path, __dirname); var fse = require("fs-extra"); +var garbageCollect = require("../utils/garbage_collect.js"); + +const isNode8 = process.versions.node.split(".")[0] === "8"; + describe("Rebase", function() { var NodeGit = require("../../"); var Checkout = NodeGit.Checkout; @@ -1534,4 +1538,700 @@ describe("Rebase", function() { "b3c355bb606ec7da87174dfa1a0b0c0e3dc97bc0"); }); }); + + if (!isNode8) { + it("can sign commits during the rebase", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(theirAnnotatedCommit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, null, { + signingCb: (commitContent) => ({ + code: NodeGit.Error.CODE.OK, + field: "moose-sig", + signedData: "A moose was here." + }) + }); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + // Make sure we don't crash calling the signature CB + // after collecting garbage. + garbageCollect(); + + return rebase.commit(null, ourSignature); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "24250fe6bd8a782ec1aaca8b2c9a2456a90517ed"); + + // git_rebase_operation_current returns the index of the rebase + // operation that was last applied, so after the first operation, it + // should be 0. + assert.equal(rebase.operationCurrent(), 0); + + return rebase.finish(ourSignature, {}); + }) + .then(function(result) { + assert.equal(result, 0); + + return repository.getBranchCommit(ourBranchName); + }) + .then(function(commit) { + // verify that the "ours" branch has moved to the correct place + assert.equal(commit.id().toString(), + "24250fe6bd8a782ec1aaca8b2c9a2456a90517ed"); + + return Promise.all([ + commit.parent(0), + NodeGit.Commit.extractSignature( + repository, + "24250fe6bd8a782ec1aaca8b2c9a2456a90517ed", + "moose-sig" + ) + ]); + }) + .then(function([parent, { signature }]) { + // verify that we are on top of "their commit" + assert.equal(parent.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + assert.equal(signature, "A moose was here."); + }); + }); + + it("can optionally skip signing commits", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(theirAnnotatedCommit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, null, { + signingCb: () => ({ + code: NodeGit.Error.CODE.PASSTHROUGH + }) + }); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + // Make sure we don't crash calling the signature CB + // after collecting garbage. + garbageCollect(); + + return rebase.commit(null, ourSignature); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b937100ee0ea17ef20525306763505a7fe2be29e"); + + // git_rebase_operation_current returns the index of the rebase + // operation that was last applied, so after the first operation, it + // should be 0. + assert.equal(rebase.operationCurrent(), 0); + + return rebase.finish(ourSignature, {}); + }) + .then(function(result) { + assert.equal(result, 0); + + return repository.getBranchCommit(ourBranchName); + }) + .then(function(commit) { + // verify that the "ours" branch has moved to the correct place + assert.equal(commit.id().toString(), + "b937100ee0ea17ef20525306763505a7fe2be29e"); + + return commit.parent(0); + }) + .then(function(parent) { + // verify that we are on top of "their commit" + assert.equal(parent.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + return NodeGit.Commit.extractSignature( + repository, + "b937100ee0ea17ef20525306763505a7fe2be29e", + "moose-sig" + ) + .then(function() { + assert.fail("This commit should not be signed."); + }, function (error) { + if (error && error.message === "this commit is not signed") { + return; + } + throw error; + }); + }); + }); + + it("will throw if commit signing cb returns an error code", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(theirAnnotatedCommit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, null, { + signingCb: () => ({ + code: NodeGit.Error.CODE.ERROR + }) + }); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + // Make sure we don't crash calling the signature CB + // after collecting garbage. + garbageCollect(); + + return rebase.commit(null, ourSignature); + }) + .then(function() { + assert.fail("rebase.commit should have failed"); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }); + }); + } + + it("will not throw on patch already applied errors", function() { + var baseFileName = "baseNewFile.txt"; + var theirFileName = "myFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var theirFileContent = "Hello there"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var initialCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + initialCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile( + path.join(repository.workdir(), theirFileName), + theirFileContent + ); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "6f14d06b24fa8ea26f511dd8a94a003fd37eadc5"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [initialCommit]) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "c4cc225184b9c9682cb48294358d9d65f8ec42c7"); + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [initialCommit]); + }); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "5814ffa17b8a677191d89d5372f1e46d50d976ae"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "5814ffa17b8a677191d89d5372f1e46d50d976ae"); + assert.equal(theirAnnotatedCommit.id().toString(), + "c4cc225184b9c9682cb48294358d9d65f8ec42c7"); + + return NodeGit.Rebase.init( + repository, + ourAnnotatedCommit, + theirAnnotatedCommit + ); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .catch(function(error) { + assert.fail(error); + + throw error; + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "5814ffa17b8a677191d89d5372f1e46d50d976ae"); + + return rebase.commit(null, ourSignature); + }) + .then(function() { + assert.fail("Rebase should have failed."); + }, function (error) { + if (error && error.errno === NodeGit.Error.CODE.EAPPLIED) { + return; + } + + assert.fail(error); + + throw error; + }) + .then(function() { + return repository.continueRebase(); + }) + .then(function() { + return rebase.next(); + }) + .catch(function(error) { + assert.equal(error.errno, NodeGit.Error.CODE.ITEROVER); + }); + }); }); diff --git a/test/tests/remote.js b/test/tests/remote.js index ff6004c66..e5d4eed1f 100644 --- a/test/tests/remote.js +++ b/test/tests/remote.js @@ -7,6 +7,8 @@ var fp = require("lodash/fp"); var garbageCollect = require("../utils/garbage_collect.js"); var RepoUtils = require("../utils/repository_setup"); +const isNode8 = process.versions.node.split(".")[0] === "8"; + describe("Remote", function() { var NodeGit = require("../../"); var Repository = NodeGit.Repository; @@ -19,7 +21,7 @@ describe("Remote", function() { var privateUrl = "git@github.com:nodegit/private"; function removeNonOrigins(repo) { - return repo.getRemotes() + return repo.getRemoteNames() .then(function(remotes) { return remotes.reduce(function(promise, remote) { if (remote !== "origin") { @@ -120,9 +122,7 @@ describe("Remote", function() { return repo.getRemote("origin") .then(function(remote) { remoteCallbacks = { - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 }; return remote.connect(NodeGit.Enums.DIRECTION.FETCH, remoteCallbacks) @@ -201,9 +201,7 @@ describe("Remote", function() { credentials: function(url, userName) { return NodeGit.Cred.sshKeyFromAgent(userName); }, - certificateCheck: function() { - return 1; - }, + certificateCheck: () => 0, transferProgress: function() { wasCalled = true; @@ -222,9 +220,7 @@ describe("Remote", function() { it("can get the default branch of a remote", function() { var remoteCallbacks = { - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 }; var remote = this.remote; @@ -242,9 +238,7 @@ describe("Remote", function() { credentials: function(url, userName) { return NodeGit.Cred.sshKeyFromAgent(userName); }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } }); }); @@ -261,9 +255,7 @@ describe("Remote", function() { "" ); }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } }; @@ -288,9 +280,7 @@ describe("Remote", function() { return NodeGit.Cred.sshKeyFromAgent(userName); } }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } }; @@ -323,18 +313,17 @@ describe("Remote", function() { credentials: function(url, userName) { return NodeGit.Cred.sshKeyFromAgent(userName); }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } }); }); }); - it("will reject if credentials promise rejects", function() { - var repo = this.repository; - var branch = "should-not-exist"; - return Remote.lookup(repo, "origin") + if (!isNode8) { + it("will reject if credentials promise rejects", function() { + var repo = this.repository; + var branch = "should-not-exist"; + return Remote.lookup(repo, "origin") .then(function(remote) { var ref = "refs/heads/" + branch; var refs = [ref + ":" + ref]; @@ -342,17 +331,15 @@ describe("Remote", function() { callbacks: { credentials: function(url, userName) { var test = Promise.resolve("test") - .then(function() { return; }) - .then(function() { return; }) - .then(function() { return; }) - .then(function() { - return Promise.reject(new Error("failure case")); - }); + .then(function() { return; }) + .then(function() { return; }) + .then(function() { return; }) + .then(function() { + return Promise.reject(new Error("failure case")); + }); return test; }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } }; return remote.push(refs, options); @@ -360,105 +347,106 @@ describe("Remote", function() { .then(function() { return Promise.reject( new Error("should not be able to push to the repository")); - }, function(err) { - if (err.message === "failure case") - { - return Promise.resolve(); - } else { - throw err; - } - }) - .then(function() { - return Remote.lookup(repo, "origin"); - }) - .then(function(remote) { - var ref = "refs/heads/" + branch; - var refs = [ref + ":" + ref]; - var options = { - callbacks: { - credentials: function(url, userName) { - var test = Promise.resolve() + }, function(err) { + if (err.message === "failure case") + { + return Promise.resolve(); + } else { + throw err; + } + }) + .then(function() { + return Remote.lookup(repo, "origin"); + }) + .then(function(remote) { + var ref = "refs/heads/" + branch; + var refs = [ref + ":" + ref]; + var options = { + callbacks: { + credentials: function(url, userName) { + var test = Promise.resolve() .then(Promise.resolve.bind(Promise)) .then(Promise.resolve.bind(Promise)) .then(Promise.resolve.bind(Promise)) .then(Promise.reject.bind(Promise)); - return test; - }, - certificateCheck: function() { - return 1; + return test; + }, + certificateCheck: () => 0 } - } - }; - return remote.push(refs, options); - }) - .then(function() { - return Promise.reject( - new Error("should not be able to push to the repository")); - }, function(err) { - if (err.message === "Method push has thrown an error.") - { - return Promise.resolve(); - } else { - throw err; - } - }); - }); + }; + return remote.push(refs, options); + }) + .then(function() { + return Promise.reject( + new Error("should not be able to push to the repository")); + }, function(err) { + if (err.message === "Method push has thrown an error.") + { + return Promise.resolve(); + } else { + throw err; + } + }); + }); - it("cannot push to a repository with invalid credentials", function() { - var repo = this.repository; - var branch = "should-not-exist"; - return Remote.lookup(repo, "origin") - .then(function(remote) { - var ref = "refs/heads/" + branch; - var refs = [ref + ":" + ref]; - var firstPass = true; - var options = { - callbacks: { - credentials: function(url, userName) { - if (firstPass) { - firstPass = false; - if (url.indexOf("https") === -1) { - return NodeGit.Cred.sshKeyFromAgent(userName); - } else { - return NodeGit.Cred.userpassPlaintextNew(userName, ""); - } + it("cannot push to a repository with invalid credentials", function() { + var repo = this.repository; + var branch = "should-not-exist"; + return Remote.lookup(repo, "origin") + .then(function(remote) { + var ref = "refs/heads/" + branch; + var refs = [ref + ":" + ref]; + var firstPass = true; + var options = { + callbacks: { + credentials: function(url, userName) { + if (firstPass) { + firstPass = false; + if (url.indexOf("https") === -1) { + return NodeGit.Cred.sshKeyFromAgent(userName); + } else { + return NodeGit.Cred.userpassPlaintextNew(userName, ""); + } + } else { + return Promise.reject(); + } + }, + certificateCheck: () => 0 + } + }; + return remote.push(refs, options); + }) + // takes care of windows bug, see the .catch for the proper pathway + // that this flow should take (cred cb doesn't run twice -> + // throws error) + .then(function() { + return Promise.reject( + new Error("should not be able to push to the repository")); + }, function(err) { + if (err.message.indexOf(401) === -1) { + throw err; } else { - return Promise.reject(); + return Promise.resolve(); } - }, - certificateCheck: function() { - return 1; - } - } - }; - return remote.push(refs, options); - }) - // takes care of windows bug, see the .catch for the proper pathway - // that this flow should take (cred cb doesn't run twice -> throws error) - .then(function() { - return Promise.reject( - new Error("should not be able to push to the repository")); - }, function(err) { - if (err.message.indexOf(401) === -1) { - throw err; - } else { - return Promise.resolve(); - } - }) - // catches linux / osx failure to use anonymous credentials - // stops callback infinite loop - .catch(function (reason) { - const messageWithoutNewlines = reason.message.replace(/\n|\r/g, ""); - const validErrors = [ - "Method push has thrown an error.", - "failed to set credentials: The parameter is incorrect." - ]; - assert.ok( - _.includes(validErrors, messageWithoutNewlines), - "Unexpected error: " + reason.message - ); - }); - }); + }) + // catches linux / osx failure to use anonymous credentials + // stops callback infinite loop + .catch(function (reason) { + const messageWithoutNewlines = reason.message.replace( + /\n|\r/g, + "" + ); + const validErrors = [ + "Method push has thrown an error.", + "failed to set credentials: The parameter is incorrect." + ]; + assert.ok( + _.includes(validErrors, messageWithoutNewlines), + "Unexpected error: " + reason.message + ); + }); + }); + } it("is kept alive by refspec", function() { var repo = this.repository; diff --git a/test/tests/repository.js b/test/tests/repository.js index e960629ac..bce03a6cb 100644 --- a/test/tests/repository.js +++ b/test/tests/repository.js @@ -95,7 +95,7 @@ describe("Repository", function() { }); it("can list remotes", function() { - return this.repository.getRemotes() + return this.repository.getRemoteNames() .then(function(remotes) { assert.equal(remotes.length, 1); assert.equal(remotes[0], "origin"); @@ -120,9 +120,10 @@ describe("Repository", function() { }); it("can get the default signature", function() { - var sig = this.repository.defaultSignature(); - - assert(sig instanceof Signature); + this.repository.defaultSignature() + .then((sig) => { + assert(sig instanceof Signature); + }); }); it("gets statuses with StatusFile", function() { @@ -185,9 +186,7 @@ describe("Repository", function() { credentials: function(url, userName) { return NodeGit.Cred.sshKeyFromAgent(userName); }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 }) .then(function() { return repo.fetchheadForeach(function(refname, remoteUrl, oid, isMerge) { @@ -209,13 +208,23 @@ describe("Repository", function() { }); }); - it("can discover if a path is part of a repository", function() { + function discover(ceiling) { var testPath = path.join(reposPath, "lib", "util", "normalize_oid.js"); var expectedPath = path.join(reposPath, ".git"); - return NodeGit.Repository.discover(testPath, 0, "") + return NodeGit.Repository.discover(testPath, 0, ceiling) .then(function(foundPath) { assert.equal(expectedPath, foundPath); }); + } + + it("can discover if a path is part of a repository, null ceiling", + function() { + return discover(null); + }); + + it("can discover if a path is part of a repository, empty ceiling", + function() { + return discover(""); }); it("can create a repo using initExt", function() { @@ -265,16 +274,21 @@ describe("Repository", function() { }); it("can commit on head on a empty repo with createCommitOnHead", function() { - var fileName = "my-new-file-that-shouldnt-exist.file"; - var fileContent = "new file from repository test"; - var repo = this.emptyRepo; - var filePath = path.join(repo.workdir(), fileName); - var authSig = repo.defaultSignature(); - var commitSig = repo.defaultSignature(); - var commitMsg = "Doug this has been commited"; - - return fse.writeFile(filePath, fileContent) - .then(function() { + const fileName = "my-new-file-that-shouldnt-exist.file"; + const fileContent = "new file from repository test"; + const repo = this.emptyRepo; + const filePath = path.join(repo.workdir(), fileName); + const commitMsg = "Doug this has been commited"; + let authSig; + let commitSig; + + return repo.defaultSignature() + .then((sig) => { + authSig = sig; + commitSig = sig; + return fse.writeFile(filePath, fileContent); + }) + .then(() => { return repo.createCommitOnHead( [fileName], authSig, @@ -282,7 +296,7 @@ describe("Repository", function() { commitMsg ); }) - .then(function(oidResult) { + .then((oidResult) => { return repo.getHeadCommit() .then(function(commit) { assert.equal( diff --git a/test/tests/revwalk.js b/test/tests/revwalk.js index 6c5865193..702bf35cf 100644 --- a/test/tests/revwalk.js +++ b/test/tests/revwalk.js @@ -234,6 +234,7 @@ describe("Revwalk", function() { }); magicShas = [ + "be6905d459f1b236e44b2445df25aff1783993e9", "4a34168b80fe706f52417106821c9cbfec630e47", "f80e085e3118bbd6aad49dad7c53bdc37088bf9b", "694b2d703a02501f288269bea7d1a5d643a83cc8", diff --git a/test/tests/signature.js b/test/tests/signature.js index bf5f99ef7..e0387c3d3 100644 --- a/test/tests/signature.js +++ b/test/tests/signature.js @@ -45,37 +45,39 @@ describe("Signature", function() { var savedUserName; var savedUserEmail; - var cleanUp = function() { + var cleanUp = () => { return exec("git config --global user.name \"" + savedUserName + "\"") - .then(function() { + .then(() => { exec("git config --global user.email \"" + savedUserEmail + "\""); }); }; return exec("git config --global user.name") - .then(function(userName) { + .then((userName) => { savedUserName = userName.trim(); return exec("git config --global user.email"); }) - .then(function(userEmail) { + .then((userEmail) => { savedUserEmail = userEmail.trim(); return exec("git config --global --unset user.name"); }) - .then(function() { + .then(() => { return exec("git config --global --unset user.email"); }) - .then(function() { + .then(() => { return Repository.open(reposPath); }) - .then(function(repo) { - var sig = repo.defaultSignature(); + .then((repo) => { + return repo.defaultSignature(); + }) + .then((sig) => { assert.equal(sig.name(), "unknown"); assert.equal(sig.email(), "unknown@example.com"); }) .then(cleanUp) - .catch(function(e) { + .catch((e) => { return cleanUp() .then(function() { return Promise.reject(e); @@ -104,4 +106,29 @@ describe("Signature", function() { // the self-freeing time should get freed assert.equal(startSelfFreeingCount, endSelfFreeingCount); }); + + it("toString does not provide a timestamp by default", function () { + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + + assert.equal(signature.toString(), "Shaggy Rogers "); + }); + + it("toString provides the correct timestamp when requested", function() { + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + + assert.equal( + signature.toString(true), + "Shaggy Rogers 987654321 +0130" + ); + }); }); diff --git a/test/tests/stash.js b/test/tests/stash.js index 5a65a9a16..a8720438b 100644 --- a/test/tests/stash.js +++ b/test/tests/stash.js @@ -31,22 +31,23 @@ describe("Stash", function() { }); function saveDropStash(repo, stashMessage) { - var fileName = "README.md"; - var fileContent = "Cha-cha-cha-chaaaaaangessssss"; - var filePath = path.join(repo.workdir(), fileName); - var oldContent; - var stashes = []; - var stashOid; + const fileName = "README.md"; + const fileContent = "Cha-cha-cha-chaaaaaangessssss"; + const filePath = path.join(repo.workdir(), fileName); + let oldContent; + let stashes = []; + let stashOid; return fse.readFile(filePath) - .then(function(content) { + .then((content) => { oldContent = content; return fse.writeFile(filePath, fileContent); }) - .then(function() { - return Stash.save(repo, repo.defaultSignature(), stashMessage, 0); + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, stashMessage, 0); }) - .then(function(oid) { + .then((oid) => { stashOid = oid; var stashCb = function(index, message, oid) { stashes.push({index: index, message: message, oid: oid}); @@ -54,114 +55,119 @@ describe("Stash", function() { return Stash.foreach(repo, stashCb); }) - .then(function() { + .then(() => { assert.equal(stashes.length, 1); assert.equal(stashes[0].index, 0); - assert.equal(stashes[0].message, "On master: " + stashMessage); + const expectedMessage = !stashMessage ? + "WIP on master: 32789a7 Fixes EJS not being installed via NPM" : + "On master: " + stashMessage; + assert.equal(stashes[0].message, expectedMessage); assert.equal(stashes[0].oid.toString(), stashOid.toString()); return Stash.drop(repo, 0); }) - .then(function () { + .then(() => { stashes = []; - var stashCb = function(index, message, oid) { + var stashCb = (index, message, oid) => { stashes.push({index: index, message: message, oid: oid}); }; return Stash.foreach(repo, stashCb); }) - .then(function() { + .then(() => { assert.equal(stashes.length, 0); }) - .catch(function(e) { + .catch((e) => { return fse.writeFile(filePath, oldContent) - .then(function() { + .then(() => { return Promise.reject(e); }); }); } it("can save and drop a stash", function() { - saveDropStash(this.repository, "stash test"); + return saveDropStash(this.repository, "stash test"); }); it("can save a stash with no message and drop it", function() { - saveDropStash(this.repository, null); + return saveDropStash(this.repository, null); }); it("can save and pop a stash", function() { - var fileNameA = "README.md"; - var fileNameB = "install.js"; - var oldContentA; - var oldContentB; - var fileContent = "Cha-cha-cha-chaaaaaangessssss"; - var repo = this.repository; - var filePathA = path.join(repo.workdir(), fileNameA); - var filePathB = path.join(repo.workdir(), fileNameB); - var stashMessage = "stash test"; + const fileNameA = "README.md"; + const fileNameB = "install.js"; + let oldContentA; + let oldContentB; + const fileContent = "Cha-cha-cha-chaaaaaangessssss"; + const repo = this.repository; + const filePathA = path.join(repo.workdir(), fileNameA); + const filePathB = path.join(repo.workdir(), fileNameB); + const stashMessage = "stash test"; return fse.readFile(filePathA, "utf-8") - .then(function(content) { + .then((content) => { oldContentA = content; return fse.writeFile(filePathA, fileContent); }) - .then(function() { + .then(() => { return fse.readFile(filePathB, "utf-8"); }) - .then(function(content) { + .then((content) => { oldContentB = content; return fse.writeFile(filePathB, fileContent); }) - .then(function() { - return Stash.save(repo, repo.defaultSignature(), stashMessage, 0); + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, stashMessage, 0); }) - .then(function() { + .then(() => { return fse.readFile(filePathA, "utf-8"); }) - .then(function(content) { + .then((content) => { assert.equal(oldContentA, content); return fse.readFile(filePathB, "utf-8"); }) - .then(function(content) { + .then((content) => { assert.equal(oldContentB, content); return Stash.pop(repo, 0); }) - .then(function() { + .then(() => { return fse.readFile(filePathA, "utf-8"); }) - .then(function(content) { + .then((content) => { assert.equal(fileContent, content); return fse.readFile(filePathB, "utf-8"); }) - .then(function(content) { + .then((content) => { assert.equal(fileContent, content); }); }); it("can save a stash, change files, and fail to pop stash", function() { - var fileName = "README.md"; - var fileContent = "Cha-cha-cha-chaaaaaangessssss"; - var fileContent2 = "Somewhere over the repo, changes were made."; - var repo = this.repository; - var filePath = path.join(repo.workdir(), fileName); - var oldContent; - var stashMessage = "stash test"; + const fileName = "README.md"; + const fileContent = "Cha-cha-cha-chaaaaaangessssss"; + const fileContent2 = "Somewhere over the repo, changes were made."; + const repo = this.repository; + const filePath = path.join(repo.workdir(), fileName); + let oldContent; + const stashMessage = "stash test"; return fse.readFile(filePath) - .then(function(content) { + .then((content) => { oldContent = content; return fse.writeFile(filePath, fileContent); }) - .then(function() { - return Stash.save(repo, repo.defaultSignature(), stashMessage, 0); + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, stashMessage, 0); }) - .then(function() { + .then(() => { return fse.writeFile(filePath, fileContent2); }) - .then(function() { + .then(() => { return Stash.pop(repo, 0); }) - .catch(function(reason) { + .catch((reason) => { if (reason.message !== "1 conflict prevents checkout") { throw reason; } else { @@ -171,80 +177,83 @@ describe("Stash", function() { }); it("can save, apply, then drop the stash", function() { - var fileName = "README.md"; - var fileContent = "Cha-cha-cha-chaaaaaangessssss"; - var repo = this.repository; - var filePath = path.join(repo.workdir(), fileName); - var oldContent; - var stashMessage = "stash test"; + const fileName = "README.md"; + const fileContent = "Cha-cha-cha-chaaaaaangessssss"; + const repo = this.repository; + const filePath = path.join(repo.workdir(), fileName); + let oldContent; + const stashMessage = "stash test"; return fse.readFile(filePath) - .then(function(content) { + .then((content) => { oldContent = content; return fse.writeFile(filePath, fileContent); }) - .then(function() { - return Stash.save(repo, repo.defaultSignature(), stashMessage, 0); + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, stashMessage, 0); }) - .then(function() { + .then(() => { return Stash.apply(repo, 0); }) - .then(function() { + .then(() => { return Stash.drop(repo, 0); - }, function() { + }, () => { throw new Error("Unable to drop stash after apply."); }) - .then(function() { + .then(() => { return Stash.drop(repo, 0); }) - .catch(function(reason) { - if (reason.message !== "Reference 'refs/stash' not found") { - Promise.reject(); + .catch((reason) => { + if (reason.message !== "reference 'refs/stash' not found") { + throw reason; } }); }); it("can save multiple stashes and pop an arbitrary stash", function() { - var fileName = "README.md"; - var fileContentA = "Hi. It's me. I'm the dog. My name is the dog."; - var fileContentB = "Everyone likes me. I'm cute."; - var fileContentC = "I think I will bark at nothing now. Ba. Ba. Baba Baba."; - var repo = this.repository; - var filePath = path.join(repo.workdir(), fileName); - var oldContent; - var stashMessageA = "stash test A"; - var stashMessageB = "stash test B"; - var stashMessageC = "stash test C"; - - function writeAndStash(path, content, message) { + const fileName = "README.md"; + const fileContentA = "Hi. It's me. I'm the dog. My name is the dog."; + const fileContentB = "Everyone likes me. I'm cute."; + const fileContentC = + "I think I will bark at nothing now. Ba. Ba. Baba Baba."; + const repo = this.repository; + const filePath = path.join(repo.workdir(), fileName); + let oldContent; + const stashMessageA = "stash test A"; + const stashMessageB = "stash test B"; + const stashMessageC = "stash test C"; + + const writeAndStash = (path, content, message) => { return fse.writeFile(path, content) - .then(function() { - return Stash.save(repo, repo.defaultSignature(), message, 0); + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, message, 0); }); - } + }; return fse.readFile(filePath, "utf-8") - .then(function (content) { + .then((content) => { oldContent = content; return writeAndStash(filePath, fileContentA, stashMessageA); }) - .then(function() { + .then(() => { return writeAndStash(filePath, fileContentB, stashMessageB); }) - .then(function() { + .then(() => { return writeAndStash(filePath, fileContentC, stashMessageC); }) - .then(function() { + .then(() => { return fse.readFile(filePath, "utf-8"); }) - .then(function(content) { + .then((content) => { assert.equal(oldContent, content); return Stash.pop(repo, 1); }) - .then(function() { + .then(() => { return fse.readFile(filePath, "utf-8"); }) - .then(function(content) { + .then((content) => { assert.equal(fileContentB, content); }); }); diff --git a/test/tests/tag.js b/test/tests/tag.js index 8d2c48f20..844fa43be 100644 --- a/test/tests/tag.js +++ b/test/tests/tag.js @@ -159,11 +159,15 @@ describe("Tag", function() { it("can create a new signed tag with Tag.create and delete it", function() { var name = "created-signed-tag-create"; var repository = this.repository; - var signature = Signature.default(repository); + var signature = null; var commit = null; var commit2 = null; - return repository.getCommit(commitPointedTo) + return Signature.default(repository) + .then(function(signatureResult) { + signature = signatureResult; + return repository.getCommit(commitPointedTo); + }) .then(function(theCommit) { commit = theCommit; return repository.getCommit(commitPointedTo2); @@ -207,14 +211,387 @@ describe("Tag", function() { }); }); + it("can create a Tag buffer", function() { + const targetOid = Oid.fromString(commitPointedTo); + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + + return Tag.createBuffer(repository, name, targetOid, signature, message) + .then((tagBuffer) => { + const lines = tagBuffer.split("\n"); + assert.equal(7, lines.length); + assert.equal(lines[0], `object ${commitPointedTo}`); + assert.equal(lines[1], "type commit"); + assert.equal(lines[2], `tag ${name}`); + assert.equal( + lines[3], + "tagger Shaggy Rogers 987654321 +0130" + ); + assert.equal(lines[4], ""); + assert.equal(lines[5], message); + assert.equal(lines[6], ""); + }); + }); + + it("can create a Tag from a Tag buffer", function() { + const targetOid = Oid.fromString(commitPointedTo); + const otherTargetOid = Oid.fromString(commitPointedTo2); + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + + let odb; + let buffer; + let otherBuffer; + + return repository.odb() + .then((odbResult) => { + odb = odbResult; + return Tag.createBuffer( + repository, + name, + targetOid, + signature, + message + ); + }) + .then((bufferResult) => { + buffer = bufferResult; + return Tag.createBuffer( + repository, + name, + otherTargetOid, + signature, + message + ); + }) + .then((bufferResult) => { + otherBuffer = bufferResult; + return Tag.createFromBuffer(repository, buffer, 1); + }) + .then((oid) => { + return odb.read(oid); + }) + .then((object) => { + const lines = object.toString().split("\n"); + assert(object.type(), Obj.TYPE.TAG); + assert.equal(7, lines.length); + assert.equal(lines[0], `object ${commitPointedTo}`); + assert.equal(lines[1], "type commit"); + assert.equal(lines[2], `tag ${name}`); + assert.equal( + lines[3], + "tagger Shaggy Rogers 987654321 +0130" + ); + assert.equal(lines[4], ""); + assert.equal(lines[5], message); + assert.equal(lines[6], ""); + }) + .then(() => { + // overwriting is okay + return Tag.createFromBuffer(repository, otherBuffer, 1); + }) + .then(() => { + // overwriting is not okay + return Tag.createFromBuffer(repository, buffer, 0); + }) + .then(() => { + return Promise.reject( + new Error("should not be able to create the '" + name + "' tag twice") + ); + }, + () => { + return Promise.resolve(); + }); + }); + + describe("createWithSignature and extractSignature", function() { + it( + "can create a tag with a signature and extract the signature", + function() { + const targetOid = Oid.fromString(commitPointedTo); + const otherTargetOid = Oid.fromString(commitPointedTo2); + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const signatureLines = [ + "-----BEGIN PGP SIGNATURE-----", + "iQIzBAABCAAdFiEEKdxGpJ93wnkLaBKfURjJKedOfEMFAlxR4JUACgkQURjJKedO", + "fEN+8A//cXmkRmhzQMdTEdrxty7tVKQ7lVhL7r7e+cB84hO7WrDn8549c7/Puflu", + "idanWfyoAEMSNWDgY84lx/t3I3YYKXsLDPT93HiMhCXmPVZcfLxlARRL1rrNZV4q", + "L9hhqb9bFrRNBn6YebhygeLXLHlDKEZzx8W9jnDLU8Px8UTkwdQIDnPDfT7UOPPU", + "MYDgP3OwWwoG8dUlZXaHjtFz29wPlJo177MwdLYwn4zpEIysoY1ev5IKWD+LPW4g", + "vdQnaK1x3dozmG8YLUZw5iW7ap9DpahbAGQgdy1z1ypiNUjNuhaP8zkG1ci6X88N", + "6MIoQ+YqfowRJJTIr1lzssxsRI1syjfS6smnI4ZNE6S+6mIKN96ES2OZF+rn4xnD", + "PofR9Qh2gPq++ULriPE/cX7ZkZ0/ZDZGDfIGvricB8JEJhISZn/VMX/KScJs+rFq", + "KWN5Au6Uc2pEqeq5OP4y2k0QUmKQT9sh9OepnPmfqF8hG6wI8nM67jT/FEOcpr0v", + "qoN2NRXrcq3iZAp07AGq9IdpYhBcEW7MFmOcNt+Zb8SbTMp6DawnREg9xzz1SIkZ", + "Cdp1XoJ6mkVvzBB4T/Esp7j1VztinTX2PpX7C1CE5LC76UfCiEjEWOmWrVuPuA5a", + "oRrJvgPJg8gpVj04r2m8nvUK1gwhxg9ZB+SK+nd3OAd0dnbJwTE=", + "=dW3g", + "-----END PGP SIGNATURE-----" + ]; + const message = "I'm a teapot"; + const signingCallback = (message) => ({ + code: NodeGit.Error.CODE.OK, + signedData: signatureLines.join("\n") + }); + + let odb; + let oid; + let object; + + return repository.odb() + .then((odbResult) => { + odb = odbResult; + + return Tag.createWithSignature( + repository, + name, + targetOid, + signature, + message, + 1, + signingCallback + ); + }) + .then((oidResult) => { + oid = oidResult; + return odb.read(oid); + }) + .then((objectResult) => { + object = objectResult; + const lines = object.toString().split("\n"); + assert(object.type(), Obj.TYPE.TAG); + assert.equal(signatureLines.length + 7, lines.length); + assert.equal(lines[0], `object ${commitPointedTo}`); + assert.equal(lines[1], "type commit"); + assert.equal(lines[2], `tag ${name}`); + assert.equal( + lines[3], + "tagger Shaggy Rogers 987654321 +0130" + ); + assert.equal(lines[4], ""); + assert.equal(lines[5], message); + for (let i = 6; i < 6 + signatureLines.length; i++) { + assert.equal(lines[i], signatureLines[i - 6]); + } + assert.equal(lines[6 + signatureLines.length], ""); + + return Tag.lookup(repository, oid); + }) + .then((tag) => { + return tag.extractSignature(); + }) + .then((tagSignature) => { + assert.equal(tagSignature, signatureLines.join("\n")); + }) + .then(() => { + // overwriting is okay + return Tag.createWithSignature( + repository, + name, + targetOid, + signature, + message, + 1, + signingCallback + ); + }) + .then(() => { + // overwriting is not okay + return Tag.createWithSignature( + repository, + name, + otherTargetOid, + signature, + message, + 0, + signingCallback + ); + }) + .then(() => { + return Promise.reject( + new Error( + "should not be able to create the '" + name + "' tag twice" + ) + ); + }, + () => { + return Promise.resolve(); + }); + } + ); + + it("can optionally skip the signing process", function() { + const targetOid = Oid.fromString(commitPointedTo); + const otherTargetOid = Oid.fromString(commitPointedTo2); + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + const signingCallback = () => ({ + code: NodeGit.Error.CODE.PASSTHROUGH + }); + + let odb; + let oid; + let object; + + return repository.odb() + .then((odbResult) => { + odb = odbResult; + + return Tag.createWithSignature( + repository, + name, + targetOid, + signature, + message, + 1, + signingCallback + ); + }) + .then((oidResult) => { + oid = oidResult; + return odb.read(oid); + }) + .then((objectResult) => { + object = objectResult; + const lines = object.toString().split("\n"); + assert(object.type(), Obj.TYPE.TAG); + assert.equal(7, lines.length); + assert.equal(lines[0], `object ${commitPointedTo}`); + assert.equal(lines[1], "type commit"); + assert.equal(lines[2], `tag ${name}`); + assert.equal( + lines[3], + "tagger Shaggy Rogers 987654321 +0130" + ); + assert.equal(lines[4], ""); + assert.equal(lines[5], message); + assert.equal(lines[6], ""); + + return Tag.lookup(repository, oid); + }) + .then((tag) => { + return tag.extractSignature(); + }) + .then(function() { + assert.fail("Tag should not have been signed."); + }, function(error) { + if (error && error.message === "this tag is not signed") { + return; + } + + throw error; + }) + .then(() => { + // overwriting is okay + return Tag.createWithSignature( + repository, + name, + targetOid, + signature, + message, + 1, + signingCallback + ); + }) + .then(() => { + // overwriting is not okay + return Tag.createWithSignature( + repository, + name, + otherTargetOid, + signature, + message, + 0, + signingCallback + ); + }) + .then(() => { + return Promise.reject( + new Error("should not be able to create the '" + name + "' tag twice") + ); + }, + () => { + return Promise.resolve(); + }); + }); + + it("will throw if signing callback returns an error code", function() { + const targetOid = Oid.fromString(commitPointedTo); + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + const signingCallback = () => ({ + code: NodeGit.Error.CODE.ERROR + }); + + + return Tag.createWithSignature( + repository, + name, + targetOid, + signature, + message, + 1, + signingCallback + ) + .then(function() { + assert.fail("Should not have been able to create tag"); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }); + }); + }); + + it("can create a new signed tag with Tag.annotationCreate", function() { var oid = Oid.fromString(commitPointedTo); var name = "created-signed-tag-annotationCreate"; var repository = this.repository; - var signature = Signature.default(repository); + var signature = null; var odb = null; - return repository.odb() + return Signature.default(repository) + .then(function(signatureResult) { + signature = signatureResult; + return repository.odb(); + }) .then(function(theOdb) { odb = theOdb; }) diff --git a/test/tests/tree.js b/test/tests/tree.js index e5272116d..98c5959e9 100644 --- a/test/tests/tree.js +++ b/test/tests/tree.js @@ -38,6 +38,24 @@ describe("Tree", function() { }).done(done); }); + it("updates a tree", function () { + var repo = this.existingRepo; + var update = new NodeGit.TreeUpdate(); + update.action = NodeGit.Tree.UPDATE.REMOVE; + update.path = "README.md"; + return this.commit.getTree().then(function(tree) { + return tree.createUpdated(repo, 1, [update]); + }) + .then(function(treeOid) { + return repo.getTree(treeOid); + }) + .then(function(updatedTree) { + assert.throws(function () { + updatedTree.entryByName("README.md"); + }); + }); + }); + it("walks its entries and returns the same entries on both progress and end", function() { var repo = this.repository; diff --git a/utils/isBuildingForElectron.js b/utils/isBuildingForElectron.js new file mode 100644 index 000000000..295f6ab1f --- /dev/null +++ b/utils/isBuildingForElectron.js @@ -0,0 +1,30 @@ +const fs = require("fs") +const JSON5 = require("json5"); +const path = require("path"); + +if (process.argv.length < 3) { + process.exit(1); +} + +const last = arr => arr[arr.length - 1]; +const [, , nodeRootDir] = process.argv; + +let isElectron = last(nodeRootDir.split(path.sep)).startsWith("iojs"); + +if (!isElectron) { + try { + // Not ideal, would love it if there were a full featured gyp package to do this operation instead. + const { variables: { built_with_electron } } = JSON5.parse( + fs.readFileSync( + path.resolve(nodeRootDir, "include", "node", "config.gypi"), + "utf8" + ) + ); + + if (built_with_electron) { + isElectron = true; + } + } catch (e) {} +} + +process.stdout.write(isElectron ? "1" : "0"); diff --git a/vendor/libgit2 b/vendor/libgit2 index 1aae32d20..6abd07fcc 160000 --- a/vendor/libgit2 +++ b/vendor/libgit2 @@ -1 +1 @@ -Subproject commit 1aae32d20abc736ca1818aedd34dd945b6508f72 +Subproject commit 6abd07fccde53babc0835dcdd05607313aa72bec diff --git a/vendor/libgit2.gyp b/vendor/libgit2.gyp index 11904835e..6444228ea 100644 --- a/vendor/libgit2.gyp +++ b/vendor/libgit2.gyp @@ -7,7 +7,9 @@ "library%": "static_library", "openssl_enable_asm%": 0, # only supported with the Visual Studio 2012 (VC11) toolchain. "gcc_version%": 0, - "is_clang%": 0 + "is_electron%": "$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir @@ -736,7 +739,7 @@ dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir @@ -754,7 +757,7 @@ dist dist-all: distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ @@ -764,7 +767,7 @@ distcheck: dist *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac diff --git a/vendor/libssh2/NEWS b/vendor/libssh2/NEWS index e3caaece5..a9c0a3f1b 100644 --- a/vendor/libssh2/NEWS +++ b/vendor/libssh2/NEWS @@ -1,5 +1,68 @@ Changelog for the libssh2 project. Generated with git2news.pl +Version 1.8.2 (25 Mar 2019) + +Daniel Stenberg (25 Mar 2019) +- RELEASE-NOTES: version 1.8.2 + +- [Will Cosgrove brought this change] + + moved MAX size declarations #330 + +- [Will Cosgrove brought this change] + + Fixed misapplied patch (#327) + + Fixes for user auth + +Version 1.8.1 (14 Mar 2019) + +Will Cosgrove (14 Mar 2019) +- [Michael Buckley brought this change] + + More 1.8.0 security fixes (#316) + + * Defend against possible integer overflows in comp_method_zlib_decomp. + + * Defend against writing beyond the end of the payload in _libssh2_transport_read(). + + * Sanitize padding_length - _libssh2_transport_read(). https://libssh2.org/CVE-2019-3861.html + + This prevents an underflow resulting in a potential out-of-bounds read if a server sends a too-large padding_length, possibly with malicious intent. + + * Prevent zero-byte allocation in sftp_packet_read() which could lead to an out-of-bounds read. https://libssh2.org/CVE-2019-3858.html + + * Check the length of data passed to sftp_packet_add() to prevent out-of-bounds reads. + + * Add a required_size parameter to sftp_packet_require et. al. to require callers of these functions to handle packets that are too short. https://libssh2.org/CVE-2019-3860.html + + * Additional length checks to prevent out-of-bounds reads and writes in _libssh2_packet_add(). https://libssh2.org/CVE-2019-3862.html + +GitHub (14 Mar 2019) +- [Will Cosgrove brought this change] + + 1.8 Security fixes (#314) + + * fixed possible integer overflow in packet_length + + CVE https://www.libssh2.org/CVE-2019-3861.html + + * fixed possible interger overflow with userauth_keyboard_interactive + + CVE https://www.libssh2.org/CVE-2019-3856.html + + * fixed possible out zero byte/incorrect bounds allocation + + CVE https://www.libssh2.org/CVE-2019-3857.html + + * bounds checks for response packets + + * fixed integer overflow in userauth_keyboard_interactive + + CVE https://www.libssh2.org/CVE-2019-3863.html + + * 1.8.1 release notes + Version 1.8.0 (25 Oct 2016) Daniel Stenberg (25 Oct 2016) @@ -5473,19 +5536,3 @@ Simon Josefsson (16 Nov 2009) Reported by Steven Van Ingelgem in . - -- Mention libssh2-style.el. - -- Use memmove instead of memcpy on overlapping memory areas. - - Reported by Bob Alexander in - . - -- Add. - -- Protect against crash on too small SSH_MSG_IGNORE packets. - - Reported by Bob Alexander - in . - -- add copyright line diff --git a/vendor/libssh2/RELEASE-NOTES b/vendor/libssh2/RELEASE-NOTES index 5b78ede38..d566bafe0 100644 --- a/vendor/libssh2/RELEASE-NOTES +++ b/vendor/libssh2/RELEASE-NOTES @@ -1,31 +1,12 @@ -libssh2 1.8.0 - -This release includes the following changes: - - o added a basic dockerised test suite - o crypto: add support for the mbedTLS backend +libssh2 1.8.2 This release includes the following bugfixes: - o libgcrypt: fixed a NULL pointer dereference on OOM - o VMS: can't use %zd for off_t format - o VMS: update vms/libssh2_config.h - o windows: link with crypt32.lib - o libssh2_channel_open: speeling error fixed in channel error message - o msvc: fixed 14 compilation warnings - o tests: HAVE_NETINET_IN_H was not defined correctly - o openssl: add OpenSSL 1.1.0 compatibility - o cmake: Add CLEAR_MEMORY option, analogously to that for autoconf - o configure: make the --with-* options override the OpenSSL default - o libssh2_wait_socket: set err_msg on errors - o libssh2_wait_socket: Fix comparison with api_timeout to use milliseconds - + o Fixed the misapplied userauth patch that broke 1.8.1 + o moved the MAX size declarations from the public header + This release would not have looked like this without help, code, reports and advice from friends like these: - Alexander Lamaison, Antenore Gatta, Brad Harder, Charles Collicutt, - Craig A. Berry, Dan Fandrich, Daniel Stenberg, Kamil Dudka, Keno Fischer, - Taylor Holberton, Viktor Szakats, Will Cosgrove, Zenju - (12 contributors) - - Thanks! (and sorry if I forgot to mention someone) + Will Cosgrove + (1 contributors) diff --git a/vendor/libssh2/aclocal.m4 b/vendor/libssh2/aclocal.m4 index 41ad8c694..35a317296 100644 --- a/vendor/libssh2/aclocal.m4 +++ b/vendor/libssh2/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.15' +[am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15], [], +m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15])dnl +[AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -346,49 +345,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -397,18 +388,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -495,8 +485,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. @@ -563,7 +553,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -605,7 +595,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -626,7 +616,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -648,7 +638,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -683,7 +673,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -691,49 +681,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # AM_MAKE_INCLUDE() # ----------------- -# Check to see how make treats includes. +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -772,7 +755,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -801,7 +784,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -848,7 +831,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -867,7 +850,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -948,7 +931,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1008,7 +991,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1036,7 +1019,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1055,7 +1038,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/vendor/libssh2/compile b/vendor/libssh2/compile index a85b723c7..99e50524b 100755 --- a/vendor/libssh2/compile +++ b/vendor/libssh2/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -255,7 +255,8 @@ EOF echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/vendor/libssh2/config.guess b/vendor/libssh2/config.guess index d622a44e5..f50dcdb6d 100755 --- a/vendor/libssh2/config.guess +++ b/vendor/libssh2/config.guess @@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2018-02-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -17,24 +15,22 @@ timestamp='2012-02-10' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + me=`echo "$0" | sed -e 's,.*/,,'` @@ -43,7 +39,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -54,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -113,9 +107,9 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; + ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; @@ -138,9 +132,37 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "$UNAME_SYSTEM" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval "$set_cc_for_build" + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi + ;; +esac + # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -153,21 +175,31 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` + case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -182,40 +214,67 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in os=netbsd ;; esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "$machine-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -232,63 +291,54 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -300,9 +350,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -327,38 +377,38 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" + eval "$set_cc_for_build" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -367,25 +417,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -396,44 +446,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -442,23 +492,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -484,17 +534,17 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -511,7 +561,7 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -523,14 +573,14 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -541,7 +591,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -555,26 +605,27 @@ EOF exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -589,28 +640,28 @@ EOF echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if [ "$HP_ARCH" = "" ]; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -643,13 +694,13 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -660,23 +711,23 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -701,11 +752,11 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -714,7 +765,7 @@ EOF *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -722,9 +773,9 @@ EOF exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -749,124 +800,109 @@ EOF echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case "$UNAME_PROCESSOR" in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + *:MINGW64*:*) + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys + *:MINGW*:*) + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + *:MSYS*:*) + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -879,63 +915,64 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el @@ -949,55 +986,74 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; - or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-"$LIBC" + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-"$LIBC" + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-"$LIBC" + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + if objdump -f /bin/sh | grep -q elf32-x86-64; then + echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 + else + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + fi exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1011,34 +1067,34 @@ EOF # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable + echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) @@ -1048,12 +1104,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1063,9 +1119,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1073,7 +1129,7 @@ EOF # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1085,9 +1141,9 @@ EOF exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1107,9 +1163,9 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1118,28 +1174,28 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1150,7 +1206,7 @@ EOF *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1170,23 +1226,23 @@ EOF exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} + echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1201,66 +1257,97 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + eval "$set_cc_for_build" + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1269,18 +1356,18 @@ EOF echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1301,14 +1388,14 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1317,185 +1404,48 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif +echo "$0: unable to guess system type" >&2 -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 < -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} +NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize +the system type. Please install a C compiler and try again. EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi + ;; +esac cat >&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp @@ -1514,16 +1464,16 @@ hostinfo = `(hostinfo) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/vendor/libssh2/config.sub b/vendor/libssh2/config.sub index c894da455..1d8e98bce 100755 --- a/vendor/libssh2/config.sub +++ b/vendor/libssh2/config.sub @@ -1,36 +1,31 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2018-02-22' -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -38,7 +33,7 @@ timestamp='2012-02-10' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -58,12 +53,11 @@ timestamp='2012-02-10' me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -73,9 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -102,7 +94,7 @@ while test $# -gt 0 ; do *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -120,24 +112,24 @@ esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` + basic_machine=`echo "$1" | sed 's/-[^-]*$//'` + if [ "$basic_machine" != "$1" ] + then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac @@ -156,7 +148,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) + -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; @@ -186,53 +178,56 @@ case $os in ;; -sco6) os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos @@ -253,21 +248,25 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ - | i370 | i860 | i960 | ia64 \ + | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -281,26 +280,30 @@ case $basic_machine in | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -308,7 +311,8 @@ case $basic_machine in | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ + | visium \ + | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown @@ -322,11 +326,14 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown @@ -355,7 +362,7 @@ case $basic_machine in ;; # Object if more than one company name word. *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. @@ -364,26 +371,29 @@ case $basic_machine in | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -397,28 +407,34 @@ case $basic_machine in | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -426,6 +442,8 @@ case $basic_machine in | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ + | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -439,7 +457,7 @@ case $basic_machine in # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) - basic_machine=i386-unknown + basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) @@ -473,7 +491,7 @@ case $basic_machine in basic_machine=x86_64-pc ;; amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl @@ -502,6 +520,9 @@ case $basic_machine in basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -515,7 +536,7 @@ case $basic_machine in os=-linux ;; blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) @@ -523,13 +544,13 @@ case $basic_machine in os=-cnk ;; c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray @@ -618,10 +639,18 @@ case $basic_machine in basic_machine=rs6000-bull os=-bosx ;; - dpx2* | dpx2*-bull) + dpx2*) basic_machine=m68k-bull os=-sysv3 ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=$os"spe" + ;; ebmon29k) basic_machine=a29k-amd os=-ebmon @@ -711,9 +740,6 @@ case $basic_machine in hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; - hppa-next) - os=-nextstep3 - ;; hppaosf) basic_machine=hppa1.1-hp os=-osf @@ -726,26 +752,26 @@ case $basic_machine in basic_machine=i370-ibm ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; - i386-vsta | vsta) + vsta) basic_machine=i386-unknown os=-vsta ;; @@ -763,17 +789,17 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; - m88k-omron*) - basic_machine=m88k-omron - ;; magnum | m3230) basic_machine=mips-mips os=-sysv @@ -782,11 +808,15 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze*) basic_machine=microblaze-xilinx ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -801,10 +831,10 @@ case $basic_machine in os=-mint ;; mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k @@ -814,15 +844,19 @@ case $basic_machine in basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -861,7 +895,7 @@ case $basic_machine in basic_machine=v70-nec os=-sysv ;; - next | m*-next ) + next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) @@ -906,6 +940,12 @@ case $basic_machine in nsr-tandem) basic_machine=nsr-tandem ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -938,7 +978,7 @@ case $basic_machine in os=-linux ;; parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) @@ -954,7 +994,7 @@ case $basic_machine in basic_machine=i386-pc ;; pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc @@ -969,16 +1009,16 @@ case $basic_machine in basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould @@ -988,23 +1028,23 @@ case $basic_machine in ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm @@ -1013,7 +1053,11 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; - rdos) + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) basic_machine=i386-pc os=-rdos ;; @@ -1054,17 +1098,10 @@ case $basic_machine in sequent) basic_machine=i386-sequent ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; sh5el) basic_machine=sh5le-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) + simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; @@ -1083,7 +1120,7 @@ case $basic_machine in os=-sysv4 ;; strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun @@ -1205,6 +1242,9 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; + x64) + basic_machine=x86_64-pc + ;; xbox) basic_machine=i686-pc os=-mingw32 @@ -1213,20 +1253,12 @@ case $basic_machine in basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; none) basic_machine=none-none os=-none @@ -1255,10 +1287,6 @@ case $basic_machine in vax) basic_machine=vax-dec ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; pdp11) basic_machine=pdp11-dec ;; @@ -1268,9 +1296,6 @@ case $basic_machine in sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; cydra) basic_machine=cydra-cydrome ;; @@ -1290,7 +1315,7 @@ case $basic_machine in # Make sure to match an already-canonicalized machine name. ;; *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac @@ -1298,10 +1323,10 @@ esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; @@ -1312,8 +1337,8 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases that might get confused + # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux @@ -1324,45 +1349,48 @@ case $os in -solaris) os=-solaris2 ;; - -svr4*) - os=-sysv4 - ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - # First accept the basic system types. + # es1800 is here to avoid being matched by es* (a different OS) + -es1800*) + os=-ose + ;; + # Now accept the basic system types. # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. + # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ + | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ + | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ + | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1379,12 +1407,12 @@ case $os in -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + -sim | -xray | -os68k* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc @@ -1393,10 +1421,10 @@ case $os in os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition @@ -1407,12 +1435,6 @@ case $os in -wince*) os=-wince ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; -utek*) os=-bsd ;; @@ -1437,7 +1459,7 @@ case $os in -nova*) os=-rtmk-nova ;; - -ns2 ) + -ns2) os=-nextstep2 ;; -nsk*) @@ -1459,7 +1481,7 @@ case $os in -oss*) os=-sysv3 ;; - -svr4) + -svr4*) os=-sysv4 ;; -svr3) @@ -1474,35 +1496,38 @@ case $os in -ose*) os=-ose ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; + -pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=-eabi + ;; + *) + os=-elf + ;; + esac + ;; -nacl*) ;; + -ios) + ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1537,6 +1562,12 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; tic54x-*) os=-coff ;; @@ -1586,12 +1617,12 @@ case $basic_machine in sparc-* | *-sun) os=-sunos4.1.1 ;; + pru-*) + os=-elf + ;; *-be) os=-beos ;; - *-haiku) - os=-haiku - ;; *-ibm) os=-aix ;; @@ -1631,7 +1662,7 @@ case $basic_machine in m88k-omron*) os=-luna ;; - *-next ) + *-next) os=-nextstep ;; *-sequent) @@ -1646,9 +1677,6 @@ case $basic_machine in i370-*) os=-mvs ;; - *-next) - os=-nextstep3 - ;; *-gould) os=-sysv ;; @@ -1758,15 +1786,15 @@ case $basic_machine in vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$basic_machine$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/vendor/libssh2/configure b/vendor/libssh2/configure index d891378d0..ac4d4931c 100755 --- a/vendor/libssh2/configure +++ b/vendor/libssh2/configure @@ -709,7 +709,6 @@ am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE -am__quote am__include DEPDIR OBJEXT @@ -797,7 +796,8 @@ PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL' +SHELL +am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -2544,7 +2544,7 @@ $as_echo "$as_me: WARNING: sed was not found, this may ruin your chances to buil fi LIBSSH2VER=`$SED -ne 's/^#define LIBSSH2_VERSION *"\(.*\)"/\1/p' ${srcdir}/include/libssh2.h` -am__api_version='1.15' +am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -3050,8 +3050,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The @@ -3102,7 +3102,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -3255,45 +3255,45 @@ DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" - -am_make=${MAKE-make} -cat > confinc << 'END' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : @@ -7980,11 +7980,8 @@ _LT_EOF test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -10064,6 +10061,12 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -19338,7 +19341,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -20242,29 +20245,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -20282,53 +20291,48 @@ $as_echo X"$mf" | q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } - /^X\(\/\/\)$/{ + /^X\/\(\/\/\)$/{ s//\1/ q } - /^X\(\/\).*/{ + /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk } ;; "libtool":C) diff --git a/vendor/libssh2/depcomp b/vendor/libssh2/depcomp index fc98710e2..65cbf7093 100755 --- a/vendor/libssh2/depcomp +++ b/vendor/libssh2/depcomp @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2013-05-30.07; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ scriptversion=2013-05-30.07; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -783,9 +783,9 @@ exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/vendor/libssh2/docs/Makefile.in b/vendor/libssh2/docs/Makefile.in index 857a39315..7ba7369e9 100644 --- a/vendor/libssh2/docs/Makefile.in +++ b/vendor/libssh2/docs/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -498,8 +498,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -566,7 +566,10 @@ ctags CTAGS: cscope cscopelist: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff --git a/vendor/libssh2/example/Makefile.in b/vendor/libssh2/example/Makefile.in index 87f9f1286..ca43d33ec 100644 --- a/vendor/libssh2/example/Makefile.in +++ b/vendor/libssh2/example/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -227,7 +227,19 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/direct_tcpip.Po ./$(DEPDIR)/scp.Po \ + ./$(DEPDIR)/scp_nonblock.Po ./$(DEPDIR)/scp_write.Po \ + ./$(DEPDIR)/scp_write_nonblock.Po ./$(DEPDIR)/sftp.Po \ + ./$(DEPDIR)/sftp_RW_nonblock.Po ./$(DEPDIR)/sftp_append.Po \ + ./$(DEPDIR)/sftp_mkdir.Po ./$(DEPDIR)/sftp_mkdir_nonblock.Po \ + ./$(DEPDIR)/sftp_nonblock.Po ./$(DEPDIR)/sftp_write.Po \ + ./$(DEPDIR)/sftp_write_nonblock.Po \ + ./$(DEPDIR)/sftp_write_sliding.Po ./$(DEPDIR)/sftpdir.Po \ + ./$(DEPDIR)/sftpdir_nonblock.Po ./$(DEPDIR)/ssh2.Po \ + ./$(DEPDIR)/ssh2_agent.Po ./$(DEPDIR)/ssh2_echo.Po \ + ./$(DEPDIR)/ssh2_exec.Po ./$(DEPDIR)/subsystem_netconf.Po \ + ./$(DEPDIR)/tcpip-forward.Po ./$(DEPDIR)/x11.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -459,8 +471,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -590,29 +602,35 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/direct_tcpip.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp_nonblock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp_write.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp_write_nonblock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_RW_nonblock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_append.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_mkdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_mkdir_nonblock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_nonblock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_write.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_write_nonblock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_write_sliding.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftpdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftpdir_nonblock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2_agent.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2_echo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2_exec.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subsystem_netconf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpip-forward.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x11.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/direct_tcpip.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp_nonblock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp_write.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp_write_nonblock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_RW_nonblock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_append.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_mkdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_mkdir_nonblock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_nonblock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_write.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_write_nonblock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp_write_sliding.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftpdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftpdir_nonblock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2_agent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2_echo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2_exec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subsystem_netconf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpip-forward.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x11.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -693,7 +711,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -763,7 +784,29 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/direct_tcpip.Po + -rm -f ./$(DEPDIR)/scp.Po + -rm -f ./$(DEPDIR)/scp_nonblock.Po + -rm -f ./$(DEPDIR)/scp_write.Po + -rm -f ./$(DEPDIR)/scp_write_nonblock.Po + -rm -f ./$(DEPDIR)/sftp.Po + -rm -f ./$(DEPDIR)/sftp_RW_nonblock.Po + -rm -f ./$(DEPDIR)/sftp_append.Po + -rm -f ./$(DEPDIR)/sftp_mkdir.Po + -rm -f ./$(DEPDIR)/sftp_mkdir_nonblock.Po + -rm -f ./$(DEPDIR)/sftp_nonblock.Po + -rm -f ./$(DEPDIR)/sftp_write.Po + -rm -f ./$(DEPDIR)/sftp_write_nonblock.Po + -rm -f ./$(DEPDIR)/sftp_write_sliding.Po + -rm -f ./$(DEPDIR)/sftpdir.Po + -rm -f ./$(DEPDIR)/sftpdir_nonblock.Po + -rm -f ./$(DEPDIR)/ssh2.Po + -rm -f ./$(DEPDIR)/ssh2_agent.Po + -rm -f ./$(DEPDIR)/ssh2_echo.Po + -rm -f ./$(DEPDIR)/ssh2_exec.Po + -rm -f ./$(DEPDIR)/subsystem_netconf.Po + -rm -f ./$(DEPDIR)/tcpip-forward.Po + -rm -f ./$(DEPDIR)/x11.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags @@ -809,7 +852,29 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/direct_tcpip.Po + -rm -f ./$(DEPDIR)/scp.Po + -rm -f ./$(DEPDIR)/scp_nonblock.Po + -rm -f ./$(DEPDIR)/scp_write.Po + -rm -f ./$(DEPDIR)/scp_write_nonblock.Po + -rm -f ./$(DEPDIR)/sftp.Po + -rm -f ./$(DEPDIR)/sftp_RW_nonblock.Po + -rm -f ./$(DEPDIR)/sftp_append.Po + -rm -f ./$(DEPDIR)/sftp_mkdir.Po + -rm -f ./$(DEPDIR)/sftp_mkdir_nonblock.Po + -rm -f ./$(DEPDIR)/sftp_nonblock.Po + -rm -f ./$(DEPDIR)/sftp_write.Po + -rm -f ./$(DEPDIR)/sftp_write_nonblock.Po + -rm -f ./$(DEPDIR)/sftp_write_sliding.Po + -rm -f ./$(DEPDIR)/sftpdir.Po + -rm -f ./$(DEPDIR)/sftpdir_nonblock.Po + -rm -f ./$(DEPDIR)/ssh2.Po + -rm -f ./$(DEPDIR)/ssh2_agent.Po + -rm -f ./$(DEPDIR)/ssh2_echo.Po + -rm -f ./$(DEPDIR)/ssh2_exec.Po + -rm -f ./$(DEPDIR)/subsystem_netconf.Po + -rm -f ./$(DEPDIR)/tcpip-forward.Po + -rm -f ./$(DEPDIR)/x11.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -830,9 +895,9 @@ uninstall-am: .MAKE: all install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ diff --git a/vendor/libssh2/example/libssh2_config.h.in b/vendor/libssh2/example/libssh2_config.h.in index af4ab9ca0..307c62553 100644 --- a/vendor/libssh2/example/libssh2_config.h.in +++ b/vendor/libssh2/example/libssh2_config.h.in @@ -64,8 +64,8 @@ /* Define if you have the gcrypt library. */ #undef HAVE_LIBGCRYPT -/* Define if you have the mbedtls library. */ -#undef HAVE_LIBMBEDTLS +/* Define if you have the mbedcrypto library. */ +#undef HAVE_LIBMBEDCRYPTO /* Define if you have the ssl library. */ #undef HAVE_LIBSSL @@ -79,6 +79,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the `memset_s' function. */ +#undef HAVE_MEMSET_S + /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H @@ -178,10 +181,10 @@ /* Use mbedtls */ #undef LIBSSH2_MBEDTLS -/* Use OpenSSL */ +/* Use openssl */ #undef LIBSSH2_OPENSSL -/* Use Windows CNG */ +/* Use wincng */ #undef LIBSSH2_WINCNG /* Define to the sub-directory where libtool stores uninstalled libraries. */ diff --git a/vendor/libssh2/include/libssh2.h b/vendor/libssh2/include/libssh2.h index 34d284210..fdcf6163d 100644 --- a/vendor/libssh2/include/libssh2.h +++ b/vendor/libssh2/include/libssh2.h @@ -46,13 +46,13 @@ to make the BANNER define (used by src/session.c) be a valid SSH banner. Release versions have no appended strings and may of course not have dashes either. */ -#define LIBSSH2_VERSION "1.8.0" +#define LIBSSH2_VERSION "1.8.2" /* The numeric version number is also available "in parts" by using these defines: */ #define LIBSSH2_VERSION_MAJOR 1 #define LIBSSH2_VERSION_MINOR 8 -#define LIBSSH2_VERSION_PATCH 0 +#define LIBSSH2_VERSION_PATCH 2 /* This is the numeric version of the libssh2 version number, meant for easier parsing and comparions by programs. The LIBSSH2_VERSION_NUM define will @@ -69,7 +69,7 @@ and it is always a greater number in a more recent release. It makes comparisons with greater than and less than work. */ -#define LIBSSH2_VERSION_NUM 0x010800 +#define LIBSSH2_VERSION_NUM 0x010802 /* * This is the date and time when the full source package was created. The @@ -80,7 +80,7 @@ * * "Mon Feb 12 11:35:33 UTC 2007" */ -#define LIBSSH2_TIMESTAMP "Tue Oct 25 06:44:33 UTC 2016" +#define LIBSSH2_TIMESTAMP "Mon Mar 25 19:29:57 UTC 2019" #ifndef RC_INVOKED diff --git a/vendor/libssh2/install-sh b/vendor/libssh2/install-sh index 4d4a9519e..8175c640f 100755 --- a/vendor/libssh2/install-sh +++ b/vendor/libssh2/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2005-05-14.22 +scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,42 +35,57 @@ scriptversion=2005-05-14.22 # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. +# from scratch. -# set DOITPROG to echo to test this script +tab=' ' +nl=' +' +IFS=" $tab$nl" -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" +# Set DOITPROG to "echo" to test this script. -# put in absolute paths if you don't have them in your path; or use env. vars. +doit=${DOITPROG-} +doit_exec=${doit:-exec} -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 -chmodcmd="$chmodprog 0755" -chowncmd= chgrpcmd= -stripcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog rmcmd="$rmprog -f" -mvcmd="$mvprog" +stripcmd= + src= dst= dir_arg= -dstarg= -no_target_directory= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... @@ -80,108 +95,168 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --c (ignored) --d create directories instead of installing files. --g GROUP $chgrpprog installed files to GROUP. --m MODE $chmodprog installed files to MODE. --o USER $chownprog installed files to USER. --s $stripprog installed files. --t DIRECTORY install into DIRECTORY. --T report an error if DSTFILE is a directory. ---help display this help and exit. ---version display version info and exit. + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG " -while test -n "$1"; do +while test $# -ne 0; do case $1 in - -c) shift - continue;; + -c) ;; - -d) dir_arg=true - shift - continue;; + -C) copy_on_change=true;; + + -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; + shift;; --help) echo "$usage"; exit $?;; - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift - shift - continue;; + shift;; - -s) stripcmd=$stripprog - shift - continue;; + -s) stripcmd=$stripprog;; - -t) dstarg=$2 - shift - shift - continue;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true - shift - continue;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - *) # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - test -n "$dir_arg$dstarg" && break - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done - break;; + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; esac + shift done -if test -z "$1"; then +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + for src do - # Protect names starting with `-'. + # Protect names problematic for 'test' and other utilities. case $src in - -*) src=./$src ;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src - src= - - if test -d "$dst"; then - mkdircmd=: - chmodcmd= - else - mkdircmd=$mkdirprog - fi + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? else + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. @@ -190,82 +265,193 @@ do exit 1 fi - if test -z "$dstarg"; then + if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi + dst=$dst_arg - dst=$dstarg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst ;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dstarg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi - dst=$dst/`basename "$src"` + dstdir=$dst + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? fi fi - # This sed command emulates the dirname command. - dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac - # Make sure that the destination directory exists. + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; + esac - # Skip lots of stat calls in the usual case. - if test ! -d "$dstdir"; then - defaultIFS=' - ' - IFS="${IFS-$defaultIFS}" + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else - oIFS=$IFS - # Some sh's can't handle IFS=/ for some reason. - IFS='%' - set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` - shift - IFS=$oIFS + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. - pathcomp= + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac - while test $# -ne 0 ; do - pathcomp=$pathcomp$1 + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir shift - if test ! -d "$pathcomp"; then - $mkdirprog "$pathcomp" - # mkdir can fail with a `File exist' error in case several - # install-sh are creating the directory concurrently. This - # is OK. - test -d "$pathcomp" || exit + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi - pathcomp=$pathcomp/ - done + fi fi if test -n "$dir_arg"; then - $doit $mkdircmd "$dst" \ - && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } - + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else - dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. - $doit $cpprog "$src" "$dsttmp" && + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -273,51 +459,60 @@ do # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && - - # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ - || { - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - if test -f "$dstdir/$dstfile"; then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ - || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ - || { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit 1 - } - else - : - fi - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - } - } - fi || { (exit 1); exit 1; } + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi done -# The final little trick to "correctly" pass the exit status to the exit trap. -{ - (exit 0); exit 0 -} - # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" # End: diff --git a/vendor/libssh2/ltmain.sh b/vendor/libssh2/ltmain.sh index a736cf994..f402c9c17 100644 --- a/vendor/libssh2/ltmain.sh +++ b/vendor/libssh2/ltmain.sh @@ -31,7 +31,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.6 Debian-2.4.6-2" +VERSION="2.4.6 Debian-2.4.6-10" package_revision=2.4.6 @@ -1370,7 +1370,7 @@ func_lt_ver () #! /bin/sh # Set a version string for this script. -scriptversion=2014-01-07.03; # UTC +scriptversion=2015-10-07.11; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 @@ -1530,6 +1530,8 @@ func_run_hooks () { $debug_cmd + _G_rc_run_hooks=false + case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; @@ -1538,16 +1540,16 @@ func_run_hooks () eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + if eval $_G_hook '"$@"'; then + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + _G_rc_run_hooks=: + fi done - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result + $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result } @@ -1557,10 +1559,16 @@ func_run_hooks () ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed +# full positional parameter list in your hook function, you may remove/edit +# any options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for -# 'eval'. Like this: +# 'eval'. In this case you also must return $EXIT_SUCCESS to let the +# hook's caller know that it should pay attention to +# '_result'. Returning $EXIT_FAILURE signalizes that +# arguments are left untouched by the hook and therefore caller will ignore the +# result variable. +# +# Like this: # # my_options_prep () # { @@ -1570,9 +1578,11 @@ func_run_hooks () # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). There is +# # no need to do the equivalent (but slower) action: +# # func_quote_for_eval ${1+"$@"} +# # my_options_prep_result=$func_quote_for_eval_result +# false # } # func_add_hook func_options_prep my_options_prep # @@ -1581,25 +1591,37 @@ func_run_hooks () # { # $debug_cmd # +# args_changed=false +# # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@", we could need that later +# # if $args_changed is true. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# if $args_changed; then +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# fi +# +# $args_changed # } # func_add_hook func_parse_options my_silent_option # @@ -1611,16 +1633,32 @@ func_run_hooks () # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result +# false # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + _G_func_options_finish_exit=false + if func_run_hooks func_options ${1+"$@"}; then + func_options_finish_result=$func_run_hooks_result + _G_func_options_finish_exit=: + fi + + $_G_func_options_finish_exit +} + + # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the @@ -1630,17 +1668,28 @@ func_options () { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_rc_options=false - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + for my_func in options_prep parse_options validate_options options_finish + do + if eval func_$my_func '${1+"$@"}'; then + eval _G_res_var='$'"func_${my_func}_result" + eval set dummy "$_G_res_var" ; shift + _G_rc_options=: + fi + done + + # Save modified positional parameters for caller. As a top-level + # options-parser function we always need to set the 'func_options_result' + # variable (regardless the $_G_rc_options value). + if $_G_rc_options; then + func_options_result=$_G_res_var + else + func_quote_for_eval ${1+"$@"} + func_options_result=$func_quote_for_eval_result + fi - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + $_G_rc_options } @@ -1649,9 +1698,9 @@ func_options () # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete +# needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before -# returning. +# returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned). func_hookable func_options_prep func_options_prep () { @@ -1661,10 +1710,14 @@ func_options_prep () opt_verbose=false opt_warning_types= - func_run_hooks func_options_prep ${1+"$@"} + _G_rc_options_prep=false + if func_run_hooks func_options_prep ${1+"$@"}; then + _G_rc_options_prep=: + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result + fi - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + $_G_rc_options_prep } @@ -1678,18 +1731,20 @@ func_parse_options () func_parse_options_result= + _G_rc_parse_options=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. - func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + if func_run_hooks func_parse_options ${1+"$@"}; then + eval set dummy "$func_run_hooks_result"; shift + _G_rc_parse_options=: + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -1704,7 +1759,10 @@ func_parse_options () ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_rc_parse_options=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -1757,15 +1815,25 @@ func_parse_options () shift ;; - --) break ;; + --) _G_rc_parse_options=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + $_G_match_parse_options && _G_rc_parse_options=: done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + + if $_G_rc_parse_options; then + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result + fi + + $_G_rc_parse_options } @@ -1778,16 +1846,21 @@ func_validate_options () { $debug_cmd + _G_rc_validate_options=false + # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" - func_run_hooks func_validate_options ${1+"$@"} + if func_run_hooks func_validate_options ${1+"$@"}; then + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result + _G_rc_validate_options=: + fi # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result + $_G_rc_validate_options } @@ -2068,7 +2141,7 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname $scriptversion Debian-2.4.6-2 + version: $progname $scriptversion Debian-2.4.6-10 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` @@ -2270,6 +2343,8 @@ libtool_options_prep () nonopt= preserve_args= + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2293,11 +2368,18 @@ libtool_options_prep () uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; + *) + _G_rc_lt_options_prep=false + ;; esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result + fi + + $_G_rc_lt_options_prep } func_add_hook func_options_prep libtool_options_prep @@ -2309,9 +2391,12 @@ libtool_parse_options () { $debug_cmd + _G_rc_lt_parse_options=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do + _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -2386,15 +2471,22 @@ libtool_parse_options () func_append preserve_args " $_G_opt" ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result + fi - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + $_G_rc_lt_parse_options } func_add_hook func_parse_options libtool_parse_options @@ -7275,10 +7367,11 @@ func_mode_link () # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*|-fsanitize=*) + -specs=*|-fsanitize=*|-fuse-ld=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" diff --git a/vendor/libssh2/m4/libtool.m4 b/vendor/libssh2/m4/libtool.m4 index ee80844b6..9d6dd9fce 100644 --- a/vendor/libssh2/m4/libtool.m4 +++ b/vendor/libssh2/m4/libtool.m4 @@ -4063,7 +4063,8 @@ _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -4703,6 +4704,12 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -6438,7 +6445,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else GXX=no @@ -6813,7 +6820,7 @@ if test yes != "$_lt_caught_CXX_error"; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -6878,7 +6885,7 @@ if test yes != "$_lt_caught_CXX_error"; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -7217,7 +7224,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # FIXME: insert proper C++ library support @@ -7301,7 +7308,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. @@ -7312,7 +7319,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' diff --git a/vendor/libssh2/missing b/vendor/libssh2/missing index f62bbae30..625aeb118 100755 --- a/vendor/libssh2/missing +++ b/vendor/libssh2/missing @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2013-10-28.13; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ else exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/vendor/libssh2/src/Makefile.in b/vendor/libssh2/src/Makefile.in index 9e59967ee..44533bded 100644 --- a/vendor/libssh2/src/Makefile.in +++ b/vendor/libssh2/src/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -176,7 +176,20 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/agent.Plo ./$(DEPDIR)/channel.Plo \ + ./$(DEPDIR)/comp.Plo ./$(DEPDIR)/crypt.Plo \ + ./$(DEPDIR)/global.Plo ./$(DEPDIR)/hostkey.Plo \ + ./$(DEPDIR)/keepalive.Plo ./$(DEPDIR)/kex.Plo \ + ./$(DEPDIR)/knownhost.Plo ./$(DEPDIR)/libgcrypt.Plo \ + ./$(DEPDIR)/mac.Plo ./$(DEPDIR)/mbedtls.Plo \ + ./$(DEPDIR)/misc.Plo ./$(DEPDIR)/openssl.Plo \ + ./$(DEPDIR)/os400qc3.Plo ./$(DEPDIR)/packet.Plo \ + ./$(DEPDIR)/pem.Plo ./$(DEPDIR)/publickey.Plo \ + ./$(DEPDIR)/scp.Plo ./$(DEPDIR)/session.Plo \ + ./$(DEPDIR)/sftp.Plo ./$(DEPDIR)/transport.Plo \ + ./$(DEPDIR)/userauth.Plo ./$(DEPDIR)/version.Plo \ + ./$(DEPDIR)/wincng.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -463,8 +476,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(srcdir)/../Makefile.OpenSSL.inc $(srcdir)/../Makefile.libgcrypt.inc $(srcdir)/../Makefile.WinCNG.inc $(srcdir)/../Makefile.os400qc3.inc $(srcdir)/../Makefile.mbedTLS.inc $(srcdir)/../Makefile.inc $(am__empty): @@ -536,31 +549,37 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agent.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostkey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keepalive.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kex.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/knownhost.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgcrypt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mac.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbedtls.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openssl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os400qc3.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packet.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/publickey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transport.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userauth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wincng.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agent.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostkey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keepalive.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kex.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/knownhost.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgcrypt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mac.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbedtls.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openssl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os400qc3.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packet.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pem.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/publickey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transport.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userauth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wincng.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -641,7 +660,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -714,7 +736,31 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/agent.Plo + -rm -f ./$(DEPDIR)/channel.Plo + -rm -f ./$(DEPDIR)/comp.Plo + -rm -f ./$(DEPDIR)/crypt.Plo + -rm -f ./$(DEPDIR)/global.Plo + -rm -f ./$(DEPDIR)/hostkey.Plo + -rm -f ./$(DEPDIR)/keepalive.Plo + -rm -f ./$(DEPDIR)/kex.Plo + -rm -f ./$(DEPDIR)/knownhost.Plo + -rm -f ./$(DEPDIR)/libgcrypt.Plo + -rm -f ./$(DEPDIR)/mac.Plo + -rm -f ./$(DEPDIR)/mbedtls.Plo + -rm -f ./$(DEPDIR)/misc.Plo + -rm -f ./$(DEPDIR)/openssl.Plo + -rm -f ./$(DEPDIR)/os400qc3.Plo + -rm -f ./$(DEPDIR)/packet.Plo + -rm -f ./$(DEPDIR)/pem.Plo + -rm -f ./$(DEPDIR)/publickey.Plo + -rm -f ./$(DEPDIR)/scp.Plo + -rm -f ./$(DEPDIR)/session.Plo + -rm -f ./$(DEPDIR)/sftp.Plo + -rm -f ./$(DEPDIR)/transport.Plo + -rm -f ./$(DEPDIR)/userauth.Plo + -rm -f ./$(DEPDIR)/version.Plo + -rm -f ./$(DEPDIR)/wincng.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags @@ -760,7 +806,31 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/agent.Plo + -rm -f ./$(DEPDIR)/channel.Plo + -rm -f ./$(DEPDIR)/comp.Plo + -rm -f ./$(DEPDIR)/crypt.Plo + -rm -f ./$(DEPDIR)/global.Plo + -rm -f ./$(DEPDIR)/hostkey.Plo + -rm -f ./$(DEPDIR)/keepalive.Plo + -rm -f ./$(DEPDIR)/kex.Plo + -rm -f ./$(DEPDIR)/knownhost.Plo + -rm -f ./$(DEPDIR)/libgcrypt.Plo + -rm -f ./$(DEPDIR)/mac.Plo + -rm -f ./$(DEPDIR)/mbedtls.Plo + -rm -f ./$(DEPDIR)/misc.Plo + -rm -f ./$(DEPDIR)/openssl.Plo + -rm -f ./$(DEPDIR)/os400qc3.Plo + -rm -f ./$(DEPDIR)/packet.Plo + -rm -f ./$(DEPDIR)/pem.Plo + -rm -f ./$(DEPDIR)/publickey.Plo + -rm -f ./$(DEPDIR)/scp.Plo + -rm -f ./$(DEPDIR)/session.Plo + -rm -f ./$(DEPDIR)/sftp.Plo + -rm -f ./$(DEPDIR)/transport.Plo + -rm -f ./$(DEPDIR)/userauth.Plo + -rm -f ./$(DEPDIR)/version.Plo + -rm -f ./$(DEPDIR)/wincng.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -781,9 +851,9 @@ uninstall-am: uninstall-libLTLIBRARIES .MAKE: all install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ diff --git a/vendor/libssh2/src/channel.c b/vendor/libssh2/src/channel.c index 538a0ab0d..39ff05bf1 100644 --- a/vendor/libssh2/src/channel.c +++ b/vendor/libssh2/src/channel.c @@ -238,7 +238,20 @@ _libssh2_channel_open(LIBSSH2_SESSION * session, const char *channel_type, goto channel_error; } + if(session->open_data_len < 1) { + _libssh2_error(session, LIBSSH2_ERROR_PROTO, + "Unexpected packet size"); + goto channel_error; + } + if (session->open_data[0] == SSH_MSG_CHANNEL_OPEN_CONFIRMATION) { + + if(session->open_data_len < 17) { + _libssh2_error(session, LIBSSH2_ERROR_PROTO, + "Unexpected packet size"); + goto channel_error; + } + session->open_channel->remote.id = _libssh2_ntohu32(session->open_data + 5); session->open_channel->local.window_size = @@ -518,7 +531,7 @@ channel_forward_listen(LIBSSH2_SESSION * session, const char *host, if (rc == LIBSSH2_ERROR_EAGAIN) { _libssh2_error(session, LIBSSH2_ERROR_EAGAIN, "Would block"); return NULL; - } else if (rc) { + } else if (rc || data_len < 1) { _libssh2_error(session, LIBSSH2_ERROR_PROTO, "Unknown"); session->fwdLstn_state = libssh2_NB_state_idle; return NULL; @@ -855,6 +868,11 @@ static int channel_setenv(LIBSSH2_CHANNEL *channel, channel->setenv_state = libssh2_NB_state_idle; return rc; } + else if(data_len < 1) { + channel->setenv_state = libssh2_NB_state_idle; + return _libssh2_error(session, LIBSSH2_ERROR_PROTO, + "Unexpected packet size"); + } if (data[0] == SSH_MSG_CHANNEL_SUCCESS) { LIBSSH2_FREE(session, data); @@ -971,7 +989,7 @@ static int channel_request_pty(LIBSSH2_CHANNEL *channel, &channel->reqPTY_packet_requirev_state); if (rc == LIBSSH2_ERROR_EAGAIN) { return rc; - } else if (rc) { + } else if (rc || data_len < 1) { channel->reqPTY_state = libssh2_NB_state_idle; return _libssh2_error(session, LIBSSH2_ERROR_PROTO, "Failed to require the PTY package"); @@ -1197,7 +1215,7 @@ channel_x11_req(LIBSSH2_CHANNEL *channel, int single_connection, &channel->reqX11_packet_requirev_state); if (rc == LIBSSH2_ERROR_EAGAIN) { return rc; - } else if (rc) { + } else if (rc || data_len < 1) { channel->reqX11_state = libssh2_NB_state_idle; return _libssh2_error(session, rc, "waiting for x11-req response packet"); @@ -1324,7 +1342,7 @@ _libssh2_channel_process_startup(LIBSSH2_CHANNEL *channel, &channel->process_packet_requirev_state); if (rc == LIBSSH2_ERROR_EAGAIN) { return rc; - } else if (rc) { + } else if (rc || data_len < 1) { channel->process_state = libssh2_NB_state_end; return _libssh2_error(session, rc, "Failed waiting for channel success"); diff --git a/vendor/libssh2/src/comp.c b/vendor/libssh2/src/comp.c index 4560188bb..629319590 100644 --- a/vendor/libssh2/src/comp.c +++ b/vendor/libssh2/src/comp.c @@ -224,7 +224,12 @@ comp_method_zlib_decomp(LIBSSH2_SESSION * session, /* A short-term alloc of a full data chunk is better than a series of reallocs */ char *out; - int out_maxlen = 4 * src_len; + size_t out_maxlen = src_len; + + if (src_len <= SIZE_MAX / 4) + out_maxlen = src_len * 4; + else + out_maxlen = payload_limit; /* If strm is null, then we have not yet been initialized. */ if (strm == NULL) @@ -271,7 +276,7 @@ comp_method_zlib_decomp(LIBSSH2_SESSION * session, "decompression failure"); } - if (out_maxlen >= (int) payload_limit) { + if (out_maxlen > (int) payload_limit || out_maxlen > SIZE_MAX / 2) { LIBSSH2_FREE(session, out); return _libssh2_error(session, LIBSSH2_ERROR_ZLIB, "Excessive growth in decompression phase"); diff --git a/vendor/libssh2/src/kex.c b/vendor/libssh2/src/kex.c index 65b722f42..3634cb5a9 100644 --- a/vendor/libssh2/src/kex.c +++ b/vendor/libssh2/src/kex.c @@ -228,11 +228,23 @@ static int diffie_hellman_sha1(LIBSSH2_SESSION *session, } /* Parse KEXDH_REPLY */ + if(exchange_state->s_packet_len < 5) { + ret = _libssh2_error(session, LIBSSH2_ERROR_PROTO, + "Unexpected packet length"); + goto clean_exit; + } + exchange_state->s = exchange_state->s_packet + 1; session->server_hostkey_len = _libssh2_ntohu32(exchange_state->s); exchange_state->s += 4; + if(session->server_hostkey_len > exchange_state->s_packet_len - 5) { + ret = _libssh2_error(session, LIBSSH2_ERROR_OUT_OF_BOUNDARY, + "Host key length out of bounds"); + goto clean_exit; + } + if (session->server_hostkey) LIBSSH2_FREE(session, session->server_hostkey); @@ -848,11 +860,23 @@ static int diffie_hellman_sha256(LIBSSH2_SESSION *session, } /* Parse KEXDH_REPLY */ + if(exchange_state->s_packet_len < 5) { + ret = _libssh2_error(session, LIBSSH2_ERROR_PROTO, + "Unexpected packet length"); + goto clean_exit; + } + exchange_state->s = exchange_state->s_packet + 1; session->server_hostkey_len = _libssh2_ntohu32(exchange_state->s); exchange_state->s += 4; + if(session->server_hostkey_len > exchange_state->s_packet_len - 5) { + ret = _libssh2_error(session, LIBSSH2_ERROR_OUT_OF_BOUNDARY, + "Host key length out of bounds"); + goto clean_exit; + } + if (session->server_hostkey) LIBSSH2_FREE(session, session->server_hostkey); diff --git a/vendor/libssh2/src/libssh2_priv.h b/vendor/libssh2/src/libssh2_priv.h index b4296a221..bb5d1a50a 100644 --- a/vendor/libssh2/src/libssh2_priv.h +++ b/vendor/libssh2/src/libssh2_priv.h @@ -146,6 +146,18 @@ static inline int writev(int sock, struct iovec *iov, int nvecs) #endif +#ifndef SIZE_MAX +#if _WIN64 +#define SIZE_MAX 0xFFFFFFFFFFFFFFFF +#else +#define SIZE_MAX 0xFFFFFFFF +#endif +#endif + +#ifndef UINT_MAX +#define UINT_MAX 0xFFFFFFFF +#endif + /* RFC4253 section 6.1 Maximum Packet Length says: * * "All implementations MUST be able to process packets with diff --git a/vendor/libssh2/src/packet.c b/vendor/libssh2/src/packet.c index 5f1feb8c6..c950b5dcf 100644 --- a/vendor/libssh2/src/packet.c +++ b/vendor/libssh2/src/packet.c @@ -775,8 +775,8 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data, uint32_t len = _libssh2_ntohu32(data + 5); unsigned char want_reply = 1; - if(len < (datalen - 10)) - want_reply = data[9 + len]; + if((len + 9) < datalen) + want_reply = data[len + 9]; _libssh2_debug(session, LIBSSH2_TRACE_CONN, @@ -784,6 +784,7 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data, channel, len, data + 9, want_reply); if (len == sizeof("exit-status") - 1 + && (sizeof("exit-status") - 1 + 9) <= datalen && !memcmp("exit-status", data + 9, sizeof("exit-status") - 1)) { @@ -792,7 +793,7 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data, channelp = _libssh2_channel_locate(session, channel); - if (channelp) { + if (channelp && (sizeof("exit-status") + 13) <= datalen) { channelp->exit_status = _libssh2_ntohu32(data + 9 + sizeof("exit-status")); _libssh2_debug(session, LIBSSH2_TRACE_CONN, @@ -805,24 +806,32 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data, } else if (len == sizeof("exit-signal") - 1 + && (sizeof("exit-signal") - 1 + 9) <= datalen && !memcmp("exit-signal", data + 9, sizeof("exit-signal") - 1)) { /* command terminated due to signal */ if(datalen >= 20) channelp = _libssh2_channel_locate(session, channel); - if (channelp) { + if (channelp && (sizeof("exit-signal") + 13) <= datalen) { /* set signal name (without SIG prefix) */ uint32_t namelen = _libssh2_ntohu32(data + 9 + sizeof("exit-signal")); - channelp->exit_signal = - LIBSSH2_ALLOC(session, namelen + 1); + + if(namelen <= UINT_MAX - 1) { + channelp->exit_signal = + LIBSSH2_ALLOC(session, namelen + 1); + } + else { + channelp->exit_signal = NULL; + } + if (!channelp->exit_signal) rc = _libssh2_error(session, LIBSSH2_ERROR_ALLOC, "memory for signal name"); - else { + else if ((sizeof("exit-signal") + 13 + namelen <= datalen)) { memcpy(channelp->exit_signal, - data + 13 + sizeof("exit_signal"), namelen); + data + 13 + sizeof("exit-signal"), namelen); channelp->exit_signal[namelen] = '\0'; /* TODO: save error message and language tag */ _libssh2_debug(session, LIBSSH2_TRACE_CONN, diff --git a/vendor/libssh2/src/session.c b/vendor/libssh2/src/session.c index 6352d12ee..b5a83ddd6 100644 --- a/vendor/libssh2/src/session.c +++ b/vendor/libssh2/src/session.c @@ -765,6 +765,11 @@ session_startup(LIBSSH2_SESSION *session, libssh2_socket_t sock) if (rc) return rc; + if(session->startup_data_len < 5) { + return _libssh2_error(session, LIBSSH2_ERROR_PROTO, + "Unexpected packet length"); + } + session->startup_service_length = _libssh2_ntohu32(session->startup_data + 1); diff --git a/vendor/libssh2/src/sftp.c b/vendor/libssh2/src/sftp.c index 7c4411640..fd94d3902 100644 --- a/vendor/libssh2/src/sftp.c +++ b/vendor/libssh2/src/sftp.c @@ -204,6 +204,10 @@ sftp_packet_add(LIBSSH2_SFTP *sftp, unsigned char *data, LIBSSH2_SFTP_PACKET *packet; uint32_t request_id; + if (data_len < 5) { + return LIBSSH2_ERROR_OUT_OF_BOUNDARY; + } + _libssh2_debug(session, LIBSSH2_TRACE_SFTP, "Received packet type %d (len %d)", (int) data[0], data_len); @@ -345,6 +349,10 @@ sftp_packet_read(LIBSSH2_SFTP *sftp) return _libssh2_error(session, LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED, "SFTP packet too large"); + if (sftp->partial_len == 0) + return _libssh2_error(session, + LIBSSH2_ERROR_ALLOC, + "Unable to allocate empty SFTP packet"); _libssh2_debug(session, LIBSSH2_TRACE_SFTP, "Data begin - Packet Length: %lu", @@ -504,11 +512,15 @@ sftp_packet_ask(LIBSSH2_SFTP *sftp, unsigned char packet_type, static int sftp_packet_require(LIBSSH2_SFTP *sftp, unsigned char packet_type, uint32_t request_id, unsigned char **data, - size_t *data_len) + size_t *data_len, size_t required_size) { LIBSSH2_SESSION *session = sftp->channel->session; int rc; + if (data == NULL || data_len == NULL || required_size == 0) { + return LIBSSH2_ERROR_BAD_USE; + } + _libssh2_debug(session, LIBSSH2_TRACE_SFTP, "Requiring packet %d id %ld", (int) packet_type, request_id); @@ -516,6 +528,11 @@ sftp_packet_require(LIBSSH2_SFTP *sftp, unsigned char packet_type, /* The right packet was available in the packet brigade */ _libssh2_debug(session, LIBSSH2_TRACE_SFTP, "Got %d", (int) packet_type); + + if (*data_len < required_size) { + return LIBSSH2_ERROR_OUT_OF_BOUNDARY; + } + return LIBSSH2_ERROR_NONE; } @@ -529,6 +546,11 @@ sftp_packet_require(LIBSSH2_SFTP *sftp, unsigned char packet_type, /* The right packet was available in the packet brigade */ _libssh2_debug(session, LIBSSH2_TRACE_SFTP, "Got %d", (int) packet_type); + + if (*data_len < required_size) { + return LIBSSH2_ERROR_OUT_OF_BOUNDARY; + } + return LIBSSH2_ERROR_NONE; } } @@ -544,11 +566,15 @@ static int sftp_packet_requirev(LIBSSH2_SFTP *sftp, int num_valid_responses, const unsigned char *valid_responses, uint32_t request_id, unsigned char **data, - size_t *data_len) + size_t *data_len, size_t required_size) { int i; int rc; + if (data == NULL || data_len == NULL || required_size == 0) { + return LIBSSH2_ERROR_BAD_USE; + } + /* If no timeout is active, start a new one */ if (sftp->requirev_start == 0) sftp->requirev_start = time(NULL); @@ -562,6 +588,11 @@ sftp_packet_requirev(LIBSSH2_SFTP *sftp, int num_valid_responses, * the timeout is not active */ sftp->requirev_start = 0; + + if (*data_len < required_size) { + return LIBSSH2_ERROR_OUT_OF_BOUNDARY; + } + return LIBSSH2_ERROR_NONE; } } @@ -636,36 +667,65 @@ sftp_attr2bin(unsigned char *p, const LIBSSH2_SFTP_ATTRIBUTES * attrs) /* sftp_bin2attr */ static int -sftp_bin2attr(LIBSSH2_SFTP_ATTRIBUTES * attrs, const unsigned char *p) +sftp_bin2attr(LIBSSH2_SFTP_ATTRIBUTES * attrs, const unsigned char *p, size_t data_len) { const unsigned char *s = p; - memset(attrs, 0, sizeof(LIBSSH2_SFTP_ATTRIBUTES)); - attrs->flags = _libssh2_ntohu32(s); - s += 4; + if (data_len >= 4) { + memset(attrs, 0, sizeof(LIBSSH2_SFTP_ATTRIBUTES)); + attrs->flags = _libssh2_ntohu32(s); + s += 4; + data_len -= 4; + } + else { + return LIBSSH2_ERROR_OUT_OF_BOUNDARY; + } if (attrs->flags & LIBSSH2_SFTP_ATTR_SIZE) { - attrs->filesize = _libssh2_ntohu64(s); - s += 8; + if (data_len >= 8) { + attrs->filesize = _libssh2_ntohu64(s); + s += 8; + data_len -= 8; + } + else { + return LIBSSH2_ERROR_OUT_OF_BOUNDARY; + } } if (attrs->flags & LIBSSH2_SFTP_ATTR_UIDGID) { - attrs->uid = _libssh2_ntohu32(s); - s += 4; - attrs->gid = _libssh2_ntohu32(s); - s += 4; + if (data_len >= 8) { + attrs->uid = _libssh2_ntohu32(s); + s += 4; + attrs->gid = _libssh2_ntohu32(s); + s += 4; + data_len -= 8; + } + else { + return LIBSSH2_ERROR_OUT_OF_BOUNDARY; + } } if (attrs->flags & LIBSSH2_SFTP_ATTR_PERMISSIONS) { - attrs->permissions = _libssh2_ntohu32(s); - s += 4; + if (data_len >= 4) { + attrs->permissions = _libssh2_ntohu32(s); + s += 4; + data_len -= 4; + } + else { + return LIBSSH2_ERROR_OUT_OF_BOUNDARY; + } } if (attrs->flags & LIBSSH2_SFTP_ATTR_ACMODTIME) { - attrs->atime = _libssh2_ntohu32(s); - s += 4; - attrs->mtime = _libssh2_ntohu32(s); - s += 4; + if (data_len >= 8) { + attrs->atime = _libssh2_ntohu32(s); + s += 4; + attrs->mtime = _libssh2_ntohu32(s); + s += 4; + } + else { + return LIBSSH2_ERROR_OUT_OF_BOUNDARY; + } } return (s - p); @@ -835,18 +895,23 @@ static LIBSSH2_SFTP *sftp_init(LIBSSH2_SESSION *session) } rc = sftp_packet_require(sftp_handle, SSH_FXP_VERSION, - 0, &data, &data_len); - if (rc == LIBSSH2_ERROR_EAGAIN) + 0, &data, &data_len, 5); + if (rc == LIBSSH2_ERROR_EAGAIN) { + _libssh2_error(session, LIBSSH2_ERROR_EAGAIN, + "Would block receiving SSH_FXP_VERSION"); return NULL; - else if (rc) { - _libssh2_error(session, rc, - "Timeout waiting for response from SFTP subsystem"); - goto sftp_init_error; } - if (data_len < 5) { + else if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, "Invalid SSH_FXP_VERSION response"); - LIBSSH2_FREE(session, data); + goto sftp_init_error; + } + else if (rc) { + _libssh2_error(session, rc, + "Timeout waiting for response from SFTP subsystem"); goto sftp_init_error; } @@ -1112,12 +1177,20 @@ sftp_open(LIBSSH2_SFTP *sftp, const char *filename, { SSH_FXP_HANDLE, SSH_FXP_STATUS }; rc = sftp_packet_requirev(sftp, 2, fopen_responses, sftp->open_request_id, &data, - &data_len); + &data_len, 1); if (rc == LIBSSH2_ERROR_EAGAIN) { _libssh2_error(session, LIBSSH2_ERROR_EAGAIN, "Would block waiting for status message"); return NULL; } + else if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "Response too small"); + return NULL; + } sftp->open_state = libssh2_NB_state_idle; if (rc) { _libssh2_error(session, rc, "Timeout waiting for status message"); @@ -1148,12 +1221,20 @@ sftp_open(LIBSSH2_SFTP *sftp, const char *filename, /* silly situation, but check for a HANDLE */ rc = sftp_packet_require(sftp, SSH_FXP_HANDLE, sftp->open_request_id, &data, - &data_len); + &data_len, 10); if(rc == LIBSSH2_ERROR_EAGAIN) { /* go back to sent state and wait for something else */ sftp->open_state = libssh2_NB_state_sent; return NULL; } + else if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "Too small FXP_HANDLE"); + return NULL; + } else if(!rc) /* we got the handle so this is not a bad situation */ badness = 0; @@ -1480,15 +1561,21 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE * handle, char *buffer, } rc = sftp_packet_requirev(sftp, 2, read_responses, - chunk->request_id, &data, &data_len); - - if (rc==LIBSSH2_ERROR_EAGAIN && bytes_in_buffer != 0) { + chunk->request_id, &data, &data_len, 9); + if (rc == LIBSSH2_ERROR_EAGAIN && bytes_in_buffer != 0) { /* do not return EAGAIN if we have already * written data into the buffer */ return bytes_in_buffer; } - if (rc < 0) { + if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "Response too small"); + } + else if(rc < 0) { sftp->read_state = libssh2_NB_state_sent2; return rc; } @@ -1698,7 +1785,7 @@ static ssize_t sftp_readdir(LIBSSH2_SFTP_HANDLE *handle, char *buffer, if (attrs) memset(attrs, 0, sizeof(LIBSSH2_SFTP_ATTRIBUTES)); - s += sftp_bin2attr(attrs ? attrs : &attrs_dummy, s); + s += sftp_bin2attr(attrs ? attrs : &attrs_dummy, s, 32); handle->u.dir.next_name = (char *) s; end: @@ -1753,9 +1840,16 @@ static ssize_t sftp_readdir(LIBSSH2_SFTP_HANDLE *handle, char *buffer, retcode = sftp_packet_requirev(sftp, 2, read_responses, sftp->readdir_request_id, &data, - &data_len); + &data_len, 9); if (retcode == LIBSSH2_ERROR_EAGAIN) return retcode; + else if (retcode == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "Status message too short"); + } else if (retcode) { sftp->readdir_state = libssh2_NB_state_idle; return _libssh2_error(session, retcode, @@ -1981,8 +2075,15 @@ static ssize_t sftp_write(LIBSSH2_SFTP_HANDLE *handle, const char *buffer, /* we check the packets in order */ rc = sftp_packet_require(sftp, SSH_FXP_STATUS, - chunk->request_id, &data, &data_len); - if (rc < 0) { + chunk->request_id, &data, &data_len, 9); + if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "FXP write packet too short"); + } + else if (rc < 0) { if (rc == LIBSSH2_ERROR_EAGAIN) sftp->write_state = libssh2_NB_state_sent; return rc; @@ -2124,10 +2225,18 @@ static int sftp_fsync(LIBSSH2_SFTP_HANDLE *handle) } rc = sftp_packet_require(sftp, SSH_FXP_STATUS, - sftp->fsync_request_id, &data, &data_len); + sftp->fsync_request_id, &data, &data_len, 9); if (rc == LIBSSH2_ERROR_EAGAIN) { return rc; - } else if (rc) { + } + else if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "SFTP fsync packet too short"); + } + else if (rc) { sftp->fsync_state = libssh2_NB_state_idle; return _libssh2_error(session, rc, "Error waiting for FXP EXTENDED REPLY"); @@ -2227,9 +2336,16 @@ static int sftp_fstat(LIBSSH2_SFTP_HANDLE *handle, rc = sftp_packet_requirev(sftp, 2, fstat_responses, sftp->fstat_request_id, &data, - &data_len); + &data_len, 9); if (rc == LIBSSH2_ERROR_EAGAIN) return rc; + else if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "SFTP fstat packet too short"); + } else if (rc) { sftp->fstat_state = libssh2_NB_state_idle; return _libssh2_error(session, rc, @@ -2252,7 +2368,12 @@ static int sftp_fstat(LIBSSH2_SFTP_HANDLE *handle, } } - sftp_bin2attr(attrs, data + 5); + if (sftp_bin2attr(attrs, data + 5, data_len - 5) < 0) { + LIBSSH2_FREE(session, data); + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "Attributes too short in SFTP fstat"); + } + LIBSSH2_FREE(session, data); return 0; @@ -2429,11 +2550,19 @@ sftp_close_handle(LIBSSH2_SFTP_HANDLE *handle) if (handle->close_state == libssh2_NB_state_sent) { rc = sftp_packet_require(sftp, SSH_FXP_STATUS, handle->close_request_id, &data, - &data_len); + &data_len, 9); if (rc == LIBSSH2_ERROR_EAGAIN) { return rc; - - } else if (rc) { + } + else if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + data = NULL; + _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "Packet too short in FXP_CLOSE command"); + } + else if (rc) { _libssh2_error(session, rc, "Error waiting for status message"); } @@ -2547,10 +2676,17 @@ static int sftp_unlink(LIBSSH2_SFTP *sftp, const char *filename, rc = sftp_packet_require(sftp, SSH_FXP_STATUS, sftp->unlink_request_id, &data, - &data_len); + &data_len, 9); if (rc == LIBSSH2_ERROR_EAGAIN) { return rc; } + else if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "SFTP unlink packet too short"); + } else if (rc) { sftp->unlink_state = libssh2_NB_state_idle; return _libssh2_error(session, rc, @@ -2658,10 +2794,18 @@ static int sftp_rename(LIBSSH2_SFTP *sftp, const char *source_filename, rc = sftp_packet_require(sftp, SSH_FXP_STATUS, sftp->rename_request_id, &data, - &data_len); + &data_len, 9); if (rc == LIBSSH2_ERROR_EAGAIN) { return rc; - } else if (rc) { + } + else if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "SFTP rename packet too short"); + } + else if (rc) { sftp->rename_state = libssh2_NB_state_idle; return _libssh2_error(session, rc, "Error waiting for FXP STATUS"); @@ -2783,11 +2927,19 @@ static int sftp_fstatvfs(LIBSSH2_SFTP_HANDLE *handle, LIBSSH2_SFTP_STATVFS *st) } rc = sftp_packet_requirev(sftp, 2, responses, sftp->fstatvfs_request_id, - &data, &data_len); + &data, &data_len, 9); if (rc == LIBSSH2_ERROR_EAGAIN) { return rc; - } else if (rc) { + } + else if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "SFTP rename packet too short"); + } + else if (rc) { sftp->fstatvfs_state = libssh2_NB_state_idle; return _libssh2_error(session, rc, "Error waiting for FXP EXTENDED REPLY"); @@ -2910,10 +3062,18 @@ static int sftp_statvfs(LIBSSH2_SFTP *sftp, const char *path, } rc = sftp_packet_requirev(sftp, 2, responses, sftp->statvfs_request_id, - &data, &data_len); + &data, &data_len, 9); if (rc == LIBSSH2_ERROR_EAGAIN) { return rc; - } else if (rc) { + } + else if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "SFTP fstat packet too short"); + } + else if (rc) { sftp->statvfs_state = libssh2_NB_state_idle; return _libssh2_error(session, rc, "Error waiting for FXP EXTENDED REPLY"); @@ -3040,10 +3200,18 @@ static int sftp_mkdir(LIBSSH2_SFTP *sftp, const char *path, } rc = sftp_packet_require(sftp, SSH_FXP_STATUS, sftp->mkdir_request_id, - &data, &data_len); + &data, &data_len, 9); if (rc == LIBSSH2_ERROR_EAGAIN) { return rc; - } else if (rc) { + } + else if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "SFTP mkdir packet too short"); + } + else if (rc) { sftp->mkdir_state = libssh2_NB_state_idle; return _libssh2_error(session, rc, "Error waiting for FXP STATUS"); @@ -3134,10 +3302,18 @@ static int sftp_rmdir(LIBSSH2_SFTP *sftp, const char *path, } rc = sftp_packet_require(sftp, SSH_FXP_STATUS, - sftp->rmdir_request_id, &data, &data_len); + sftp->rmdir_request_id, &data, &data_len, 9); if (rc == LIBSSH2_ERROR_EAGAIN) { return rc; - } else if (rc) { + } + else if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "SFTP rmdir packet too short"); + } + else if (rc) { sftp->rmdir_state = libssh2_NB_state_idle; return _libssh2_error(session, rc, "Error waiting for FXP STATUS"); @@ -3247,9 +3423,16 @@ static int sftp_stat(LIBSSH2_SFTP *sftp, const char *path, } rc = sftp_packet_requirev(sftp, 2, stat_responses, - sftp->stat_request_id, &data, &data_len); + sftp->stat_request_id, &data, &data_len, 9); if (rc == LIBSSH2_ERROR_EAGAIN) return rc; + else if (rc == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "SFTP stat packet too short"); + } else if (rc) { sftp->stat_state = libssh2_NB_state_idle; return _libssh2_error(session, rc, @@ -3273,7 +3456,12 @@ static int sftp_stat(LIBSSH2_SFTP *sftp, const char *path, } memset(attrs, 0, sizeof(LIBSSH2_SFTP_ATTRIBUTES)); - sftp_bin2attr(attrs, data + 5); + if (sftp_bin2attr(attrs, data + 5, data_len - 5) < 0) { + LIBSSH2_FREE(session, data); + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "Attributes too short in SFTP fstat"); + } + LIBSSH2_FREE(session, data); return 0; @@ -3378,9 +3566,16 @@ static int sftp_symlink(LIBSSH2_SFTP *sftp, const char *path, retcode = sftp_packet_requirev(sftp, 2, link_responses, sftp->symlink_request_id, &data, - &data_len); + &data_len, 9); if (retcode == LIBSSH2_ERROR_EAGAIN) return retcode; + else if (retcode == LIBSSH2_ERROR_OUT_OF_BOUNDARY) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "SFTP symlink packet too short"); + } else if (retcode) { sftp->symlink_state = libssh2_NB_state_idle; return _libssh2_error(session, retcode, @@ -3410,6 +3605,14 @@ static int sftp_symlink(LIBSSH2_SFTP *sftp, const char *path, "no name entries"); } + if (data_len < 13) { + if (data_len > 0) { + LIBSSH2_FREE(session, data); + } + return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, + "SFTP stat packet too short"); + } + /* this reads a u32 and stores it into a signed 32bit value */ link_len = _libssh2_ntohu32(data + 9); if (link_len < target_len) { diff --git a/vendor/libssh2/src/transport.c b/vendor/libssh2/src/transport.c index 8725da095..7317579f3 100644 --- a/vendor/libssh2/src/transport.c +++ b/vendor/libssh2/src/transport.c @@ -438,6 +438,16 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session) return LIBSSH2_ERROR_DECRYPT; p->padding_length = block[4]; + if(p->packet_length < 1) { + return LIBSSH2_ERROR_DECRYPT; + } + else if(p->packet_length > LIBSSH2_PACKET_MAXPAYLOAD) { + return LIBSSH2_ERROR_OUT_OF_BOUNDARY; + } + else if ( p->padding_length > p->packet_length - 1 ) { + return LIBSSH2_ERROR_DECRYPT; + } + /* total_num is the number of bytes following the initial (5 bytes) packet length and padding length fields */ @@ -471,8 +481,12 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session) /* copy the data from index 5 to the end of the blocksize from the temporary buffer to the start of the decrypted buffer */ - memcpy(p->wptr, &block[5], blocksize - 5); - p->wptr += blocksize - 5; /* advance write pointer */ + if (blocksize - 5 <= total_num) { + memcpy(p->wptr, &block[5], blocksize - 5); + p->wptr += blocksize - 5; /* advance write pointer */ + } else { + return LIBSSH2_ERROR_OUT_OF_BOUNDARY; + } } /* init the data_num field to the number of bytes of @@ -546,7 +560,13 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session) /* if there are bytes to copy that aren't decrypted, simply copy them as-is to the target buffer */ if (numbytes > 0) { - memcpy(p->wptr, &p->buf[p->readidx], numbytes); + + if (numbytes <= total_num - (p->wptr - p->payload)) { + memcpy(p->wptr, &p->buf[p->readidx], numbytes); + } + else { + return LIBSSH2_ERROR_OUT_OF_BOUNDARY; + } /* advance the read pointer */ p->readidx += numbytes; diff --git a/vendor/libssh2/src/userauth.c b/vendor/libssh2/src/userauth.c index cdfa25e66..c02d81d0e 100644 --- a/vendor/libssh2/src/userauth.c +++ b/vendor/libssh2/src/userauth.c @@ -127,7 +127,7 @@ static char *userauth_list(LIBSSH2_SESSION *session, const char *username, _libssh2_error(session, LIBSSH2_ERROR_EAGAIN, "Would block requesting userauth list"); return NULL; - } else if (rc) { + } else if (rc || (session->userauth_list_data_len < 1)) { _libssh2_error(session, rc, "Failed getting response"); session->userauth_list_state = libssh2_NB_state_idle; return NULL; @@ -143,8 +143,20 @@ static char *userauth_list(LIBSSH2_SESSION *session, const char *username, return NULL; } - methods_len = _libssh2_ntohu32(session->userauth_list_data + 1); + if(session->userauth_list_data_len < 5) { + LIBSSH2_FREE(session, session->userauth_list_data); + session->userauth_list_data = NULL; + _libssh2_error(session, LIBSSH2_ERROR_PROTO, + "Unexpected packet size"); + return NULL; + } + methods_len = _libssh2_ntohu32(session->userauth_list_data + 1); + if(methods_len >= session->userauth_list_data_len - 5) { + _libssh2_error(session, LIBSSH2_ERROR_OUT_OF_BOUNDARY, + "Unexpected userauth list size"); + return NULL; + } /* Do note that the memory areas overlap! */ memmove(session->userauth_list_data, session->userauth_list_data + 5, methods_len); @@ -285,6 +297,11 @@ userauth_password(LIBSSH2_SESSION *session, return _libssh2_error(session, rc, "Waiting for password response"); } + else if(session->userauth_pswd_data_len < 1) { + session->userauth_pswd_state = libssh2_NB_state_idle; + return _libssh2_error(session, LIBSSH2_ERROR_PROTO, + "Unexpected packet size"); + } if (session->userauth_pswd_data[0] == SSH_MSG_USERAUTH_SUCCESS) { _libssh2_debug(session, LIBSSH2_TRACE_AUTH, @@ -312,6 +329,12 @@ userauth_password(LIBSSH2_SESSION *session, session->userauth_pswd_state = libssh2_NB_state_sent1; } + if(session->userauth_pswd_data_len < 1) { + session->userauth_pswd_state = libssh2_NB_state_idle; + return _libssh2_error(session, LIBSSH2_ERROR_PROTO, + "Unexpected packet size"); + } + if ((session->userauth_pswd_data[0] == SSH_MSG_USERAUTH_PASSWD_CHANGEREQ) || (session->userauth_pswd_data0 == @@ -976,7 +999,7 @@ userauth_hostbased_fromfile(LIBSSH2_SESSION *session, } session->userauth_host_state = libssh2_NB_state_idle; - if (rc) { + if (rc || data_len < 1) { return _libssh2_error(session, LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED, "Auth failed"); } @@ -1172,7 +1195,7 @@ _libssh2_userauth_publickey(LIBSSH2_SESSION *session, if (rc == LIBSSH2_ERROR_EAGAIN) { return _libssh2_error(session, LIBSSH2_ERROR_EAGAIN, "Would block"); } - else if (rc) { + else if (rc || (session->userauth_pblc_data_len < 1)) { LIBSSH2_FREE(session, session->userauth_pblc_packet); session->userauth_pblc_packet = NULL; LIBSSH2_FREE(session, session->userauth_pblc_method); @@ -1332,7 +1355,7 @@ _libssh2_userauth_publickey(LIBSSH2_SESSION *session, if (rc == LIBSSH2_ERROR_EAGAIN) { return _libssh2_error(session, LIBSSH2_ERROR_EAGAIN, "Would block requesting userauth list"); - } else if (rc) { + } else if (rc || session->userauth_pblc_data_len < 1) { session->userauth_pblc_state = libssh2_NB_state_idle; return _libssh2_error(session, LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED, "Waiting for publickey USERAUTH response"); @@ -1654,7 +1677,7 @@ userauth_keyboard_interactive(LIBSSH2_SESSION * session, if (rc == LIBSSH2_ERROR_EAGAIN) { return _libssh2_error(session, LIBSSH2_ERROR_EAGAIN, "Would block"); - } else if (rc) { + } else if (rc || session->userauth_kybd_data_len < 1) { session->userauth_kybd_state = libssh2_NB_state_idle; return _libssh2_error(session, LIBSSH2_ERROR_AUTHENTICATION_FAILED, @@ -1734,6 +1757,13 @@ userauth_keyboard_interactive(LIBSSH2_SESSION * session, /* int num-prompts */ session->userauth_kybd_num_prompts = _libssh2_ntohu32(s); s += 4; + if(session->userauth_kybd_num_prompts && + session->userauth_kybd_num_prompts > 100) { + _libssh2_error(session, LIBSSH2_ERROR_OUT_OF_BOUNDARY, + "Too many replies for " + "keyboard-interactive prompts"); + goto cleanup; + } if(session->userauth_kybd_num_prompts) { session->userauth_kybd_prompts = @@ -1801,8 +1831,17 @@ userauth_keyboard_interactive(LIBSSH2_SESSION * session, for(i = 0; i < session->userauth_kybd_num_prompts; i++) { /* string response[1] (ISO-10646 UTF-8) */ - session->userauth_kybd_packet_len += - 4 + session->userauth_kybd_responses[i].length; + if(session->userauth_kybd_responses[i].length <= + (SIZE_MAX - 4 - session->userauth_kybd_packet_len) ) { + session->userauth_kybd_packet_len += + 4 + session->userauth_kybd_responses[i].length; + } + else { + _libssh2_error(session, LIBSSH2_ERROR_ALLOC, + "Unable to allocate memory for keyboard-" + "interactive response packet"); + goto cleanup; + } } /* A new userauth_kybd_data area is to be allocated, free the diff --git a/vendor/libssh2/test-driver b/vendor/libssh2/test-driver index 32bf39e83..b8521a482 100755 --- a/vendor/libssh2/test-driver +++ b/vendor/libssh2/test-driver @@ -1,9 +1,9 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2012-06-27.10; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2018 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ scriptversion=2012-06-27.10; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -44,13 +44,12 @@ print_usage () Usage: test-driver --test-name=NAME --log-file=PATH --trs-file=PATH [--expect-failure={yes|no}] [--color-tests={yes|no}] - [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT + [--enable-hard-errors={yes|no}] [--] + TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] The '--test-name', '--log-file' and '--trs-file' options are mandatory. END } -# TODO: better error handling in option parsing (in particular, ensure -# TODO: $log_file, $trs_file and $test_name are defined). test_name= # Used for reporting. log_file= # Where to save the output of the test script. trs_file= # Where to save the metadata of the test run. @@ -69,10 +68,23 @@ while test $# -gt 0; do --enable-hard-errors) enable_hard_errors=$2; shift;; --) shift; break;; -*) usage_error "invalid option: '$1'";; + *) break;; esac shift done +missing_opts= +test x"$test_name" = x && missing_opts="$missing_opts --test-name" +test x"$log_file" = x && missing_opts="$missing_opts --log-file" +test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" +if test x"$missing_opts" != x; then + usage_error "the following mandatory options are missing:$missing_opts" +fi + +if test $# -eq 0; then + usage_error "missing argument" +fi + if test $color_tests = yes; then # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. red='' # Red. @@ -94,11 +106,14 @@ trap "st=143; $do_exit" 15 # Test script is run here. "$@" >$log_file 2>&1 estatus=$? + if test $enable_hard_errors = no && test $estatus -eq 99; then - estatus=1 + tweaked_estatus=1 +else + tweaked_estatus=$estatus fi -case $estatus:$expect_failure in +case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; @@ -107,6 +122,12 @@ case $estatus:$expect_failure in *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + # Report outcome to console. echo "${col}${res}${std}: $test_name" @@ -119,9 +140,9 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/vendor/libssh2/tests/Makefile.in b/vendor/libssh2/tests/Makefile.in index b3e7d461b..3228129f4 100644 --- a/vendor/libssh2/tests/Makefile.in +++ b/vendor/libssh2/tests/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -134,7 +134,8 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/example depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/simple.Po ./$(DEPDIR)/ssh2.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -578,8 +579,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -623,8 +624,14 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -825,7 +832,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) fi; \ $$success || exit 1 -check-TESTS: +check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @@ -882,7 +889,10 @@ ssh2.sh.log: ssh2.sh @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -957,7 +967,8 @@ clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/simple.Po + -rm -f ./$(DEPDIR)/ssh2.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -1003,7 +1014,8 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/simple.Po + -rm -f ./$(DEPDIR)/ssh2.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1024,8 +1036,8 @@ uninstall-am: .MAKE: check-am install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ diff --git a/vendor/libssh2/win32/libssh2_config.h b/vendor/libssh2/win32/libssh2_config.h index b6af97806..6ac2ef43e 100644 --- a/vendor/libssh2/win32/libssh2_config.h +++ b/vendor/libssh2/win32/libssh2_config.h @@ -18,7 +18,7 @@ #define HAVE_GETTIMEOFDAY #endif /* __MINGW32__ */ -#define LIBSSH2_OPENSSL +#define HAVE_LIBCRYPT32 #define HAVE_WINSOCK2_H #define HAVE_IOCTLSOCKET #define HAVE_SELECT @@ -44,3 +44,4 @@ #define LIBSSH2_DH_GEX_NEW 1 #endif /* LIBSSH2_CONFIG_H */ + diff --git a/vendor/static_config/openssl_distributions.json b/vendor/static_config/openssl_distributions.json index f00384dd9..d42ecae15 100644 --- a/vendor/static_config/openssl_distributions.json +++ b/vendor/static_config/openssl_distributions.json @@ -1,18 +1,18 @@ { - "macOS-clang-8.1-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/bd3cca94af79c6a2c35b664c43f643582a13a9f2/conan_package.tgz", - "macOS-clang-8.1-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/0197c20e330042c026560da838f5b4c4bf094b8a/conan_package.tgz", - "macOS-clang-9-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/85d674b0f6705cafe6b2edb8689ffbe0f3c2e60b/conan_package.tgz", - "macOS-clang-9-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/227fb0ea22f4797212e72ba94ea89c7b3fbc2a0c/conan_package.tgz", - "win32-vs12-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/39d6fe009a278f733e97b59a4f9536bfc4e8f366/conan_package.tgz", - "win32-vs12-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/d16d8a16b4cef0046922b8d83d567689d36149d0/conan_package.tgz", - "win32-vs14-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/889fd4ea9ba89fd6dc7fa32e2f45bd9804b85481/conan_package.tgz", - "win32-vs14-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/253958a6ce15f1c9325eeea33ffc0a5cfc29212a/conan_package.tgz", - "win32-vs15-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/05f648ec4d066b206769d6314e859fdd97a18f8d/conan_package.tgz", - "win32-vs15-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/a075e3ffc3590d6a920a26b4218b20253dd68d57/conan_package.tgz", - "win64-vs12-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/6bc3be0f39fdc624b24ba9bb00e8af55928d74e7/conan_package.tgz", - "win64-vs12-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/e942631065059eabe964ca471ad35bb453c15b31/conan_package.tgz", - "win64-vs14-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/867ca54360ed234a8bc9a6aa63806599ea29b38e/conan_package.tgz", - "win64-vs14-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/c4aef4edbc33205e0cf9b55bfb116b38c90ec132/conan_package.tgz", - "win64-vs15-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/0bd0c413b56aaec57c0f222a89b4e565a6729027/conan_package.tgz", - "win64-vs15-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/fce9be1511a149a4af36b5997f7e611ab83b2f58/conan_package.tgz" -} \ No newline at end of file + "macOS-clang-8.1-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/bd3cca94af79c6a2c35b664c43f643582a13a9f2/0/conan_package.tgz", + "macOS-clang-8.1-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/0197c20e330042c026560da838f5b4c4bf094b8a/0/conan_package.tgz", + "macOS-clang-9-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/85d674b0f6705cafe6b2edb8689ffbe0f3c2e60b/0/conan_package.tgz", + "macOS-clang-9-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/227fb0ea22f4797212e72ba94ea89c7b3fbc2a0c/0/conan_package.tgz", + "win32-vs12-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/39d6fe009a278f733e97b59a4f9536bfc4e8f366/0/conan_package.tgz", + "win32-vs12-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/d16d8a16b4cef0046922b8d83d567689d36149d0/0/conan_package.tgz", + "win32-vs14-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/889fd4ea9ba89fd6dc7fa32e2f45bd9804b85481/0/conan_package.tgz", + "win32-vs14-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/253958a6ce15f1c9325eeea33ffc0a5cfc29212a/0/conan_package.tgz", + "win32-vs15-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/05f648ec4d066b206769d6314e859fdd97a18f8d/0/conan_package.tgz", + "win32-vs15-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/a075e3ffc3590d6a920a26b4218b20253dd68d57/0/conan_package.tgz", + "win64-vs12-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/6bc3be0f39fdc624b24ba9bb00e8af55928d74e7/0/conan_package.tgz", + "win64-vs12-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/e942631065059eabe964ca471ad35bb453c15b31/0/conan_package.tgz", + "win64-vs14-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/867ca54360ed234a8bc9a6aa63806599ea29b38e/0/conan_package.tgz", + "win64-vs14-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/c4aef4edbc33205e0cf9b55bfb116b38c90ec132/0/conan_package.tgz", + "win64-vs15-static-debug": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/0bd0c413b56aaec57c0f222a89b4e565a6729027/0/conan_package.tgz", + "win64-vs15-static-release": "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/0/package/fce9be1511a149a4af36b5997f7e611ab83b2f58/0/conan_package.tgz" +}