summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge pull request #5437 from libgit2/ethomson/azpEdward Thomson2020-03-021-1/+3
|\ \ | | | | | | ci: provide globalsign certs for bionic
| * | ci: provide globalsign certs for bionicethomson/azpEdward Thomson2020-03-021-1/+3
| | | | | | | | | | | | | | | tls.mbed.org has neglected to send their full certificate chain. Add their intermediate cert manually. 🙄
* | | Merge pull request #5426 from pks-t/pks/freebsd-htobe64Edward Thomson2020-03-011-1/+1
|\ \ \ | | | | | | | | deps: ntlmclient: fix htonll on big endian FreeBSD
| * | | deps: ntlmclient: fix htonll on big endian FreeBSDPatrick Steinhardt2020-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 3828ea67b (deps: ntlmclient: fix missing htonll symbols on FreeBSD and SunOS, 2020-02-21), we've fixed compilation on BSDs due to missing `htonll` wrappers. While we are now using `htobe64` for both Linux and OpenBSD, we decided to use `bswap64` on FreeBSD. While correct on little endian systems, where we will swap from little- to big-endian, we will also do the swap on big endian systems. As a result, we do not use network byte order on such systems. Fix the issue by using htobe64, as well.
* | | | Merge pull request #5433 from libgit2/ethomson/azpEdward Thomson2020-03-011-1/+3
|\ \ \ \ | |/ / / |/| / / | |/ / azure-pipelines: download GlobalSign's certificate manually
| * | ci: provide globalsign certsEdward Thomson2020-03-011-1/+3
|/ / | | | | | | | | tls.mbed.org has neglected to send their full certificate chain. Add their intermediate cert manually. 🙄
* | Merge pull request #5417 from pks-t/pks/ntlmclient-htonllPatrick Steinhardt2020-02-252-2/+24
|\ \ | | | | | | deps: ntlmclient: fix missing htonll symbols on FreeBSD and SunOS
| * | transports: auth_ntlm: fix use of strdup/strndupPatrick Steinhardt2020-02-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | In the NTLM authentication code, we accidentally use strdup(3P) and strndup(3P) instead of our own wrappers git__strdup and git__strndup, respectively. Fix the issue by using our own functions.
| * | deps: ntlmclient: fix missing htonll symbols on FreeBSD and SunOSPatrick Steinhardt2020-02-241-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | The ntlmclient dependency defines htonll on Linux-based systems, only. As a result, non-Linux systems will run into compiler and/or linker errors due to undefined symbols. Fix this issue for FreeBSD, OpenBSD and SunOS/OpenSolaris by including the proper headers and defining the symbol accordingly.
* | | Merge pull request #5420 from petersalomonsen/wasm-git-linksPatrick Steinhardt2020-02-241-0/+2
|\ \ \ | | | | | | | | README: add language binding link to wasm-git
| * | | README: add language binding link to wasm-gitPeter Salomonsen2020-02-231-0/+2
|/ / /
* | | Merge pull request #5412 from kloczek/masterPatrick Steinhardt2020-02-211-35/+4
|\ \ \ | | | | | | | | Fix #5410: fix installing libgit2.pc in wrong location
| * | | Fix #5410: fix installing libgit2.pc in wrong locationTomasz KÅ‚oczko2020-02-191-35/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove using custom PKG_BUILD_PREFIu, PKG_BUILD_LIBDIR and PKG_BUILD_INCLUDEDIR variables. Use cmake CMAKE_INSTALL_PREFIX, LIB_INSTALL_DIR, INCLUDE_INSTALL_DIR instead. This patch fixes install libgit2.pc file in correct location and simpifies cmake module.
* | | | Merge pull request #5413 from csware/nsectypoPatrick Steinhardt2020-02-211-1/+1
|\ \ \ \ | | | | | | | | | | Fix typo on GIT_USE_NEC
| * | | | Fix typo on GIT_USE_NECSven Strickroth2020-02-201-1/+1
|/ / / / | | | | | | | | | | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* | | | Merge pull request #5374 from pks-t/pks/diff-with-empty-subtreePatrick Steinhardt2020-02-192-0/+92
|\ \ \ \ | | | | | | | | | | tests: diff: verify that we are able to diff with empty subtrees
| * | | | tests: diff: add test to verify behaviour with empty dir orderingPatrick Steinhardt2020-02-071-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was reported that, given a file "abc.txt", a diff will be shown if an empty directory "abb/" is created, but not if "abd/" is created. Add a test to verify that we do the right thing here and do not depend on any ordering.
| * | | | tests: diff: verify that we are able to diff with empty subtreesPatrick Steinhardt2020-02-071-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While it is not allowed for a tree to have an empty tree as child (e.g. an empty directory), libgit2's tree builder makes it easy to create such trees. As a result, some applications may inadvertently end up with such an invalid tree, and we should try our best and handle them. One such case is when diffing two trees, where one of both trees has such an empty subtree. It was reported that this will cause our diff code to fail. While I wasn't able to reproduce this error, let's still add a test that verifies we continue to handle them correctly.
* | | | | Merge pull request #5408 from pks-t/pks/ci-cleanupsEdward Thomson2020-02-191-2/+1
|\ \ \ \ \ | | | | | | | | | | | | README: update our build matrix to reflect current releases
| * | | | | README: update our build matrix to reflect current releasesPatrick Steinhardt2020-02-191-2/+1
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | As noted in docs/release.md, we only provide security updates for the latest two releases. Let's thus drop the build status of both v0.27 and v0.26 branches, adding the new v0.99 branch instead.
* | | | | Merge pull request #5409 from libgit2/pks/coverity-fix-sudoEdward Thomson2020-02-191-1/+1
|\ \ \ \ \ | |_|_|/ / |/| | | | azure: docker: set up HOME variable to fix Coverity builds
| * | | | azure: docker: set up HOME variable to fix Coverity buildspks/coverity-fix-sudoPatrick Steinhardt2020-02-191-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 01a834066 (azure: docker: fix ARM builds by replacing gosu(1), 2020-02-18), we've switched our entrypoint from gosu(1) to use sudo(1) instead to fix our ARM builds. The switch introduced an incompatibility that now causes our Coverity builds to fail, as the "--preserve-env" switch will also keep HOME at its current value. As a result, Coverity now tries to set up its configuration directory in root's home directory, which it naturally can't write to. Fix the issue by adding the "--set-home" flag to sudo(1).
* | | | Merge pull request #5390 from pks-t/pks/sha1-lookupPatrick Steinhardt2020-02-194-56/+21
|\ \ \ \ | | | | | | | | | | sha1_lookup: inline its only function into "pack.c"
| * | | | sha1_lookup: inline its only function into "pack.c"Patrick Steinhardt2020-02-074-56/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The file "sha1_lookup.c" contains a single function `sha1_position` only which is used only in the packfile implementation. As the function is comparatively small, to enable the compiler to optimize better and to remove symbol visibility, move it into "pack.c".
* | | | | Merge pull request #5391 from pks-t/pks/coverity-fixesPatrick Steinhardt2020-02-1918-113/+146
|\ \ \ \ \ | |_|/ / / |/| | | | Coverity fixes
| * | | | streams: openssl: ignore return value of `git_mutex_lock`Patrick Steinhardt2020-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL pre-v1.1 required us to set up a locking function to properly support multithreading. The locking function signature cannot return any error codes, and as a result we can't do anything if `git_mutex_lock` fails. To silence static analysis tools, let's just explicitly ignore its return value by casting it to `void`.
| * | | | cache: fix invalid memory access in case updating cache entry failsPatrick Steinhardt2020-02-071-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When adding a new entry to our cache where an entry with the same OID exists already, then we only update the existing entry in case it is unparsed and the new entry is parsed. Currently, we do not check the return value of `git_oidmap_set` though when updating the existing entry. As a result, we will _not_ have updated the existing entry if `git_oidmap_set` fails, but have decremented its refcount and incremented the new entry's refcount. Later on, this may likely lead to dereferencing invalid memory. Fix the issue by checking the return value of `git_oidmap_set`. In case it fails, we will simply keep the existing stored instead, even though it's unparsed.
| * | | | worktree: report errors when unable to read locking reasonPatrick Steinhardt2020-02-071-28/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git worktree's have the ability to be locked in order to spare them from deletion, e.g. if a worktree is absent due to being located on a removable disk it is a good idea to lock it. When locking such worktrees, it is possible to give a locking reason in order to help the user later on when inspecting status of any such locked trees. The function `git_worktree_is_locked` serves to read out the locking status. It currently does not properly report any errors when reading the reason file, and callers are unexpecting of any negative return values, too. Fix this by converting callers to expect error codes and checking the return code of `git_futils_readbuffer`.
| * | | | repository: check error codes when reading common linkPatrick Steinhardt2020-02-071-50/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When checking whether a path is a valid repository path, we try to read the "commondir" link file. In the process, we neither confirm that constructing the file's path succeeded nor do we verify that reading the file succeeded, which might cause us to verify repositories on an empty or bogus path later on. Fix this by checking return values. As the function to verify repos doesn't currently support returning errors, this commit also refactors the function to return an error code, passing validity of the repo via an out parameter instead, and adjusts all existing callers.
| * | | | pack-objects: check return code of `git_zstream_set_input`Patrick Steinhardt2020-02-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While `git_zstream_set_input` cannot fail right now, it might change in the future if we ever decide to have it check its parameters more vigorously. Let's thus check whether its return code signals an error.
| * | | | indexer: check return code of `git_hash_ctx_init`Patrick Steinhardt2020-02-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initialization of the hashing context may fail on some systems, most notably on Win32 via the legacy hashing context. As such, we need to always check the error code of `git_hash_ctx_init`, which is not done when creating a new indexer. Fix the issue by adding checks.
| * | | | push: check error code returned by `git_revwalk_hide`Patrick Steinhardt2020-02-072-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When queueing objects we want to push, we call `git_revwalk_hide` to hide all objects already known to the remote from our revwalk. We do not check its return value though, where the orginial intent was to ignore the case where the pushed OID is not a known committish. As `git_revwalk_hide` can fail due to other reasons like out-of-memory exceptions, we should still check its return value. Fix the issue by checking the function's return value, ignoring errors hinting that it's not a committish. As `git_revwalk__push_commit` currently clobbers these error codes, we need to adjust it as well in order to make it available downstream.
| * | | | notes: check error code returned by `git_iterator_advance`Patrick Steinhardt2020-02-071-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling `git_note_next`, we end up calling `git_iterator_advance` but ignore its error code. The intent is that we do not want to return an error if it returns `GIT_ITEROVER`, as we want to return that value on the next invocation of `git_note_next`. We should still check for any other error codes returned by `git_iterator_advance` to catch unexpected internal errors. Fix this by checking the function's return value, ignoring `GIT_ITEROVER`.
| * | | | tests: add missing error checksPatrick Steinhardt2020-02-077-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should always verify error codes returned by function calls in our test suite to not accidentally miss any weird results. Coverity reported missing checks in several locations, which this commit fixes.
| * | | | tests: blame: fix conversion specifiers in format stringPatrick Steinhardt2020-02-072-3/+3
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the blame helper function `hunk_message` accepts a printf-style format string, we didn't add a compiler attribute to let the compiler check for correct conversion specifiers. As a result, some users of the function used wrong specifiers. Add the GIT_FORMAT_PRINTF attribute to the function and fix resulting warnings by using the correct specifiers.
* | | | Merge pull request #5291 from libgit2/ethomson/0_99v0.99.0maint/v0.99Patrick Steinhardt2020-02-193-23/+347
|\ \ \ \ | | | | | | | | | | Release 0.99
| * | | | version: update the version number to v0.99Edward Thomson2020-02-192-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit also switches our SOVERSION to be "$MAJOR.$MINOR" instead of "$MINOR", only. This is in preparation of v1.0, where the previous scheme would've stopped working in an obvious way.
| * | | | docs: update changelog for v0.99Edward Thomson2020-02-191-18/+342
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Give the release a name, "Torschlusspanik" (the fear that time is running out to act). Indeed, the time is running out for changes to be included in v1.0.
* | | | | Merge pull request #5372 from pks-t/pks/release-scriptPatrick Steinhardt2020-02-192-0/+175
|\ \ \ \ \ | |/ / / / |/| | | | Release script
| * | | | scripts: add script to create releasesPatrick Steinhardt2020-02-071-0/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current release process is not documented in any way. As a result, it's not obvious how releases should be done at all, like e.g. which locations need adjusting. To fix this, let's introduce a new script that shall from now on be used to do all releases. As input it gets the tree that shall be released, the repository in which to do the release, credentials to authenticate against GitHub and the new version. E.g. executing the following will create a new release v0.32: $ ./script/release.py 0.32.0 --user pks-t --password **** While the password may currently be your usual GitLab password, it's recommended to use a personal access token intead. The script will then perform the following steps: 1. Verify that "include/git2/version.h" matches the new version. 2. Verify that "docs/changelog.md" has a section for that new version. 3. Extract the changelog entries for the current release from "docs/changelog.md". 4. Generate two archives in "tar.gz" and "zip" format via "git archive" from the tree passed by the user. If no tree was passed, we will use "HEAD". 5. Create the GitHub release using the extracted changelog entries as well as tag and name information derived from the version passed by the used. 6. Upload both code archives to that release. This should cover all steps required for a new release and thus ensures that nothing is missing that shouldn't be.
| * | | | editorconfig: special-case Python scriptsPatrick Steinhardt2020-02-071-0/+4
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Python's PEP 8 specifies that one shall use spaces instead of tabs as coding style, and we actually honor that currently. Our EditorConfig does not special-case Python scripts, though, which is why we end up with our C coding style and thus with tabs. Special-case "*.py" files to override that default with spaces to fix this.
* | | | Merge pull request #5406 from libgit2/pks/azure-fix-arm32Edward Thomson2020-02-186-42/+19
|\ \ \ \ | | | | | | | | | | azure: fix ARM32 builds by replacing gosu(1)
| * | | | tests: object: decrease number of concurrent cache accessesPatrick Steinhardt2020-02-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In our test case object::cache::fast_thread_rush, we're creating 100 concurrent threads opening a repository and reading objects from it. This test actually fails on ARM32 with an out-of-memory error, which isn't entirely unexpected. Work around the issue by halving the number of threads.
| * | | | azure: docker: fix ARM builds by replacing gosu(1)pks/azure-fix-arm32Patrick Steinhardt2020-02-183-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our nightly builds are currently failing due to our ARM-based jobs. These jobs crash immediately when entering the Docker container with a exception thrown by Go's language runtime. As we're able to successfully builds the Docker images in previous steps, it's unlikely to be a bug in Docker itself. Instead, this exception is thrown by gosu(1), which is a Go-based utility to drop privileges and run by our entrypoint. Fix the issue by dropping gosu(1) in favor of sudo(1).
| * | | | azure: docker: synchronize Xenial/Bionic build instructionsPatrick Steinhardt2020-02-182-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our two Docker build instructions for Xenial and Bionic have diverged a bit. Let's re-synchronize them with each other to make them as similar as possible.
| * | | | azure: docker: detect errors when building imagesPatrick Steinhardt2020-02-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The build step for our Docker images currently succeeds even if building the Docker image fails due to missing && chains in the build script. Fix this by adding them in.
| * | | | azure: remove unused Linux setup scriptPatrick Steinhardt2020-02-181-27/+0
| | |_|/ | |/| | | | | | | | | | | | | | | | | | Since migrating to Docker containings for our build and test infrastructure, we do not use the "setup-linux.sh" script anymore. Remove it to avoid any confusion.
* | | | Merge pull request #5398 from libgit2/pks/valgrind-opensslPatrick Steinhardt2020-02-184-31/+61
|\ \ \ \ | | | | | | | | | | openssl: fix Valgrind issues in nightly builds
| * | | | streams: openssl: switch approach to silence Valgrind errorspks/valgrind-opensslPatrick Steinhardt2020-02-111-21/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As OpenSSL loves using uninitialized bytes as another source of entropy, we need to mark them as defined so that Valgrind won't complain about use of these bytes. Traditionally, we've been using the macro `VALGRIND_MAKE_MEM_DEFINED` provided by Valgrind, but starting with OpenSSL 1.1 the code doesn't compile anymore due to `struct SSL` having become opaque. As such, we also can't set it as defined anymore, as we have no way of knowing its size. Let's change gears instead by just swapping out the allocator functions of OpenSSL with our own ones. The twist is that instead of calling `malloc`, we just call `calloc` to have the bytes initialized automatically. Next to soothing Valgrind, this approach has the benefit of being completely agnostic of the memory sanitizer and is neatly contained at a single place. Note that we shouldn't do this for non-Valgrind builds. As we cannot set up memory functions for a given SSL context, only, we need to swap them at a global context. Furthermore, as it's possible to call `OPENSSL_set_mem_functions` once only, we'd prevent users of libgit2 to set up their own allocators.
| * | | | cmake: consolidate Valgrind optionPatrick Steinhardt2020-02-113-10/+8
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL doesn't initialize bytes on purpose in order to generate additional entropy. Valgrind isn't too happy about that though, causing it to generate warninings about various issues regarding use of uninitialized bytes. We traditionally had some infrastructure to silence these errors in our OpenSSL stream implementation, where we invoke the Valgrind macro `VALGRIND_MAKE_MEMDEFINED` in various callbacks that we provide to OpenSSL. Naturally, we only include these instructions if a preprocessor define "VALGRIND" is set, and that in turn is only set if passing "-DVALGRIND" to CMake. We do that in our usual Azure pipelines, but we in fact forgot to do this in our nightly build. As a result, we get a slew of warnings for these nightly builds, but not for our normal builds. To fix this, we could just add "-DVALGRIND" to our nightly builds. But starting with commit d827b11b6 (tests: execute leak checker via CTest directly, 2019-06-28), we do have a secondary variable that directs whether we want to use memory sanitizers for our builds. As such, every user wishing to use Valgrind for our tests needs to pass both options "VALGRIND" and "USE_LEAK_CHECKER", which is cumbersome and error prone, as can be seen by our own builds. Instead, let's consolidate this into a single option, removing the old "-DVALGRIND" one. Instead, let's just add the preprocessor directive if USE_LEAK_CHECKER equals "valgrind" and remove "-DVALGRIND" from our own pipelines.