summaryrefslogtreecommitdiff
path: root/include/git2/sys
Commit message (Collapse)AuthorAgeFilesLines
* index: fix contradicting comparisonPatrick Steinhardt2016-02-231-1/+1
| | | | | | | | | | | | | | | | | | The overflow check in `read_reuc` tries to verify if the `git__strtol32` parses an integer bigger than UINT_MAX. The `tmp` variable is casted to an unsigned int for this and then checked for being greater than UINT_MAX, which obviously can never be true. Fix this by instead fixing the `mode` field's size in `struct git_index_reuc_entry` to `uint32_t`. We can now parse the int with `git__strtol64`, which can never return a value bigger than `UINT32_MAX`, and additionally checking if the returned value is smaller than zero. We do not need to handle overflows explicitly here, as `git__strtol64` returns an error when the returned value would overflow.
* filter: clean up documentation around custom filtersEdward Thomson2016-02-091-25/+34
|
* stream: allow registering a user-provided TLS constructorcmn/tls-registerCarlos Martín Nieto2015-11-031-0/+13
| | | | | This allows the application to use their own TLS stream, regardless of the capabilities of libgit2 itself.
* Fix build for custom transport usersLeo Yang2015-10-301-0/+1
| | | | | We should explicitly include the declaration of git_strarray from "include/git2/sys/transport.h"
* refdb and odb backends must provide `free` functionArthur Schreiber2015-10-012-2/+6
| | | | | | | | | As refdb and odb backends can be allocated by client code, libgit2 can’t know whether an alternative memory allocator was used, and thus should not try to call `git__free` on those objects. Instead, odb and refdb backend implementations must always provide their own `free` functions to ensure memory gets freed correctly.
* Tell the git_transport about the custom_headersMatt Burke2015-09-081-0/+5
|
* transport: provide a way to get the callbacksCarlos Martín Nieto2015-08-191-0/+22
| | | | | | | | libgit2 implementations of smart subtransports can simply reach through the structure, but external implementors cannot. Add these two functions as a way for the smart subtransports to get the callbacks as set by the user.
* config: implement basic transactional supportCarlos Martín Nieto2015-08-121-0/+14
| | | | | | | When a configuration file is locked, any updates made to it will be done to the in-memory copy of the file. This allows for multiple updates to happen while we hold the lock, preventing races during complex config-file manipulation.
* Merge pull request #3332 from phatblat/ben/doc-warningsCarlos Martín Nieto2015-08-014-7/+7
|\ | | | | Resolve documentation warnings
| * Fix remaining documentation warningsBen Chatelain2015-07-272-2/+2
| |
| * Use correct Doxygen trailing comment syntaxBen Chatelain2015-07-271-4/+4
| |
| * Fix @param names in doc commentsBen Chatelain2015-07-272-2/+2
| |
* | refdb: delete a ref's reflog upon deletioncmn/reflog-del-backendCarlos Martín Nieto2015-07-121-2/+3
|/ | | | | | Removing a reflog upon ref deletion is something which only some backends might wish to do. Backends which are database-backed may wish to archive a reflog, log-based ones may not need to do anything.
* filters: custom filters with wildcard attributesEdward Thomson2015-07-011-1/+4
| | | | | | Allow custom filters with wildcard attributes, so that clients can support some random `filter=foo` in a .gitattributes and look up the corresponding smudge/clean commands in the configuration file.
* stream: add support for setting a proxyCarlos Martín Nieto2015-06-241-0/+2
| | | | | | | | If the stream claims to support this feature, we can let the transport set the proxy. We also set HTTPPROXYTUNNEL option so curl can create a tunnel through the proxy which lets us create our own TLS session (if needed).
* Merge pull request #3118 from libgit2/cmn/stream-sizeEdward Thomson2015-05-131-1/+1
|\ | | | | odb: make the writestream's size a git_off_t
| * odb: make the writestream's size a git_off_tcmn/stream-sizeCarlos Martín Nieto2015-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | Restricting files to size_t is a silly limitation. The loose backend writes to a file directly, so there is no issue in using 63 bits for the size. We still assume that the header is going to fit in 64 bytes, which does mean quite a bit smaller files due to the run-length encoding, but it's still a much larger size than you would want Git to handle.
* | remote: move the transport ctor to the callbacksCarlos Martín Nieto2015-05-131-20/+0
| | | | | | | | | | | | | | Instead of having it set in a different place from every other callback, put it the main structure. This removes some state from the remote and makes it behave more like clone, where the constructors are passed via the options.
* | Remove the callbacks struct from the remoteCarlos Martín Nieto2015-05-131-1/+1
|/ | | | | | | | | | | | | | Having the setting be different from calling its actions was not a great idea and made for the sake of the wrong convenience. Instead of that, accept either fetch options, push options or the callbacks when dealing with the remote. The fetch options are currently only the callbacks, but more options will be moved from setters and getters on the remote to the options. This does mean passing the same struct along the different functions but the typical use-case will only call git_remote_fetch() or git_remote_push() and so won't notice much difference.
* Add a custom param to git_smart_subtransport_definitionLeo Yang2015-03-181-4/+12
| | | | | The smart transport has already take the payload param. For the sub transport a payload param is useful for the implementer.
* config: borrow refcounted referencescmn/config-borrow-entryCarlos Martín Nieto2015-03-031-1/+3
| | | | | | | | | | | | | | | This changes the get_entry() method to return a refcounted version of the config entry, which you have to free when you're done. This allows us to avoid freeing the memory in which the entry is stored on a refresh, which may happen at any time for a live config. For this reason, get_string() has been forbidden on live configs and a new function get_string_buf() has been added, which stores the string in a git_buf which the user then owns. The functions which parse the string value takea advantage of the borrowing to parse safely and then release the entry.
* git_filter_opt_t -> git_filter_flag_tEdward Thomson2015-02-191-2/+2
| | | | | For consistency with the rest of the library, where an opt is an options *structure*.
* git_writestream: from git_filter_streamEdward Thomson2015-02-181-8/+2
|
* filters: introduce streaming filtersEdward Thomson2015-02-171-0/+14
| | | | | | | Add structures and preliminary functions to take a buffer, file or blob and write the contents in chunks through an arbitrary number of chained filters, finally writing into a user-provided function accept the contents.
* Fixed error when including git2/include/sys/stream.hJohn Haley2015-02-111-0/+2
|
* Merge pull request #2839 from swisspol/typoEdward Thomson2015-01-261-1/+1
|\ | | | | Fixed typo in git_repository_reinit_filesystem() documentation
| * Fixed typo in git_repository_reinit_filesystem() documentationPierre-Olivier Latour2015-01-231-1/+1
| |
* | Make sure sys/repository.h includes the required headersPierre-Olivier Latour2015-01-231-0/+3
|/ | | | | It was missing "common.h" and "types.h" like other system headers. This generated compilation errors if including it directly.
* Merge branch 'pr/2740'Edward Thomson2015-01-141-22/+49
|\
| * Added GIT_HASHSIG_ALLOW_SMALL_FILES to allow computing signatures for small ↵Pierre-Olivier Latour2015-01-141-22/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | files The implementation of the hashsig API disallows computing a signature on small files containing only a few lines. This new flag disables this behavior. git_diff_find_similar() sets this flag by default which means that rename / copy detection of small files will now work. This in turn affects the behavior of the git_status and git_blame APIs which will now detect rename of small files assuming the right options are passed.
* | Include git2/common.h in sys/openssl.h.David Calavera2015-01-021-1/+1
| |
* | index: reuc and name entrycounts should be size_tEdward Thomson2014-12-221-2/+2
|/ | | | | | For the REUC and NAME entries, we use size_t internally, and we take size_t for the get_byindex() functions, but the entrycount() functions strangely cast to an unsigned int instead.
* Merge pull request #2759 from libgit2/cmn/openssl-sysEdward Thomson2014-12-201-0/+38
|\ | | | | Make OpenSSL locking warnings more severe
| * Make the OpenSSL locking function warnings more severeCarlos Martín Nieto2014-12-121-0/+38
| | | | | | | | | | Our git_openssl_set_locking() would ideally not exist. Make it clearer that we provide it as a last resort and you should prefer anything else.
* | Fix public header on sys/refs.hDamien PROFETA2014-12-191-0/+11
|/ | | | | GIT_BEGIN/END_DECL were missing from sys/refs.h and preventing compilation with g++ as the symbol were mangled.
* Merge pull request #2678 from libgit2/cmn/io-streamEdward Thomson2014-12-101-0/+40
|\ | | | | Introduce stackable IO streams
| * stream: constify the write bufferCarlos Martín Nieto2014-12-101-1/+1
| |
| * Introduce stackable IO streamsCarlos Martín Nieto2014-12-101-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have gitno for talking over TCP, but this needs to know about both plaintext and OpenSSL connections and the code has gotten somewhat messy with ifdefs determining which version of the function should be called. In order to clean this up and abstract away the details of sending over the different types of streams, we can instead use an interface and stack stream implementations. We may not be able to use the stackability with all streams, but we are definitely be able to use the abstraction which is currently spread between different bits of gitno.
* | doc: add documentation to all the public structs and enumscmn/doc-allCarlos Martín Nieto2014-12-063-5/+24
| | | | | | | | | | | | | | | | | | | | This makes them show up in the reference, even if the text itself isn't the most descriptive. These have been found with grep -Przon '\n\ntypedef struct.*?\{' -- include grep -Przon '\n\ntypedef enum.*?\{' -- include
* | Spelling fixesWill Stamper2014-12-042-2/+2
|/
* config: remove the refresh function and backend fieldcmn/config-refresh-removeCarlos Martín Nieto2014-10-231-1/+0
| | | | | | We have been refreshing on read and write for a while now, so git_config_refresh() is at best a no-op, and might just end up wasting cycles.
* Merge pull request #2448 from libgit2/cmn/reference-transactionEdward Thomson2014-10-091-0/+13
|\ | | | | Introduce reference transactions
| * Introduce reference transactionsCarlos Martín Nieto2014-09-301-0/+13
| | | | | | | | | | | | | | | | | | A transaction allows you to lock multiple references and set up changes for them before applying the changes all at once (or as close as the backend supports). This can be used for replication purposes, or for making sure some operations run when the reference is locked and thus cannot be changed.
* | hashsig: Export as a `sys` headervmg/hashsigVicent Marti2014-10-011-0/+76
|/
* Merge pull request #2464 from libgit2/cmn/host-cert-infoVicent Marti2014-09-171-3/+1
|\ | | | | Provide a callback for certificate validation
| * net: remove support for outright ignoring certificatesCarlos Martín Nieto2014-09-161-3/+0
| | | | | | | | | | | | | | | | | | | | This option make it easy to ignore anything about the server we're connecting to, which is bad security practice. This was necessary as we didn't use to expose detailed information about the certificate, but now that we do, we should get rid of this. If the user wants to ignore everything, they can still provide a callback which ignores all the information passed.
| * Provide a callback for certificate validationCarlos Martín Nieto2014-09-161-0/+1
| | | | | | | | | | | | | | | | | | If the certificate validation fails (or always in the case of ssh), let the user decide whether to allow the connection. The data structure passed to the user is the native certificate information from the underlying implementation, namely OpenSSL or WinHTTP.
* | Fix attribute lookup in index for bare reposrb/attr-with-bareRussell Belfer2014-09-151-0/+13
|/ | | | | | | | | | | | | | | | When using a bare repo with an index, libgit2 attempts to read files from the index. It caches those files based on the path to the file, specifically the path to the directory that contains the file. If there is no working directory, we use `git_path_dirname_r` to get the path to the containing directory. However, for the `.gitattributes` file in the root of the repository, this ends up normalizing the containing path to `"."` instead of the empty string and the lookup the `.gitattributes` data fails. This adds a test of attribute lookups on bare repos and also fixes the problem by simply rewriting `"."` to be `""`.
* Custom transport: minor cleanupsEdward Thomson2014-08-141-0/+354
| | | | | | | | | | | | * Move the transport registration mechanisms into a new header under 'sys/' because this is advanced stuff. * Remove the 'priority' argument from the registration as it adds unnecessary complexity. (Since transports cannot decline to operate, only the highest priority transport is ever executed.) Users who require per-priority transports can implement that in their custom transport themselves. * Simplify registration further by taking a scheme (eg "http") instead of a prefix (eg "http://").
* Merge pull request #2188 from libgit2/cmn/config-snapshotRussell Belfer2014-05-121-1/+3
|\ | | | | Configuration snapshotting