summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Move libgit2 settings into libgit2.cethomson/initEdward Thomson2020-10-113-331/+331
|
* Rename global.c to libgit2.cEdward Thomson2020-10-111-0/+0
| | | | | | | Now that we've identified that our global settings really aren't global at all, and refactored the library to match that, change global.c to libgit2.c, which is especially nice since the prefix of the functions matches the filename.
* runtime: move init/shutdown into the "runtime"Edward Thomson2020-10-1127-226/+262
| | | | | Provide a mechanism for system components to register for initialization and shutdown of the libgit2 runtime.
* thread: don't use the global tlsdata for thread exitEdward Thomson2020-10-112-11/+18
| | | | | | We want to store a pointer to emulate `pthread_exit` on Windows. Do this within the threading infrastructure so that it could potentially be re-used outside of the context of libgit2 itself.
* thread: restore the git_thread_exit testsEdward Thomson2020-10-111-1/+7
| | | | We were never properly testing git_thread_exit. Do so.
* global: separate global state from thread-local stateEdward Thomson2020-10-117-239/+258
| | | | | | | | | | | | | Our "global initialization" has accumulated some debris over the years. It was previously responsible for both running the various global initializers (that set up various subsystems) _and_ setting up the "global state", which is actually the thread-local state for things like error reporting. Separate the thread local state out into "threadstate". Use the normal subsystem initialization functions that we already have to set it up. This makes both the global initialization system and the threadstate system simpler to reason about.
* global init: check error message buffer allocationEdward Thomson2020-10-111-2/+5
| | | | | | Ensure that we can allocate the error message buffer. In keeping with our typical policiess, we allow (small) memory leaks in the case where we're out of memory.
* mwindow: localize mutexEdward Thomson2020-10-115-18/+15
| | | | | | Move the mwindow mutex into the mwindow code itself, initializing it in the mwindow global initialization function instead of in the global initializer.
* settings: localize global dataEdward Thomson2020-10-117-20/+39
| | | | | Move the settings global data teardown into its own separate function, instead of intermingled with the global state.
* win32: teach the allocator to deal with crtdbgEdward Thomson2020-10-113-15/+21
| | | | | Move the MSVC C runtime debugging bits into the allocator's global init function.
* init: move thread init to git_global_threads_initEdward Thomson2020-10-115-5/+7
| | | | | Instead of treating win32 thread initialization specially in the win32 git_libgit2_init function, add a git_global_threads_init function.
* Merge pull request #5649 from libgit2/ethomson/pcreEdward Thomson2020-10-115-26/+130
|\ | | | | Update PCRE to 8.44
| * pcre: upgrade to 8.44ethomson/pcreEdward Thomson2020-10-045-25/+26
| |
| * pcre: upgrade to 8.43Edward Thomson2020-10-044-12/+22
| |
| * pcre: include the licenseEdward Thomson2020-10-041-0/+93
| | | | | | | | | | We included their COPYING file, which was _not_ in fact their license. Add the LICENSE file as well.
* | Merge pull request #5651 from libgit2/ethomson/clone_branchEdward Thomson2020-10-112-17/+56
|\ \ | | | | | | clone: update origin's HEAD
| * | clone: update origin's HEADEdward Thomson2020-10-061-16/+50
| | | | | | | | | | | | | | | Update `refs/remotes/origin/HEAD` as a symbolic link to the remote's default branch.
| * | clone: test that the origin HEAD is createdEdward Thomson2020-10-061-1/+6
| | | | | | | | | | | | | | | Ensure that we created `refs/remotes/origin/HEAD` when cloning, a symbolic link pointing to `refs/remotes/origin/<default>`
* | | Merge pull request #5594 from lhchavez/git-atomicsEdward Thomson2020-10-117-41/+171
|\ \ \ | | | | | | | | Improve the support of atomics
| * | | Avoid using atomics in pool.clhchavez2020-10-084-17/+27
| | | | | | | | | | | | | | | | Instead, globally initialize the system page size.
| * | | Improve the support of atomicslhchavez2020-10-085-32/+152
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change: * Starts using GCC's and clang's `__atomic_*` intrinsics instead of the `__sync_*` ones, since the former supercede the latter (and can be safely replaced by their equivalent `__atomic_*` version with the sequentially consistent model). * Makes `git_atomic64`'s value `volatile`. Otherwise, this will make ThreadSanitizer complain. * Adds ways to load the values from atomics. As it turns out, unsynchronized read are okay only in some architectures, but if we want to be correct (and make ThreadSanitizer happy), those loads should also be performed with the atomic builtins. * Fixes two ThreadSanitizer warnings, as a proof-of-concept that this works: - Avoid directly accessing `git_refcount`'s `owner` directly, and instead makes all callers go through the `GIT_REFCOUNT_*()` macros, which also use the atomic utilities. - Makes `pool_system_page_size()` race-free. Part of: #5592
* | | Merge pull request #5656 from ehuss/fix-check_extensions-errEdward Thomson2020-10-081-2/+2
|\ \ \ | | | | | | | | Fix error return for invalid extensions.
| * | | Fix error return for invalid extensions.Eric Huss2020-10-071-2/+2
|/ / /
* | | Merge pull request #5654 from dan-tull/masterEdward Thomson2020-10-071-1/+1
|\ \ \ | |/ / |/| | Change bare free to allocator free (fixes #5653)
| * | Change bare free to allocator free.Dan Tull2020-10-061-1/+1
|/ / | | | | | | | | The info pointer was allocated with git__malloc, so needs to be free'd with git__free. This bug can lurk pretty easily since if there's no custom allocator this is fine.
* | Merge pull request #5401 from lhchavez/multi-pack-indexEdward Thomson2020-10-05448-5/+655
|\ \ | | | | | | midx: Introduce a parser for multi-pack-index files
| * | multipack: Introduce a parser for multi-pack-index fileslhchavez2020-10-05448-5/+655
|/ / | | | | | | | | | | | | This change is the first in a series to add support for git's multi-pack-index. This should speed up large repositories significantly. Part of: #5399
* | Merge pull request #5648 from eltociear/patch-1Edward Thomson2020-10-051-1/+1
|\ \ | | | | | | Fixed typo in comment
| * | Fixed typo in commentIkko Ashimine2020-10-041-1/+1
| | | | | | | | | occured -> occurred
* | | Merge pull request #5494 from kevinjswinton/masterEdward Thomson2020-10-043-7/+3
|\ \ \ | |_|/ |/| | Fix binary diff showing /dev/null
| * | Fix binary diff showing /dev/nullKevin Swinton2020-04-183-7/+3
| | | | | | | | | | | | | | | | | | Fixes issue where a changed binary file's content in the working tree isn't displayed correctly, instead showing an oid of zero, and with its path being reported incorrectly as "/dev/null".
* | | p_chmod: Android compatibilitykevinlul2020-10-041-1/+13
| | | | | | | | | | | | | | | | | | Fix #5565 Pre-Android 5 did not implement a virtual filesystem atop FAT partitions for Unix permissions, which causes chmod to fail. However, Unix permissions have no effect on Android anyway as file permissions are not actually managed this way, so treating it as a no-op across all Android is safe.
* | | Merge pull request #5576 from lollipopman/double-authEdward Thomson2020-10-041-2/+5
|\ \ \ | | | | | | | | httpclient: only free challenges for current_server type
| * | | httpclient: only free challenges for current_server typeJesse Hathaway2020-07-101-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this commit we freed both the server and proxy auth challenges in git_http_client_read_response. This works when the proxy needs auth or when the server needs auth, but it does not work when both the proxy and the server need auth as we erroneously remove the server auth challenge before we have added them as server credentials. Instead only remove the challenges for the current_server type. Co-authored-by: Stephen Gelman <ssgelm@gmail.com>
* | | | Merge pull request #5581 from libgit2/ethomson/mainbranchEdward Thomson2020-10-047-46/+181
|\ \ \ \ | | | | | | | | | | Respect `init.defaultBranch` setting
| * | | | refs: remove "master" branch constantethomson/mainbranchEdward Thomson2020-08-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | We don't use "master" as a hardcoded default in as many places; remove the now unused master branch constant.
| * | | | remote: update the default remote branchEdward Thomson2020-08-031-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the remote does not tell us its default, we have to guess what the default branch should be. Use our local initial branch configuration to inform the remote branch default when we clone.
| * | | | clone: don't assume the default branch nameEdward Thomson2020-08-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | We derive the branch name, even in our code, we shouldn't assume that the branch will be "master".
| * | | | clone: respect init.defaultBranch when emptyEdward Thomson2020-08-032-2/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cloning an empty repository, we need to guess what the branch structure should be; instead of hardcoding `master`, use the `init.defaultBranch` setting it if it provided.
| * | | | repo: teach isempty about default branch configEdward Thomson2020-08-031-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The git_repository_isempty function now respects the init.defaultbranch setting (instead of hardcoding "master") to understand if a repository is empty or not.
| * | | | repo: add git_repository_initialbranchEdward Thomson2020-08-032-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a helper function to get the initial branch for a repository, respecting the `init.defaultBranch` configuration option, if set, and returning the "default default" (currently `master`) otherwise.
| * | | | repo: honor the init.defaultBranch settingEdward Thomson2020-08-032-16/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of a push towards more inclusive language, git is reconsidering using "master" as the default branch name. As a first step, this setting will be configurable with the `init.defaultBranch` configuration option. Honor this during repository initialization. During initialization, we will create an initial branch: 1. Using the `initial_head` setting, if specified; 2. Using the `HEAD` configured in a template, if it exists; 3. Using the `init.defaultBranch` configuration option, if it is set; or 4. Using `master` in the absence of additional configuration.
* | | | | Merge pull request #5620 from dlax/parse-patch-add-delete-no-indexEdward Thomson2020-10-042-0/+24
|\ \ \ \ \ | | | | | | | | | | | | patch_parse: handle absence of "index" header for new/deleted cases
| * | | | | patch_parse: handle absence of "index" header for new/deleted casesDenis Laxalde2020-08-292-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follows up on 11de594f85479e4804b07dc4f7b33cfe9212bea0 which added support for parsing patches without extended headers (the "index <hash>..<hash> <mode>" line); issue #5267. We now allow transition from "file mode" state to "path" state directly if there is no "index", which will happen for patches adding or deleting files as demonstrated in added test case.
* | | | | | Merge pull request #5626 from csware/parse_boolEdward Thomson2020-10-042-6/+78
|\ \ \ \ \ \ | | | | | | | | | | | | | | boolean config parsing fails in some cases with mapped values
| * | | | | | Improve formattingSven Strickroth2020-09-091-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
| * | | | | | Add boolean tests for "on" and "off"Sven Strickroth2020-09-091-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
| * | | | | | Support empty values for git_config_get_mapped and git_config_lookup_map_valueSven Strickroth2020-09-092-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
| * | | | | | Fix parsing boolean config values when using git_config_get_mapped and ↵Sven Strickroth2020-09-092-1/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git_config_lookup_map_value Signed-off-by: Sven Strickroth <email@cs-ware.de>
* | | | | | | Merge pull request #5629 from csware/config-multiline-parseEdward Thomson2020-10-043-1/+16
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix config file parsing with multi line values containing quoted parts