| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.)
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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 workdir paths since it
will validate the length.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Ensure that we are validating working directory paths before we try to
write to them.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Introduce a function to determine the number of Unicode characters in a
given UTF-8 string.
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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).
|
|\ \ \ \
| |_|/ /
|/| | | |
src: fix typos in header files
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
repo: remove an inappropriate use of PASSTHROUGH
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \
| | | | |
| | | | | |
repo: specify init.defaultbranch is meant to be a branch name
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \
| | | | |
| | | | | |
tests: fix variable name in list.c
|
| |/ / / |
|
|\ \ \ \
| |/ / /
|/| | | |
Fix diff_entrycount -> diff_num_deltas doc typo
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This just fixes a typo in the documentation, actual rename change was
done in 5f69a31f
|
|\ \ \ \
| |_|_|/
|/| | |
| | | |
| | | | |
ianhattendorf/fix/repo-is-empty-empty-config-defaultbranch
Default to GIT_BRANCH_DEFAULT if init.defaultBranch is empty string
|
|/ / /
| | |
| | |
| | | |
We already do this in repo_init_head
|
|\ \ \
| |_|/
|/| | |
Remove duplicate line, in example code
|
|/ / |
|
|\ \
| | |
| | | |
tree: deprecate `git_treebuilder_write_with_buffer`
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
winhttp: skip certificate check if unable to send request
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
[skip ci]
|
|\ \ \ \
| | | | |
| | | | | |
commit-graph: Introduce `git_commit_graph_needs_refresh()`
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|\ \ \ \ \
| |/ / / /
| | | | | |
commit-graph: Support lookups of entries in a commit-graph
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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: Check insert_head_ids error in create_virtual_base
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
insert_head_ids can fail due to allocation error
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
Check git_signature_dup failure
|
| |/ / / /
| | | | |
| | | | |
| | | | | |
git_signature_dup can have an allocation failure
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix some typos
|
| |/ / / / |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
include: fix typos in comments
|
| | |_|/ /
| |/| | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Fix documentation formating on repository.h
|