Commit Graph

144 Commits

Author SHA1 Message Date
Timo Röhling
ad5611d85b New upstream version 1.5.0+ds 2022-08-28 14:13:25 +02:00
Mohammed Bilal
e579e0f707 New upstream version 1.4.3+dfsg.1 2022-05-05 10:45:21 +00:00
Pirate Praveen
c25aa7cd82 New upstream version 1.3.0+dfsg.1 2021-12-10 16:42:08 +05:30
Utkarsh Gupta
22a2d3d5ef New upstream version 1.1.0+dfsg.1 2020-12-07 04:06:37 +05:30
Jongmin Kim
ac3d33df5d New upstream version 0.28.1+dfsg.1 2019-05-12 00:29:21 +09:00
Pirate Praveen
eae0bfdcd8 New upstream version 0.27.0+dfsg.1 2018-04-26 18:06:07 +05:30
Mohseen Mukaddam
a78441bc46 Adding git_filter_init for initializing git_filter struct + unit test 2017-06-13 11:05:40 -07:00
Mohseen Mukaddam
7f7dabdaac adding GIT_FILTER_VERSION to GIT_FILTER_INIT as part of convention 2017-06-13 10:59:25 -07:00
Carlos Martín Nieto
5c76096046 transport: provide a getter for the proxy options
As with the callbacks, third-party implementations of smart subtransports cannot
reach into the opaque struct and thus cannot know what options the user set.

Add a getter for these options to copy the proxy options into something external
implementors can use.
2017-04-17 13:03:03 +02:00
Patrick Steinhardt
bb342159d8 merge_driver: fix const-correctness for source getters 2017-03-15 11:46:15 +01:00
Brock Peabody
4d99c4cfc6 Allow for caching of submodules.
Added `git_repository_submodule_cache_all` to initialze a cache of
submodules on the repository so that operations looking up N
submodules are O(N) and not O(N^2).  Added a
`git_repository_submodule_cache_clear` function to remove the cache.

Also optimized the function that loads all submodules as it was itself
O(N^2) w.r.t the number of submodules, having to loop through the
`.gitmodules` file once per submodule.  I changed it to process the
`.gitmodules` file once, into a map.

