Log

Author Commit Date CI Message
Edward Thomson b31795ef 2021-05-06T01:46:19 test: clean up memory leaks
Edward Thomson 525516b4 2021-05-04T12:42:27 Merge pull request #5855 from libgit2/ethomson/ci ci: use GitHub for storing mingw-w64 build dependency
Edward Thomson 7ad81a42 2021-05-04T12:23:17 ci: use GitHub for storing mingw-w64 build dependency
Edward Thomson c44f5688 2021-05-02T10:27:56 Merge pull request #5823 from libgit2/ethomson/path_validation Working directory path validation
Edward Thomson 1016ad4f 2021-04-15T01:31:12 path: don't join paths in git_path_find_dir Let `git_path_find_dir` simply take a `git_buf` that contains a directory or a file, instead of trying to both join a path AND then deal with prettifying it or its basename. This allows consumers to join paths themselves (and apply any necessary rules - like fitting within MAX_PATH).
Edward Thomson 91156a0f 2021-04-04T10:44:29 diff: use git_repository_workdir_path The new git_repository_workdir_path function does error checking on working directory inputs on Windows; use it to construct paths within working directories.
Edward Thomson 578aeba9 2021-03-20T17:00:33 use git_repository_workdir_path to generate paths Use `git_repository_workdir_path` to generate workdir paths since it will validate the length.
Edward Thomson 717df1a4 2021-04-15T01:23:07 worktree: validate worktree paths Worktree paths need to fix within MAX_PATH always, regardless of `core.longpaths` setting.
Edward Thomson 99ddfd5c 2021-03-20T16:54:09 checkout: validate path length Ensure that we are validating working directory paths before we try to write to them.
Edward Thomson 6b878db5 2021-03-20T16:44:08 checkout: use target path; don't assume workdir 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.
Edward Thomson c15ed350 2021-04-26T12:23:25 repo: validate repository paths Ensure that a repository's path (at initialization or open time) is valid. On Windows systems, this means that the longest known path beneath the repository will fit within MAX_PATH: this is a lock file for a loose object within the repository itself. Other paths, like a very long loose reference, may fail to be opened after the repository is opened. These variable length paths will be checked when they are accessed themselves. This new functionality is done at open to prevent needlessly checking every file in the gitdir (eg, `MERGE_HEAD`) for its length when we could instead check once at repository open time.
Edward Thomson f3bcadd2 2021-04-05T10:57:49 submodule: validate path lengths Validate that working directory paths honor `core.longpaths` where appropriate. Paths to the submodule gitdirs must always honor the operating system length restrictions; `core.longpaths` does not affect gitdir paths.
Edward Thomson b457fe27 2021-04-04T22:18:55 iterator: validate workdir paths 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.)
Edward Thomson 3589587d 2021-04-24T13:11:25 repo: factor the commondir detection
Edward Thomson 289aaa41 2021-04-04T20:46:40 ignore: validate workdir paths for ignore files
Edward Thomson 9fb755d5 2021-04-04T19:59:57 attr: validate workdir paths for attribute files 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.
Edward Thomson e5851c62 2021-04-24T09:44:45 refs: ensure loose refs adhere to path validation On Windows, we need to enforce MAX_PATH for loose references and their reflogs. Ensure that any path - including the lock file - would fit within the 260 character maximum. We do not honor core.longpaths for loose reference files or reflogs. core.longpaths only applies to paths in the working directory.
Edward Thomson e52c2989 2021-04-04T19:46:08 repository: validate workdir path lengths
Edward Thomson 4470e48a 2021-04-04T14:24:35 workdir: validate working directory entry path length
Edward Thomson 50e01216 2021-03-20T16:39:29 repo: introduce git_repository_workdir_path 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.
Edward Thomson dbc03de4 2021-03-20T14:28:25 apply: ensure we validate paths 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.
Edward Thomson dc1ba018 2021-03-20T13:01:00 path: introduce ondisk and workdir path validation 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.
Edward Thomson cabfa3b3 2021-04-20T09:12:58 Merge pull request #5843 from tniessen/src-fix-typos-in-headers src: fix typos in header files
Tobias Nießen 3fa8ec52 2021-04-18T20:30:13 src: fix typos in header files
Edward Thomson 88323cd0 2021-03-20T09:52:17 path: git_path_isvalid -> git_path_validate 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.
Edward Thomson 78abfb17 2021-04-05T10:59:02 docs: document core.longpaths support
Edward Thomson cb136cdd 2021-04-14T22:22:11 utf8: introduce git_utf8_char_length Introduce a function to determine the number of Unicode characters in a given UTF-8 string.
Edward Thomson 1d95b59b 2021-04-14T15:47:27 utf8: refactor utf8 functions 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).
Edward Thomson ac77d306 2021-04-13T17:00:37 Merge pull request #5834 from libgit2/cmn/repo-no-passthrough repo: remove an inappropriate use of PASSTHROUGH
Edward Thomson d05eda87 2021-04-13T11:48:27 Merge pull request #5835 from libgit2/cmn/branch-or-ref repo: specify init.defaultbranch is meant to be a branch name
Edward Thomson a1e5e268 2021-04-13T11:47:52 Merge pull request #5836 from tniessen/tests-var-name-list-c tests: fix variable name in list.c
Edward Thomson 9f295e21 2021-04-13T11:47:01 Merge pull request #5838 from mjsir911/msirabella/entrycount_typo_fix Fix diff_entrycount -> diff_num_deltas doc typo
Marco Sirabella 96585597 2021-04-12T23:52:03 Fix diff_entrycount -> diff_num_deltas doc typo This just fixes a typo in the documentation, actual rename change was done in 5f69a31f
Tobias Nießen 52447c5c 2021-04-11T23:16:37 tests: fix variable name in list.c
Carlos Martín Nieto 631fe56f 2021-04-11T21:22:33 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.
Carlos Martín Nieto 6591deef 2021-04-11T14:27:14 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.
Edward Thomson 34b9a04c 2021-04-02T10:31:55 Merge pull request #5832 from ianhattendorf/fix/repo-is-empty-empty-config-defaultbranch Default to GIT_BRANCH_DEFAULT if init.defaultBranch is empty string
Ian Hattendorf 7891e153 2021-04-01T11:34:38 Default to GIT_BRANCH_DEFAULT if init.defaultBranch is empty string We already do this in repo_init_head
Edward Thomson 50836140 2021-03-20T10:10:05 Merge pull request #5821 from punkymaniac/example-duplicate-line Remove duplicate line, in example code
punkymaniac 8f52b0c5 2021-03-17T10:48:17 Remove duplicate line, in example code
Edward Thomson 4f4b1139 2021-03-10T11:21:39 Merge pull request #5815 from libgit2/ethomson/treebuilder_write tree: deprecate `git_treebuilder_write_with_buffer`
Edward Thomson a0fca809 2021-03-10T11:19:14 Merge pull request #5814 from ianhattendorf/fix/winhttp-proxy-https winhttp: skip certificate check if unable to send request
Edward Thomson 752dbecf 2021-03-04T09:45:12 README: it's actually our main branch [skip ci]
Edward Thomson d7e65096 2021-03-04T09:44:26 Merge pull request #5764 from lhchavez/cgraph-needs-refresh commit-graph: Introduce `git_commit_graph_needs_refresh()`
Edward Thomson b99b5a81 2021-03-04T09:38:10 Merge pull request #5763 from lhchavez/cgraph-lookup commit-graph: Support lookups of entries in a commit-graph
Edward Thomson 85af7f21 2021-03-04T09:15:37 ci: enable UBSan stacktraces
Edward Thomson 7eb21516 2021-02-28T00:20:28 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.
Edward Thomson b33e018c 2021-03-04T09:20:34 Merge pull request #5818 from mamapanda/patch-3 merge: Check insert_head_ids error in create_virtual_base
Edward Thomson 80bdeca4 2021-03-04T09:18:30 Merge pull request #5817 from mamapanda/patch-2 Check git_signature_dup failure
panda dc1095a5 2021-03-03T14:42:12 merge: Check insert_head_ids error in create_virtual_base insert_head_ids can fail due to allocation error
panda b9bfe812 2021-03-03T14:03:06 Check git_signature_dup failure git_signature_dup can have an allocation failure
Ian Hattendorf edffea15 2021-03-01T16:26:58 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.
Ian Hattendorf 592a3252 2021-03-01T11:00:37 winhttp: test proxy https clone
Edward Thomson 1bc8dec4 2021-02-28T11:02:23 Merge pull request #5797 from aaronfranke/typos Fix some typos
Edward Thomson 922d73c6 2021-02-28T10:59:10 Merge pull request #5805 from tniessen/include-typos include: fix typos in comments
Edward Thomson dcecc0b5 2021-02-28T10:58:34 Merge pull request #5806 from punkymaniac/comment-format Fix documentation formating on repository.h
Tobias Nießen 25efbc4b 2021-02-22T22:57:16 include: fix typos in comments
punkymaniac 3bb5f297 2021-02-22T14:58:46 Fix documentation formating on repository.h The enum 'git_repository_init_flag_t', 'git_repository_init_mode_t' and the structure 'git_repository_init_options' does not follow the format used by docurium.
Edward Thomson 0fb58396 2021-02-21T20:43:51 Merge pull request #5801 from mamapanda/patch-1 index: Check git_vector_dup error in write_entries
panda 40930508 2021-02-18T16:36:42 index: Initialize case_sorted to GIT_VECTOR_INIT This is for extra safety within write_entries
Edward Thomson 6e57010b 2021-02-18T04:57:25 Merge pull request #5800 from mamapanda/check-sortedcache-lock
panda 21981f28 2021-02-16T13:43:09 index: Check git_vector_dup error in write_entries If allocating case_sorted.contents fails, git_vector_sort will segfault.
panda 36232528 2021-02-16T13:08:02 refdb_fs: Check git_sortedcache wlock/rlock errors To prevent a race condition, these wlock/rlock calls should probably be checked for errors.
Aaron Franke 7efddeb7 2021-02-15T15:47:28 Fix some typos
Edward Thomson 935f8513 2021-02-15T16:03:23 CI: add workflow_dispatch event to the main build Invert the workflow conditionals so that a workflow_dispatch event acts like an on: push build.
Edward Thomson a4218a07 2021-02-11T17:58:04 Merge pull request #5795 from jeroen/patch-1 Add new bindings for the R language
Jeroen Ooms 82a091c4 2021-02-11T15:19:09 Add new bindings for the R language
Edward Thomson 523d5e0f 2021-02-01T11:50:44 Merge pull request #5787 from lrm29/patch-1 Update .gitignore
Edward Thomson 02eb1711 2021-02-01T10:07:00 Merge pull request #5731 from KOLANICH-libs/owner_accessor patch: add owner accessor
Edward Thomson 2ad15250 2021-02-01T09:58:25 Merge pull request #5762 from lhchavez/cgraph-parser commit-graph: Introduce a parser for commit-graph files
Edward Thomson 0a710091 2021-02-01T09:41:42 Merge pull request #5786 from libgit2/ethomson/revparse revspec: rename git_revparse_mode_t to git_revspec_t
Edward Thomson 41ccbc04 2021-02-01T09:41:16 Merge pull request #5783 from lhchavez/mwindow-coverity mwindow: Fix a bug in the LRU window finding code
Edward Thomson 4732e030 2021-01-31T00:36:54 revspec: rename git_revparse_mode_t to git_revspec_t The information about the type of a revision spec is not information about the parser. Name it accordingly, so that `git_revparse_mode_t` is now `git_revspec_t`. Deprecate the old name.
Laurence McGlashan e4489077 2021-01-31T15:35:56 Update .gitignore Only exclude tags files/folders and build folders at the repository root.
Edward Thomson 50f53622 2021-01-22T11:22:53 meta: tell "linguist" that the test resources are vendored Our test resources shouldn't count toward our language statistics. We have some PHP checked in to the test resources, but I assure you that we do not have any production code in PHP and we shouldn't be blamed for the test data.
lhchavez 2f382ab7 2021-01-20T04:40:40 mwindow: Fix a bug in the LRU window finding code This change now updates the `lru_window` variable to match the current file's MRU window. This makes it such that it doesn't always choose the file that happened to come last in the list of window files, and instead should now correctly choose the file with the least-recently-used one.
Edward Thomson 3392da3c 2021-01-15T12:52:32 Merge pull request #5780 from libgit2/ethomson/ci ci: don't use ninja on macOS
Edward Thomson 75888f27 2021-01-15T10:29:05 ci: don't use ninja on macOS Ninja is not installed by default on the macOS machines; stop trying to use it. Instead use `make -j` which should be roughly equivalent in performance but supported everywhere.
Edward Thomson 674875dc 2021-01-15T09:59:15 Merge pull request #5768 from lhchavez/midx-needs-refresh midx: Fix a bug in `git_midx_needs_refresh()`
Edward Thomson 487f2a82 2021-01-10T21:32:28 Merge pull request #5775 from libgit2/ethomson/clone_branch clone: set refs/remotes/origin/HEAD when branch is specified
lhchavez 1a2f9609 2021-01-05T06:24:26 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
lhchavez 1f32ed25 2021-01-04T19:33:48 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
lhchavez 3fd57a75 2021-01-04T18:22:43 commit-graph: Introduce a parser for commit-graph files This change is the first in a series to add support for git's commit-graph. This should speed up commit graph traversals by avoiding object parsing and allowing some operations to terminate earlier. Part of: #5757
Edward Thomson 923c0f7b 2021-01-07T17:34:17 clone: set refs/remotes/origin/HEAD when branch is specified When a branch is specified to check out in clone, update the remote tracking `HEAD` to point to it. This mimics git's behavior, when `git clone -b <name>` is used.
Edward Thomson c6cf7f0e 2021-01-07T17:00:57 Merge pull request #5769 from lhchavez/pwrite-pread Use `p_pwrite`/`p_pread` consistently throughout the codebase
Edward Thomson 81c98af7 2021-01-07T15:40:06 Merge pull request #5772 from libgit2/ethomson/readme README: instructions for using libgit2 without compiling
Edward Thomson 8462f7f9 2021-01-07T15:39:45 Merge pull request #5770 from libgit2/ethomson/empty_default_branch Cope with empty default branch
Edward Thomson 4ac12634 2021-01-07T15:08:37 README: instructions for using libgit2 without compiling
lhchavez ff6f6754 2021-01-07T05:44:16 Use `p_pwrite`/`p_pread` consistently throughout the codebase This change stops using the seek+read/write combo to perform I/O with an offset, since this is faster by one system call (and also more atomic and therefore safer).
lhchavez d50d3db6 2021-01-07T05:43:30 midx: Fix a bug in `git_midx_needs_refresh()` The very last check in the freshness check for the midx was wrong >< This was also because this function was not tested.
Edward Thomson ba6824db 2021-01-07T14:28:10 Merge pull request #5771 from lhchavez/fix-ci github-actions: Also rename the main branch here
lhchavez 1ddffb05 2021-01-07T06:11:01 github-actions: Also rename the main branch here This should fix the CI.
Edward Thomson 3f4bc213 2021-01-07T14:05:02 repo: ignore empty init.defaultbranch The init.defaultbranch option may be set, but empty. In this case, we should ignore it instead of trying to set our default branch to `refs/heads/`.
Edward Thomson 32350e89 2021-01-07T14:01:30 remote: don't update invalid refs If a symbolic reference points to something invalid, then do not try to update it.
Edward Thomson c41871e5 2021-01-07T12:22:08 fetch: test when HEAD points to nonexistent branch When HEAD points to a nonexistent or invalid branch - for example, to `refs/heads/` - the fetch should be permitted to continue, but we should not use it when creating the `for merge` option in the FETCH_HEAD file. (This emulates git's behavior.)
Edward Thomson c31032a3 2021-01-07T10:15:25 Merge pull request #5760 from libgit2/ethomson/tttoo_many_ttts blob: fix name of `GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD`
Edward Thomson 27e34f9b 2021-01-06T11:49:00 Merge pull request #5759 from JoshuaS3/master Add documentation for git_blob_filter_options.version
Josh Stockin ddafbafe 2021-01-05T17:26:50 Update documentation for git_blob_filter_options Adds info about initializing options with git_blob_filter_options_init
Edward Thomson 855f2998 2021-01-05T14:45:14 blob: fix name of `GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD` `GIT_BLOB_FILTER_ATTTRIBUTES_FROM_HEAD` is misspelled, it should be `GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD`, and it would be if it were not for the MacBook Pro keyboard and my inattentiveness.
Edward Thomson d9c15387 2021-01-05T14:29:58 blob: add git_blob_filter_options_init The `git_blob_filter_options_init` function should be included, to allow callers in FFI environments to let us initialize an options structure for them.