summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove public 'inttypes.h' headerethomson/inttypesEdward Thomson2019-02-213-313/+6
| | | | | | | | | | | Remove an `inttypes.h` header that is too large in scope, and far too public. For Visual Studio 2012 and earlier (ie, `_MSC_VER < 1800`), we do need to include `stdint.h` in our public headers, for types like `uint32_t`. Internally, we also need to define `PRId64` as a printf formatting string when it is not available.
* Merge pull request #4989 from libgit2/ethomson/ci_docsEdward Thomson2019-02-171-3/+13
|\ | | | | ci: publish documentation on merge
| * ci: publish documentation on mergeethomson/ci_docsEdward Thomson2019-02-171-3/+13
|/ | | | | When a commit is pushed or merged into one of the release branches (master, maint/*) then push the documentation update to gh-pages.
* Revert "ci: publish documentation after merge"Edward Thomson2019-02-171-5/+118
| | | | This reverts commit 2a4e866a43e3db1e2be8e2a3d986ddc9f855d2bc.
* fooEdward Thomson2019-02-171-1/+1
|
* fooEdward Thomson2019-02-171-117/+0
|
* ci: publish documentation after mergeEdward Thomson2019-02-171-1/+5
| | | | | | When a continuous integration build runs (ie a commit is pushed or merged into one of the CI branches, `master` or `maint/*`) then push the rebuilt documentation into the `gh-pages` branch.
* Merge pull request #4982 from pks-t/pks/worktree-add-bare-headEdward Thomson2019-02-147-33/+114
|\ | | | | Enable creation of worktree from bare repo's default branch
| * branch: fix `branch_is_checked_out` with bare reposPatrick Steinhardt2019-02-142-2/+16
| | | | | | | | | | | | | | | | | | | | In a bare repository, HEAD usually points to the branch that is considered the "default" branch. As the current implementation for `git_branch_is_checked_out` only does a comparison of HEAD with the branch that is to be checked, it will say that the branch pointed to by HEAD in such a bare repo is checked out. Fix this by skipping the main repo's HEAD when it is bare.
| * branches: introduce flag to skip enumeration of certain HEADsPatrick Steinhardt2019-02-145-19/+35
| | | | | | | | | | | | | | Right now, the function `git_repository_foreach_head` will always iterate over all HEADs of the main repository and its worktrees. In some cases, it might be required to skip either of those, though. Add a flag in preparation for the following commit that enables this behaviour.
| * branches: do not assert that the given ref is a branchPatrick Steinhardt2019-02-142-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Libraries should use assert(3P) only very scarcely. First, we usually shouldn't cause the caller of our library to abort in case where the assert fails. Second, if code is compiled with -DNDEBUG, then the assert will not be included at all. In our `git_branch_is_checked_out` function, we have an assert that verifies that the given reference parameter is non-NULL and in fact a branch. While the first check is fine, the second is not. E.g. when compiled with -DNDEBUG, we'd proceed and treat the given reference as a branch in all cases. Fix the issue by instead treating a non-branch reference as not being checked out. This is the obvious solution, as references other than branches cannot be directly checked out.
| * branches: add tests for `git_branch_is_checked_out`Patrick Steinhardt2019-02-141-0/+39
| | | | | | | | | | We currently do not have any tests at all for the `git_branch_is_checked_out` function. Add some basic ones.
| * worktree: error out early if given ref is not validPatrick Steinhardt2019-02-141-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | When adding a new worktree, we only verify that an optionally given reference is valid half-way through the function. At this point, some data structures have already been created on-disk. If we bail out due to an invalid reference, these will be left behind and need to be manually cleaned up by the user. Improve the situation by moving the reference checks to the function's preamble. Like this, we error out as early as possible and will not leave behind any files.
* | Merge pull request #4965 from hackworks/eliminate-check-for-keep-fileEdward Thomson2019-02-144-4/+29
|\ \ | | | | | | Allow bypassing check for '.keep' file
| * | Allow bypassing check '.keep' files using libgit2 option ↵Dhruva Krishnamurthy2019-02-024-4/+29
| | | | | | | | | | | | 'GIT_OPT_IGNORE_PACK_KEEP_FILE_CHECK'
* | | Merge pull request #4979 from libgit2/ethomson/deprecateEdward Thomson2019-02-146-24/+38
|\ \ \ | |_|/ |/| | Deprecation: export the deprecated functions properly
| * | ci: enable hard deprecationethomson/deprecateEdward Thomson2019-02-142-22/+22
| | | | | | | | | | | | | | | Enable hard deprecation in our builds to ensure that we do not call deprecated functions internally.
| * | deprecation: optionally enable hard deprecationEdward Thomson2019-02-141-0/+5
| | | | | | | | | | | | | | | | | | | | | Add a CMake option to enable hard deprecation; the resultant library will _not_ include any deprecated functions. This may be useful for internal CI builds that create libraries that are not shared with end-users to ensure that we do not use deprecated bits internally.
| * | deprecation: ensure we GIT_EXTERN deprecated funcsEdward Thomson2019-02-144-3/+12
|/ / | | | | | | | | | | | | | | | | | | Although the error functions were deprecated, we did not properly mark them as deprecated. We need to include the `deprecated.h` file in order to ensure that the functions get their export attributes. Similarly, do not define `GIT_DEPRECATE_HARD` within the library, or those functions will also not get their export attributes. Define that only on the tests and examples.
* | Merge pull request #4980 from libgit2/ethomson/ci_nightlyEdward Thomson2019-02-141-0/+1
|\ \ | | | | | | ci: skip ssh tests on macOS nightly
| * | ci: skip ssh tests on macOS nightlyEdward Thomson2019-02-141-0/+1
|/ / | | | | | | | | Like 811c1c0f8f80521dccc746a7bff180cd77a783ff, disable the SSH tests on macOS until we can resolve the newly introduced infrastructure issues.
* | Merge pull request #4976 from libgit2/ethomson/readme_v028Edward Thomson2019-02-143-2/+16
|\ \ | |/ |/| CI build fixups
| * ci: skip ssh tests on macOSethomson/readme_v028Edward Thomson2019-02-141-0/+1
| | | | | | | | | | | | SSH tests on macOS have begun failing for an unknown reason after an infrastructure upgrade to macOS 10.13.6. Disable those tests temporarily, until we can resolve it.
| * ci: provide more information about OSEdward Thomson2019-02-131-1/+13
| | | | | | | | | | | | | | Subtle changes in the host OS can have impacts in the CI system that may be hard to debug. We previously showed the results of `uname` which can be difficult to interpret. Provide more information where available.
| * README: use correct badge for nightliesEdward Thomson2019-02-131-1/+1
| | | | | | | | | | The URL was incorrect for the nightly badge image; it was erroneously showing the master branch continuous integration build badge.
| * README: include build badge for v0.28 buildsEdward Thomson2019-02-121-0/+1
|/ | | | Include a build badge for `maint/v0.28` builds.
* Merge pull request #4970 from libgit2/ethomson/0_28v0.28.0-rc1v0.28.0Edward Thomson2019-02-022-5/+5
|\ | | | | v0.28 rc1
| * version: 0.28ethomson/0_28Edward Thomson2019-01-311-3/+3
| |
| * changelog: this is 0.28Edward Thomson2019-01-311-2/+2
|/
* Merge pull request #4968 from tiennou/fix/documentationEdward Thomson2019-01-311-12/+21
|\ | | | | Docs
| * docs: minor changesEtienne Samson2019-01-301-12/+21
| |
* | Merge branch 'pks/stream-truncated-writes'Edward Thomson2019-01-317-70/+73
|\ \ | |/ |/|
| * mbedtls: fix potential size overflow when reading or writing dataethomson/stream-truncated-writesPatrick Steinhardt2019-01-311-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mbedtls library uses a callback mechanism to allow downstream users to plug in their own receive and send functions. We implement `bio_read` and `bio_write` functions, which simply wrap the `git_stream_read` and `git_stream_write` functions, respectively. The problem arises due to the return value of the callback functions: mbedtls expects us to return an `int` containing the actual number of bytes that were read or written. But this is in fact completely misdesigned, as callers are allowed to pass in a buffer with length `SIZE_MAX`. We thus may be unable to represent the number of bytes written via the return value. Fix this by only ever reading or writing at most `INT_MAX` bytes.
| * mbedtls: make global variables staticPatrick Steinhardt2019-01-311-4/+2
| | | | | | | | | | | | The mbedtls stream implementation makes use of some global variables which are not marked as `static`, even though they're only used in this compilation unit. Fix this and remove a duplicate declaration.
| * openssl: fix potential size overflow when writing dataPatrick Steinhardt2019-01-311-2/+1
| | | | | | | | | | | | | | Our `openssl_write` function calls `SSL_write` by passing in both `data` and `len` arguments directly. Thing is, our `len` parameter is of type `size_t` and theirs is of type `int`. We thus need to clamp our length to be at most `INT_MAX`.
| * streams: handle short writes only in generic streamPatrick Steinhardt2019-01-312-20/+11
| | | | | | | | | | | | | | | | Now that the function `git_stream__write_full` exists and callers of `git_stream_write` have been adjusted, we can lift logic for short writes out of the stream implementations. Instead, this is now handled either by `git_stream__write_full` or by callers of `git_stream_write` directly.
| * streams: fix callers potentially only writing partial dataPatrick Steinhardt2019-01-314-25/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to the write(3) function, implementations of `git_stream_write` do not guarantee that all bytes are written. Instead, they return the number of bytes that actually have been written, which may be smaller than the total number of bytes. Furthermore, due to an interface design issue, we cannot ever write more than `SSIZE_MAX` bytes at once, as otherwise we cannot represent the number of bytes written to the caller. Unfortunately, no caller of `git_stream_write` ever checks the return value, except to verify that no error occurred. Due to this, they are susceptible to the case where only partial data has been written. Fix this by introducing a new function `git_stream__write_full`. In contrast to `git_stream_write`, it will always return either success or failure, without returning the number of bytes written. Thus, it is able to write all `SIZE_MAX` bytes and loop around `git_stream_write` until all data has been written. Adjust all callers except the BIO callbacks in our mbedtls and OpenSSL streams, which already do the right thing and require the amount of bytes written.
| * streams: make file-local functions staticPatrick Steinhardt2019-01-313-19/+17
|/ | | | | | The callback functions that implement the `git_stream` structure are only used inside of their respective implementation files, but they are not marked as `static`. Fix this.
* Merge pull request #4954 from tiennou/fix/documentationEdward Thomson2019-01-305-89/+142
|\ | | | | Documentation fixes
| * repo: split git_repository_open_flag_t options documentation inlineEtienne Samson2019-01-281-28/+41
| |
| * transport: enhance documentationEtienne Samson2019-01-281-57/+88
| |
| * docs: document GIT_EUSER/GIT_EPASSTHROUGHEtienne Samson2019-01-281-1/+10
| |
| * doc: clarify that git_time_t is seconds from the epochEtienne Samson2019-01-282-3/+3
| |
* | Merge pull request #4964 from libgit2/ethomson/ci_nightlyEdward Thomson2019-01-285-44/+70
|\ \ | |/ |/| ci: add an individual coverity pipeline
| * ci: add coverity badge to the READMEEdward Thomson2019-01-281-1/+1
| |
| * ci: ignore coverity failures in nightly runsEdward Thomson2019-01-284-43/+69
|/ | | | | Coverity is back but it's only read-only! Agh. Just allow it to fail and not impact the overall job run.
* Merge pull request #4961 from libgit2/ethomson/ci_docuriumEdward Thomson2019-01-271-0/+23
|\ | | | | ci: run docurium to create documentation
| * ci: run docurium to create documentationethomson/ci_docuriumEdward Thomson2019-01-261-0/+23
| | | | | | | | | | | | | | | | | | | | Run docurium as part of the build. The goal of this is to be able to evaluate the documentation in a given pull request; as such, this does not implement any sort of deployment pipeline. This will allow us to download a snapshot of the documentation from the CI build and evaluate the docs for a particular pull request; before it's been merged.
* | Merge pull request #4962 from libgit2/ethomson/ci_nightlyEdward Thomson2019-01-272-21/+19
|\ \ | | | | | | ci: return coverity to the nightlies
| * | ci: return coverity to the nightliesEdward Thomson2019-01-272-21/+19
|/ /