Signed-off-by: David Turner <dturner@twosigma.com>
2017-01-20 17:33:56 -05:00
Vicent Marti
2749ff46d8 time: Export git_time_monotonic 2016-09-13 15:52:43 +02:00
Edward Thomson
8f09a98e18 odb: freshen existing objects when writing
When writing an object, we calculate its OID and see if it exists in the
object database.  If it does, we need to freshen the file that contains
it.
2016-08-04 15:12:04 -04:00
Carlos Martín Nieto
60d717c6f1 proxy: add a payload field for the proxy options
I don't quite recall what we do in the other places where we use this,
but we should pass this payload to the callbacks.
2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
b373e9a6ba net: use proxy options struct in the stream config 2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
07bd3e57d9 proxy: ask the user for credentials if necessary 2016-04-19 13:54:19 +02:00
Edward Thomson
6d8b2cdbee merge driver: remove check callback
Since the `apply` callback can defer, the `check` callback is not
necessary.  Removing the `check` callback further makes the `payload`
unnecessary along with the `cleanup` callback.
2016-03-17 11:06:00 -04:00
Edward Thomson
3f7d3df1ec merge driver: improve inline documentation 2016-03-17 11:06:00 -04:00
Edward Thomson
3f04219fcd merge driver: introduce custom merge drivers
Consumers can now register custom merged drivers with
`git_merge_driver_register`.  This allows consumers to support the
merge drivers, as configured in `.gitattributes`.  Consumers will be
asked to perform the file-level merge when a custom driver is
configured.
2016-03-17 11:02:26 -04:00
Patrick Steinhardt
0f1e2d2066 index: fix contradicting comparison
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.
2016-02-23 12:07:14 +01:00
Edward Thomson
82abd40d80 filter: clean up documentation around custom filters 2016-02-09 21:47:51 -08:00
Carlos Martín Nieto
7fafde6325 stream: allow registering a user-provided TLS constructor
This allows the application to use their own TLS stream, regardless of
the capabilities of libgit2 itself.
2015-11-03 08:10:29 -08:00
Leo Yang
bf28da4718 Fix build for custom transport users
We should explicitly include the declaration of git_strarray
from "include/git2/sys/transport.h"
2015-10-30 14:17:11 -04:00
Arthur Schreiber
d3b29fb94b refdb and odb backends must provide free function
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.
2015-10-01 00:50:37 +02:00
Matt Burke
4f2b6093a6 Tell the git_transport about the custom_headers 2015-09-08 14:02:33 -04:00
Carlos Martín Nieto
47ed7e5acd transport: provide a way to get the callbacks
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.
2015-08-19 02:23:18 +02:00
Carlos Martín Nieto
b166703964 config: implement basic transactional support
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.
2015-08-12 04:09:09 +02:00
Carlos Martín Nieto
c400bac4db Merge pull request #3332 from phatblat/ben/doc-warnings
Resolve documentation warnings
2015-08-01 15:38:04 +02:00
Ben Chatelain
08afd227df Fix remaining documentation warnings 2015-07-27 18:32:55 -06:00
Ben Chatelain
f90fbb8d22 Use correct Doxygen trailing comment syntax 2015-07-27 17:42:08 -06:00
Ben Chatelain
41808d0470 Fix @param names in doc comments 2015-07-27 14:46:50 -06:00
Carlos Martín Nieto
01d0c02dba refdb: delete a ref's reflog upon deletion
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.
2015-07-12 19:08:06 +02:00
Edward Thomson
63924435a1 filters: custom filters with wildcard attributes
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.
2015-07-01 09:40:11 -05:00
Carlos Martín Nieto
1376e784c6 stream: add support for setting a proxy
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).
2015-06-24 17:26:36 +02:00
Edward Thomson
a6f2ceaf48 Merge pull request #3118 from libgit2/cmn/stream-size
odb: make the writestream's size a git_off_t
2015-05-13 12:11:55 -04:00
Carlos Martín Nieto
058b753ceb remote: move the transport ctor to the callbacks
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.
2015-05-13 09:46:36 +02:00
Carlos Martín Nieto
8f0104ecc5 Remove the callbacks struct from the remote
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.
2015-05-13 09:46:35 +02:00
Carlos Martín Nieto
77b339f7b6 odb: make the writestream's size a git_off_t
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.
2015-05-13 09:34:20 +02:00
Leo Yang
142e5379ca Add a custom param to git_smart_subtransport_definition
The smart transport has already take the payload param. For the
sub transport a payload param is useful for the implementer.
2015-03-18 13:15:21 -04:00
Carlos Martín Nieto
9a97f49e3a config: borrow refcounted references
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.
2015-03-03 18:35:12 +01:00
Edward Thomson
795eaccd66 git_filter_opt_t -> git_filter_flag_t
For consistency with the rest of the library, where an opt is an
options *structure*.
2015-02-19 11:09:54 -05:00
Edward Thomson
b75f15aaf1 git_writestream: from git_filter_stream 2015-02-18 10:24:23 -05:00
Edward Thomson
fbdc9db364 filters: introduce streaming filters
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.
2015-02-17 02:19:05 -05:00
John Haley
a36486ef26 Fixed error when including git2/include/sys/stream.h 2015-02-11 23:30:34 +01:00
Edward Thomson
f483720c6f Merge pull request #2839 from swisspol/typo
Fixed typo in git_repository_reinit_filesystem() documentation
2015-01-26 11:25:16 -06:00
Pierre-Olivier Latour
86815dca20 Make sure sys/repository.h includes the required headers
It was missing "common.h" and "types.h" like other system headers.
This generated compilation errors if including it directly.
2015-01-23 16:04:23 -08:00
Pierre-Olivier Latour
22b6a92365 Fixed typo in git_repository_reinit_filesystem() documentation 2015-01-23 15:59:54 -08:00
Edward Thomson
85880693d5 Merge branch 'pr/2740' 2015-01-14 10:19:28 -06:00
Pierre-Olivier Latour
36fc549781 Added GIT_HASHSIG_ALLOW_SMALL_FILES to allow computing signatures for small 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.
2015-01-14 10:17:56 -06:00
David Calavera
d76e9df9a2 Include git2/common.h in sys/openssl.h. 2015-01-02 15:56:03 -08:00