| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Support git attrs from index (and bare repo)
|
| |
| |
| |
| |
| |
| |
| | |
There are three changes here:
- correctly propogate error code from failed object lookups
- make zlib inflate use our allocators
- add OID to notfound error in ODB lookups
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Depending on the operation, we need to consider gitattributes
in both the work dir and the index. This adds a parameter to
all of the gitattributes related functions that allows user
control of attribute reading behavior (i.e. prefer workdir,
prefer index, only use index).
This fix also covers allowing us to check attributes (and
hence do diff and status) on bare repositories.
This was a somewhat larger change that I hoped because it had
to change the cache key used for gitattributes files.
|
| | |
|
|\ \
| | |
| | | |
Honor core.notesRef config option
|
| | |
| | |
| | |
| | |
| | | |
Add git_note_default_ref to allow easy retrieval of the currently set
default notes reference.
|
| | |
| | |
| | |
| | |
| | | |
Setting core.notesRef allows to change the default notes reference used
by Git. Check if set before using GIT_NOTES_DEFAULT_REF. Fixes #649.
|
|/ / |
|
| | |
|
|/ |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
.travis.yml
include/git2/diff.h
src/config_file.c
src/diff.c
src/diff_output.c
src/mwindow.c
src/path.c
tests-clar/clar_helpers.c
tests-clar/object/tree/frompath.c
tests/t00-core.c
tests/t03-objwrite.c
tests/t08-tag.c
tests/t10-refs.c
tests/t12-repo.c
tests/t18-status.c
tests/test_helpers.c
tests/test_main.c
|
| |
| |
| |
| |
| |
| | |
Since strnlen is not supported on all platforms and since we
now have the shiny new git_text_is_binary in the filtering
code, let's convert diff binary detection to use the new stuff.
|
| |
| |
| |
| |
| |
| | |
To make this code more resilient to future changes, we'll
explicitly translate the libgit2 structure to the libxdiff
structure.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This should restore the ability to include libgit2 headers
in C++ projects.
Cherry picked 2de60205dfea2c4a422b2108a5e8605f97c2e895 from
development into new-error-handling.
|
| |\
| | |
| | |
| | |
| | | |
Conflicts:
src/refspec.c
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Currently, git_remote_disconnect not only closes the connection but also
frees the underlying transport object, making it impossible to write
code like
// fetch stuff
git_remote_download()
// close connection
git_remote_disconnect()
// call user provided callback for each ref
git_remote_update_tips(remote, callback)
because remote->refs points to references owned by the transport object.
This means, we have an idling connection while running the callback for
each reference.
Instead, allow immediate disconnect and free the transport later in
git_remote_free().
|
| |\ \
| | | |
| | | | |
Recognize and report server-side error messages
|
| | | |
| | | |
| | | |
| | | |
| | | | |
When e.g. a repository isn't found, the server sends an error saying
so. Put that error message in our error buffer.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
Update the callback to provide some information related to the file change being processed and the range of the hunk, when applicable.
|
| |/ /
| | |
| | |
| | | |
content
|
| | |
| | |
| | |
| | |
| | |
| | | |
The recent 64-bit Windows fixes changed the return code in
git_pkt_parse_line() so it wouldn't signal a short buffer, breaking
the network code. Bring it back.
|
| | | |
|
| | | |
|
| |/
| |
| |
| |
| |
| | |
We were not following the git behavior for leading slashes
in path names when matching git ignores and git attribute
file patterns. This should fix issue #638.
|
| | |
|
| |\
| | |
| | | |
Memory pools and khash hashtables
|
| | |
| | |
| | |
| | |
| | |
| | | |
This renamed `git_khash_str` to `git_strmap`, `git_hash_oid` to
`git_oidmap`, and deletes `git_hashtable` from the tree, plus
adds unit tests for `git_strmap`.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This updates khash.h with some extra features (like error checking
on allocations, ability to use wrapped malloc, foreach calls, etc),
creates two high-level wrappers around khash: `git_khash_str` and
`git_khash_oid` for string-to-void-ptr and oid-to-void-ptr tables,
then converts all of the old usage of `git_hashtable` over to use
these new hashtables.
For `git_khash_str`, I've tried to create a set of macros that
yield an API not too unlike the old `git_hashtable` API. Since
the oid hashtable is only used in one file, I haven't bother to
set up all those macros and just use the khash APIs directly for
now.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Adding a small stash of nodes with key conflicts has been
demonstrated to greatly increase the efficiency of a cuckoo
hashtable. See:
http://research.microsoft.com/pubs/73856/stash-full.9-30.pdf
for more details.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
This removes the custom paged allocator from revwalk and
replaces it with a `git_pool`.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This converts the git attr related code (including ignores) and
the git diff related code (and implicitly the status code) to use
`git_pools` for storing strings. This reduces the number of small
blocks allocated dramatically.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This adds a `git_pool` object that can do simple paged memory
allocation with free for the entire pool at once. Using this,
you can replace many small allocations with large blocks that
can then cheaply be doled out in small pieces. This is best
used when you plan to free the small blocks all at once - for
example, if they represent the parsed state from a file or data
stream that are either all kept or all discarded.
There are two real patterns of usage for `git_pools`: either
for "string" allocation, where the item size is a single byte
and you end up just packing the allocations in together, or for
"fixed size" allocation where you are allocating a large object
(e.g. a `git_oid`) and you generally just allocation single
objects that can be tightly packed. Of course, you can use it
for other things, but those two cases are the easiest.
|
| |\ \
| | |/
| |/| |
More Networking updates
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This allows the caller to update an internal structure or update the
user output with the tips that were updated.
While in the area, only try to update the ref if the value is
different from its old one.
|
| | |
| | |
| | |
| | |
| | | |
In the case that walk->one is NULL, we know that we have no positive
references, so we already know that the revwalk is over.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Trying to send every single line immediately won't give us any speed
improvement and duplicates the code we need for other transports. Make
the git transport use the same buffer functions as HTTP.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This changes the git_remote_download() API, but the existing one is
silly, so you don't get to complain.
The new API allows to know how much data has been downloaded, how many
objects we expect in total and how many we've processed.
|
| |/
| |
| |
| | |
This limitation was a misparsing of the documentation.
|
| |\
| | |
| | | |
Code clean up, including fixing warnings on Windows 64-bit build
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
This fixes all the warnings on win64 except those in deps, which
come from the regex code.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Adds a new public reference function `git_reference_lookup_oid`
that directly resolved a reference name to an OID without returning
the intermediate `git_reference` object (hence, no free needed).
Internally, this adds a `git_reference_lookup_resolved` function
that combines looking up and resolving a reference. This allows
us to be more efficient with memory reallocation.
The existing `git_reference_lookup` and `git_reference_resolve`
are reimplmented on top of the new utility and a few places in the
code are changed to use one of the two new functions.
|
| | |
| | |
| | |
| | | |
This removes the code for the old status implementation.
|