summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | iterator: validate workdir pathsEdward Thomson2021-04-281-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Supply the repository for the filesystem and workdir iterators - for workdir iterators, this is non-null and we can lookup the core.longpaths configuration option. (For regular filesystem iterators, this is NULL, so core.longpaths does not apply.)
| * | | | ignore: validate workdir paths for ignore filesEdward Thomson2021-04-281-7/+10
| | | | |
| * | | | attr: validate workdir paths for attribute filesEdward Thomson2021-04-287-16/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should allow attribute files - inside working directories - to have names longer than MAX_PATH when core.longpaths is set. `git_attr_path__init` takes a repository to validate the path with.
| * | | | repository: validate workdir path lengthsEdward Thomson2021-04-281-3/+3
| | | | |
| * | | | workdir: validate working directory entry path lengthEdward Thomson2021-04-281-1/+3
| | | | |
| * | | | diff: use git_repository_workdir_pathEdward Thomson2021-04-283-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new git_repository_workdir_path function does error checking on working directory inputs on Windows; use it to construct paths within working directories.
| * | | | use git_repository_workdir_path to generate pathsEdward Thomson2021-04-284-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Use `git_repository_workdir_path` to generate workdir paths since it will validate the length.
| * | | | checkout: validate path lengthEdward Thomson2021-04-281-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | Ensure that we are validating working directory paths before we try to write to them.
| * | | | checkout: use target path; don't assume workdirEdward Thomson2021-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're not necessarily checking out into the working directory. We could be checking out into an arbitrary location. Ensure that when we are writing conflict data that we do it in the checkout target.
| * | | | repo: introduce git_repository_workdir_pathEdward Thomson2021-04-283-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a simple accessor for workdir paths to get an absolute on-disk path given a repository and a relative path within it. This is useful to avoid copy-pasta `git_buf_joinpath` and to ensure that we validate working directory paths while honoring `core.longpaths` settings.
| * | | | apply: ensure we validate pathsEdward Thomson2021-04-283-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | There was no test ensuring that we validate `.git` paths. We do, but let's add a test to make sure that we never regress this.
| * | | | path: introduce ondisk and workdir path validationEdward Thomson2021-04-285-0/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce `git_path_validate_filesystem` which validates (absolute) on-disk paths and `git_path_validate_workdir` to perform validations on (absolute) working directory paths. These functions are useful as there may be system limitations on on-disk paths, particularly on Windows (for example, enforcing MAX_PATH). For working directory paths, these limitations may be per-repository, based on the `core.longpaths` configuration setting.
| * | | | path: git_path_isvalid -> git_path_validateEdward Thomson2021-04-149-214/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we want to validate more and different types of paths, the name `git_path_validate` makes that easier and more expressive. We can add, for example, `git_path_validate_foo` while the current name makes that less ergonomic.
| * | | | docs: document core.longpaths supportEdward Thomson2021-04-141-0/+36
| | | | |
| * | | | utf8: introduce git_utf8_char_lengthEdward Thomson2021-04-143-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | Introduce a function to determine the number of Unicode characters in a given UTF-8 string.
| * | | | utf8: refactor utf8 functionsEdward Thomson2021-04-147-143/+169
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Move the utf8 functions into a proper namespace `git_utf8` instead of being in the namespaceless `git__` function group. Update them to have out-params first and use `char *` instead of `uint8_t *` to match our API treating strings as `char *` (even if they truly contain `uchar`s inside).
* | | | Merge pull request #5843 from tniessen/src-fix-typos-in-headersEdward Thomson2021-04-202-2/+2
|\ \ \ \ | |_|/ / |/| | | src: fix typos in header files
| * | | src: fix typos in header filesTobias Nießen2021-04-182-2/+2
|/ / /
* | | Merge pull request #5834 from libgit2/cmn/repo-no-passthroughEdward Thomson2021-04-131-11/+9
|\ \ \ | | | | | | | | repo: remove an inappropriate use of PASSTHROUGH
| * | | repo: remove an inappropriate use of PASSTHROUGHcmn/repo-no-passthroughCarlos Martín Nieto2021-04-111-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This error code is for callbacks where we should act as though the callback was not set. This is not something that makes sense for a `_foreach` and checking for that error message to bubble up mostly is happenstance precisely because this is not an error code we expect in the callback. As part of removing this, let's also remove a use of foreach as we can open-code this check.
* | | | Merge pull request #5835 from libgit2/cmn/branch-or-refEdward Thomson2021-04-131-1/+1
|\ \ \ \ | | | | | | | | | | repo: specify init.defaultbranch is meant to be a branch name
| * | | | repo: specify init.defaultbranch is meant to be a branch namecmn/branch-or-refCarlos Martín Nieto2021-04-111-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | We don't want the default branch's refname here but its name as branch. Returning an error saying it's not a valid reference here suggests we want the value of `init.defaultbranch` to be something like `refs/heads/default` which is not the case.
* | | | Merge pull request #5836 from tniessen/tests-var-name-list-cEdward Thomson2021-04-131-3/+3
|\ \ \ \ | | | | | | | | | | tests: fix variable name in list.c
| * | | | tests: fix variable name in list.cTobias Nießen2021-04-111-3/+3
| |/ / /
* | | | Merge pull request #5838 from mjsir911/msirabella/entrycount_typo_fixEdward Thomson2021-04-131-1/+1
|\ \ \ \ | |/ / / |/| | | Fix diff_entrycount -> diff_num_deltas doc typo
| * | | Fix diff_entrycount -> diff_num_deltas doc typoMarco Sirabella2021-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | This just fixes a typo in the documentation, actual rename change was done in 5f69a31f
* | | | Merge pull request #5832 from ↵Edward Thomson2021-04-022-2/+16
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | ianhattendorf/fix/repo-is-empty-empty-config-defaultbranch Default to GIT_BRANCH_DEFAULT if init.defaultBranch is empty string
| * | | Default to GIT_BRANCH_DEFAULT if init.defaultBranch is empty stringIan Hattendorf2021-04-012-2/+16
|/ / / | | | | | | | | | We already do this in repo_init_head
* | | Merge pull request #5821 from punkymaniac/example-duplicate-lineEdward Thomson2021-03-201-5/+0
|\ \ \ | |_|/ |/| | Remove duplicate line, in example code
| * | Remove duplicate line, in example codepunkymaniac2021-03-171-5/+0
|/ /
* | Merge pull request #5815 from libgit2/ethomson/treebuilder_writeEdward Thomson2021-03-105-70/+99
|\ \ | | | | | | tree: deprecate `git_treebuilder_write_with_buffer`
| * | ci: enable UBSan stacktracesethomson/treebuilder_writeEdward Thomson2021-03-041-0/+4
| | |
| * | tree: deprecate `git_treebuilder_write_with_buffer`Edward Thomson2021-03-044-70/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | The function `git_treebuilder_write_with_buffer` is unnecessary; it is used internally as part of treebuilder writing, but it has little use to external callers. For callers that repeatedly write a treebuilder, we can supply them with a buffer in the treebuilder struct instead of recreating it. For ourselves, when we want a single buffer in our write loop, we can use an internal function.
* | | Merge pull request #5814 from ianhattendorf/fix/winhttp-proxy-httpsEdward Thomson2021-03-102-27/+67
|\ \ \ | | | | | | | | winhttp: skip certificate check if unable to send request
| * | | winhttp: skip certificate check if unable to send requestIan Hattendorf2021-03-011-27/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some circumstances (e.g. when proxies are involved), winhttp will fail to reach the WINHTTP_CALLBACK_STATUS_SENDING_REQUEST phase. If this occurs, we'll error with ERROR_WINHTTP_INCORRECT_HANDLE_STATE when attempting to query the server certificate context (see https://docs.microsoft.com/en-us/windows/win32/api/winhttp/nf-winhttp-winhttpsendrequest#remarks). To avoid this, verify that WinHttpSendRequest has reached the WINHTTP_CALLBACK_STATUS_SENDING_REQUEST phase before checking the certificate. Since we're using WinHTTP in synchronous mode, we know for sure that once WinHttpSendRequest returns we've either sent it successfully or not. NOTE: WINHTTP_CALLBACK_STATUS_SENDING_REQUEST appears to be deprecated with no direct replacement. WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE is only available in async mode, and there doesn't appear to be a method of querying this flag outside of the status callback.
| * | | winhttp: test proxy https cloneIan Hattendorf2021-03-011-0/+22
| | | |
* | | | README: it's actually our main branchEdward Thomson2021-03-041-3/+3
| | | | | | | | | | | | | | | | [skip ci]
* | | | Merge pull request #5764 from lhchavez/cgraph-needs-refreshEdward Thomson2021-03-043-0/+43
|\ \ \ \ | | | | | | | | | | commit-graph: Introduce `git_commit_graph_needs_refresh()`
| * | | | commit-graph: Introduce `git_commit_graph_needs_refresh()`lhchavez2021-01-103-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a function that allows the caller to know whether the `commit-graph` file has not been modified since it was parsed. Part of: #5757
* | | | | Merge pull request #5763 from lhchavez/cgraph-lookupEdward Thomson2021-03-045-0/+252
|\ \ \ \ \ | |/ / / / | | | | | commit-graph: Support lookups of entries in a commit-graph
| * | | | commit-graph: Support lookups of entries in a commit-graphlhchavez2021-01-105-0/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces `git_commit_graph_entry_find()` and `git_commit_graph_entry_parent()`. These two functions allow a much faster lookup of commits by ID, since the ODB does not need to be consulted, the commit object does not need to be inflated, and the contents of the commit object do not need to be parsed. Part of: #5757
* | | | | Merge pull request #5818 from mamapanda/patch-3Edward Thomson2021-03-041-2/+5
|\ \ \ \ \ | | | | | | | | | | | | merge: Check insert_head_ids error in create_virtual_base
| * | | | | merge: Check insert_head_ids error in create_virtual_basepanda2021-03-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | insert_head_ids can fail due to allocation error
* | | | | | Merge pull request #5817 from mamapanda/patch-2Edward Thomson2021-03-041-10/+15
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | Check git_signature_dup failure
| * | | | | Check git_signature_dup failurepanda2021-03-031-10/+15
| |/ / / / | | | | | | | | | | | | | | | git_signature_dup can have an allocation failure
* | | | | Merge pull request #5797 from aaronfranke/typosEdward Thomson2021-02-288-11/+11
|\ \ \ \ \ | | | | | | | | | | | | Fix some typos
| * | | | | Fix some typosAaron Franke2021-02-158-11/+11
| |/ / / /
* | | | | Merge pull request #5805 from tniessen/include-typosEdward Thomson2021-02-284-6/+6
|\ \ \ \ \ | | | | | | | | | | | | include: fix typos in comments
| * | | | | include: fix typos in commentsTobias Nießen2021-02-224-6/+6
| | |_|/ / | |/| | |
* | | | | Merge pull request #5806 from punkymaniac/comment-formatEdward Thomson2021-02-281-52/+95
|\ \ \ \ \ | |/ / / / |/| | | | Fix documentation formating on repository.h