summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'mathworks/longpath_filter_bug' into mainEdward Thomson2021-09-201-3/+4
|\
| * If longpaths is true and filters are enabled, pass git_repository through ↵Laurence McGlashan2021-09-141-3/+4
| | | | | | | | | | | | the filtering code to ensure the cached longpath setting is returned. Fixes: #6054
* | Merge pull request #6058 from mathworks/proxy_config_with_detached_remoteEdward Thomson2021-09-201-4/+11
|\ \ | | | | | | Allow proxy options when connecting with a detached remote.
| * | Update remote.cLaurence McGlashan2021-09-181-1/+1
| | | | | | | | | Initialise cfg variable.
| * | Apply suggestions from code reviewLaurence McGlashan2021-09-181-7/+2
| | | | | | | | | Co-authored-by: Edward Thomson <ethomson@github.com>
| * | Allow proxy options when connecting with a detached remote.Laurence McGlashan2021-09-161-3/+15
| | |
* | | merge: Check file mode when resolving renames.Colin Stolley2021-09-151-2/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | When determining if ours or theirs changed, we check the oids but not their respective file modes. This can lead to merges introducing incorrect file mode changes (eg., in a revert). A simple linear example might be: commit A - introduces file `foo` with chmod 0755 commit B - updates some unrelated file commit C - renames `foo` to `bar` and chmod 0644 If B is reverted, `bar` will unexpectedly acquire mode 0755.
* | Merge pull request #6053 from stac47/ssh2_discoveryEdward Thomson2021-09-141-0/+7
|\ \ | | | | | | Discover libssh2 without pkg-config
| * | Update src/CMakeLists.txtLaurent Stacul2021-09-141-7/+7
| | | | | | | | | Co-authored-by: Edward Thomson <ethomson@github.com>
| * | Discover libssh2 without pkg-configLaurent Stacul2021-09-141-0/+7
| |/
* | Merge pull request #6041 from Esri/duncan/typeofEdward Thomson2021-09-142-8/+2
|\ \ | | | | | | Use __typeof__ GNUC keyword for ISO C compatibility
| * | Use __typeof__ GNUC keyword for ISO C compatibilityDuncan Thomson2021-09-082-8/+2
| |/
* | Merge pull request #6039 from lhchavez/avoid-mmap-in-git-indexer-appendEdward Thomson2021-09-141-3/+37
|\ \ | | | | | | indexer: Avoid one `mmap(2)`/`munmap(2)` pair per `git_indexer_append` call
| * | Avoid double negatives in the justification for truncationlhchavez2021-09-081-2/+5
| | | | | | | | | | | | | | | Turns out, double negatives are harder to parse than positive statements.
| * | Only avoid `mmap(2)`/`ftruncate(2)` when in non-Windowslhchavez2021-09-081-2/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
| * | Also remove a `ftruncate(2)` call in `git_indexer_commit`lhchavez2021-09-071-6/+0
| | | | | | | | | | | | | | | | | | 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~!
| * | indexer: Avoid one `mmap(2)`/`munmap(2)` pair per `git_indexer_append` calllhchavez2021-09-071-47/+2
| |/ | | | | | | | | | | | | | | | | 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).
* | Merge pull request #6031 from libgit2/ethomson/extensionsEdward Thomson2021-09-143-3/+139
|\ \ | | | | | | Support custom git extensions
| * | common: support custom repository extensionsethomson/extensionsEdward Thomson2021-09-043-3/+139
| |/ | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #6045 from punkymaniac/qa-fix-coding-style-pointerEdward Thomson2021-09-1429-64/+64
|\ \ | | | | | | Fix coding style for pointer
| * | Fix coding style for pointerpunkymaniac2021-09-0929-64/+64
| |/ | | | | | | Make some syntax change to follow coding style.
* | Merge pull request #6043 from basile-henry/config-multiline-comment-charsEdward Thomson2021-09-141-1/+1
|\ \ | | | | | | Fix config parsing for multiline with multiple quoted comment chars
| * | Fix multiline strip_comments logicBasile Henry2021-09-091-1/+1
| |/ | | | | | | | | | | | | | | | | 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).
* | notes: use a buffer internallyethomson/notes_cleanupEdward Thomson2021-09-101-28/+28
|/ | | | Code cleanup to use `git_buf`s instead of simple c strings.
* #6028: Check if `threadstate->error_t.message` is not `git_buf__initbuf` ↵Miguel Arroz2021-09-021-1/+2
| | | | | | 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.
* url: ensure minimum components for formattingv1.2.0maint/v1.2Edward Thomson2021-09-011-2/+3
|
* url: ensure minimum components for formattingEdward Thomson2021-09-011-0/+3
|
* remote: refactor proxy detectionEdward Thomson2021-09-014-120/+99
| | | | | | | | | | 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.
* url: introduce `git_net_url_dup`Edward Thomson2021-09-012-0/+43
|
* url: introduce `git_net_url_matches_pattern_list`Edward Thomson2021-09-012-0/+22
| | | | | | 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.
* url: introduce `git_net_url_matches_pattern`Edward Thomson2021-09-012-0/+60
| | | | | Provide a method to determine if a given URL matches a host:port pattern like the ones found in `NO_PROXY` environment variables.
* util: introduce `git__strlcmp`Edward Thomson2021-09-011-0/+11
| | | | | | | 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).
* Add NO_PROXY env supportMathieu Parent2021-09-014-9/+94
| | | | | | Item 2 of 3 from #4164 Signed-off-by: Mathieu Parent <math.parent@gmail.com>
* Fix a possible null pointer dereferencelhchavez2021-08-311-1/+2
| | | | | | | | 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
* Merge pull request #5943 from kcsaul/fix/5851Edward Thomson2021-08-301-0/+6
|\ | | | | Fix worktree iteration when repository has no common directory
| * repo: fix worktree iteration when repo has no common directoryKevin Saul2021-07-111-0/+6
| | | | | | | | | | | | | | | | | | | | 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).
* | Merge pull request #6022 from lollipopman/connect-proxy-host-headerEdward Thomson2021-08-301-1/+1
|\ \ | | | | | | Set Host Header to match CONNECT authority target
| * | Set Host Header to match CONNECT authority targetJesse Hathaway2021-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'cgraph-write' into mainEdward Thomson2021-08-302-3/+677
|\ \ \
| * | | commit graph: formatting fixesEdward Thomson2021-08-301-20/+19
| | | |
| * | | Merge remote-tracking branch 'origin/main' into cgraph-writelhchavez2021-08-2920-125/+778
| |\ \ \
| * | | | Fixups for the latest changes in the array interfacelhchavez2021-08-261-11/+21
| | | | |
| * | | | Merge remote-tracking branch 'origin/main' into cgraph-writelhchavez2021-08-2644-448/+1538
| |\ \ \ \
| * | | | | Make the defaultable fields defaultablelhchavez2021-08-261-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | Also, add `git_commit_graph_writer_options_init`!
| * | | | | Review feedbacklhchavez2021-08-011-37/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added the `PenaltyBreakAssignment: 1000` clang-format option to avoid breaking statements around the assignment operator. * Avoided using the dot initializer syntax. * Avoided casting allocations. * Also avoided casting `void *`.
| * | | | | commit-graph: Add a way to write commit-graph fileslhchavez2021-07-272-1/+660
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds the git_commit_graph_writer_* functions to allow to write and create `commit-graph` files from `.idx`/`.pack` files or `git_revwalk`s. Part of: #5757
* | | | | | date: promote before multiplyethomson/fixupsEdward Thomson2021-08-301-1/+1
| | | | | |
* | | | | | filter: don't overwrite error valueEdward Thomson2021-08-301-1/+2
| | | | | |
* | | | | | hashsig: close fd on errorEdward Thomson2021-08-301-1/+3
| | | | | |
* | | | | | error: don't check string after assertEdward Thomson2021-08-301-5/+0
| | | | | |