| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
`git_diff_format_email` is deprecated in favor of `git_email_create`.
|
|
|
|
|
| |
`git format-patch` includes diffs with rename detection enabled by
default when creating emails. Match this behavior.
|
|
|
|
|
| |
`git format-patch` includes binary diffs by default when creating
emails. Match this behavior.
|
| |
|
|
|
|
|
| |
Introduce `git_email__append_from_diff` so that we don't always
overwrite the input buffer.
|
|
|
|
| |
Move the `git_diff_commit_as_email` function to use `email_create`.
|
|
|
|
|
| |
Allow a `0` patch index and `0` patch count; in this case, simply don't
display these in the email.
|
|
|
|
|
|
|
|
|
| |
Introduce a function to create an email from a diff and multiple inputs
about the source of the diff.
Creating an email from a diff requires many more inputs, and should be
discouraged in favor of building directly from a commit, and is thus in
the `sys` namespace.
|
|
|
|
|
|
| |
Create `git_email_*` which will encapsulate email creation and
application, and `git_email_create_from_commit` in particular, which
creates an email for a single commit.
|
| |
|
|\
| |
| | |
Use __typeof__ GNUC keyword for ISO C compatibility
|
| | |
|
|\ \
| | |
| | | |
indexer: Avoid one `mmap(2)`/`munmap(2)` pair per `git_indexer_append` call
|
| | |
| | |
| | |
| | |
| | | |
Turns out, double negatives are harder to parse than positive
statements.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It turns out that if we use `mmap(2)`, non-Windows remote filesystems
break due to permissions. If we don't, _Windows_ remote filesystems
break due to lack of coherence between memory mapped views of the file
and direct I/O operations done to the files.
To break out of this impossible situation, conditionally-compile
versions of Windows-specific `write_at` and `append_to_pack`.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Now that we're not using `mmap(2)` for writing stuff, we don't need to
truncate the file afterwards, since it'll have the correct size at the
end of the process. Whee~!
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This change makes `append_to_pack` completely rely on `p_pwrite` to do
all its I/O instead of splitting it between `p_pwrite` and a
`mmap(2)`/`munmap(2)`+`memcpy(3)`. This saves a good chunk of user CPU
time and avoids making two syscalls per round, but doesn't really cut
down a lot of wall time (~1% on cloning the
[git](https://github.com/git/git.git) repository).
|
|\ \ \
| | | |
| | | | |
Support custom git extensions
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Allow users to specify additional repository extensions that they want
to support. For example, callers can specify that they support
`preciousObjects` and then may open repositories that support
`extensions.preciousObjects`.
Similarly, callers may opt out of supporting extensions that the library
itself supports.
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Fix coding style for pointer
|
| | |_|/
| |/| |
| | | |
| | | | |
Make some syntax change to follow coding style.
|
|\ \ \ \
| | | | |
| | | | | |
Fix config parsing for multiline with multiple quoted comment chars
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The strip_comments function uses the count of quotes to know if a
comment char (';' or '#') is the start of a comment or part of the
multiline as a string.
Unfortunately converting the count of quotes from previous lines to a
boolean meant that it would only work as expected in some cases
(0 quotes or an odd number of quotes).
|
| |/ / /
| | | |
| | | |
| | | |
| | | | |
This tests parsing a multiline string containing multiple quoted comment
chars. See #6019
|
|\ \ \ \
| |/ / /
|/| | | |
notes: use a buffer internally
|
|/ / /
| | |
| | |
| | | |
Code cleanup to use `git_buf`s instead of simple c strings.
|
| |/
|/| |
|
|\ \
| |/
|/| |
|
|/
|
|
|
|
|
| |
This change makes `git_remote_name_is_valid` be part of the public
interface of the library. This is needed for other language bindings to
be able to find this symbol (like in git2go, when linking against
libgit2 dynamically).
|
|\
| |
| | |
#6028: Check if `threadstate->error_t.message` is not `git_buf__initbuf` before freeing.
|
|/
|
|
|
|
| |
before freeing.
This follows the same principle as `buffer.c` where the same check is done before freeing the buffer. It fixes the crash described in #6028.
|
| |
|
| |
|
|\
| |
| | |
Update proxy configuration
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Update the proxy detection for a remote.
1. Honor `http.<url>.proxy` syntax for a remote's direct URL and
parent URLs.
2. Honor an empty configuration URL to override a proxy configuration.
Add tests to ensure that configuration specificity is honored.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Provide a utility method on a url to determine if it matches any pattern
in a comma-separated list, similar to what one would find in `NO_PROXY`
environment variables.
|
| |
| |
| |
| |
| | |
Provide a method to determine if a given URL matches a host:port pattern
like the ones found in `NO_PROXY` environment variables.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Introduce a utility function that compares a NUL terminated string to a
possibly not-NUL terminated string with length. This is similar to
`strncmp` but with an added check to ensure that the lengths match (not
just the `size` portion of the two strings).
|
|/
|
|
|
|
| |
Item 2 of 3 from #4164
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
|
|\
| |
| | |
Fix a possible null pointer dereference
|
|/
|
|
|
|
|
|
| |
This change fixes a possible null pointer dereference if anything inside
`git_commit_graph_writer_add_index_file` fails before the packfile being
valid.
https://scan6.coverity.com/reports.htm#v52218/p10377/fileInstanceId=122935896&defectInstanceId=32525576&mergedDefectId=1461634
|
| |
|
| |
|
|\
| |
| | |
Fix worktree iteration when repository has no common directory
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When applying an operation to a repository created without a common directory,
which is known to occur in scenarios where custom odb/refdb backends are used,
git_repository_foreach_worktree currently asserts while attempting to open the
repository located in the common directory.
Fix this issue by applying operation to repository supplied when there are no
linked worktrees to iterate (implied by common directory being empty).
|
|\ \
| | |
| | | |
Set Host Header to match CONNECT authority target
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Prior to this change, for CONNECT requests, the Host header was set to
the host and port of the target http proxy. However, per the rfc7230 for
HTTP/1.1 this is incorrect as the Host header should match the target of
the CONNECT request, as detailed in section 5.3.3 & 5.4.
5.3.3. authority-form
The authority-form of request-target is only used for CONNECT
requests (Section 4.3.6 of [RFC7231]).
authority-form = authority
When making a CONNECT request to establish a tunnel through one or
more proxies, a client MUST send only the target URI's authority
component (excluding any userinfo and its "@" delimiter) as the
request-target. For example,
CONNECT www.example.com:80 HTTP/1.1
5.4. Host
<snip>
A client MUST send a Host header field in all HTTP/1.1 request
messages. If the target URI includes an authority component, then a
client MUST send a field-value for Host that is identical to that
authority component, excluding any userinfo subcomponent and its "@"
delimiter (Section 2.7.1). If the authority component is missing or
undefined for the target URI, then a client MUST send a Host header
field with an empty field-value.
This issue was noticed when proxying requests through HAProxy 2.2 which
rejects these invalid http requests.
|