Debian

Available patches from Ubuntu

To see Ubuntu differences wrt. to Debian, write down a grep-dctrl query identifying the packages you're interested in:
grep-dctrl -n -sPackage Sources.Debian
(e.g. -FPackage linux-ntfs or linux-ntfs)

Modified packages are listed below:

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: cargo

cargo (0.44.1-0ubuntu1) groovy; urgency=medium * New upstream version. (LP: #1876942) * Update scripts/debian-cargo-vendor to invoke python3 and cope with V2 format Cargo.lock files. * Refresh patches. * Embed libgit2 1.0.0 which is not yet in Debian or Ubuntu. - add debian/libgit2 - add debian/patches/use-system-libhttp-parser.patch - update debian/control - update debian/copyright - update debiab/patches/series - update debian/README.source - update debian/rules -- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Wed, 24 Jun 2020 12:40:56 +1200 cargo (0.43.1-3ubuntu1) groovy; urgency=medium * Merge from Debian unstable (LP: #1876942): Remaining changes: - Don't use the bootstrap.py script for bootstrapping as it no longer works. - remove debian/bootstrap.py - update debian/make_orig_multi.sh -- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Thu, 21 May 2020 21:14:18 +1200

Modifications :
  1. Download patch debian/libgit2/docs/checkout-internals.md
  2. Download patch debian/libgit2/azure-pipelines/setup-osx.sh

    --- 0.43.1-3/debian/libgit2/azure-pipelines/setup-osx.sh 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/azure-pipelines/setup-osx.sh 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,8 @@ +#!/bin/sh + +set -x + +brew update +brew install pkgconfig zlib curl openssl libssh2 ninja + +ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libLeaksAtExit.dylib /usr/local/lib
  3. Download patch debian/libgit2/.editorconfig

    --- 0.43.1-3/debian/libgit2/.editorconfig 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/.editorconfig 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,21 @@ +; Check http://editorconfig.org/ for more informations +root = true + +[*] +indent_style = tab +tab_width = 8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.yml] +indent_style = space +indent_size = 2 + +[*.md] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = false + +[*.py] +indent_style = space +indent_size = 4
  4. Download patch debian/libgit2/cmake/Modules/IdeSplitSources.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/IdeSplitSources.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/IdeSplitSources.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,22 @@ +# This function splits the sources files up into their appropriate +# subdirectories. This is especially useful for IDEs like Xcode and +# Visual Studio, so that you can navigate into the libgit2_clar project, +# and see the folders within the tests folder (instead of just seeing all +# source and tests in a single folder.) +FUNCTION(IDE_SPLIT_SOURCES target) + IF(MSVC_IDE OR CMAKE_GENERATOR STREQUAL Xcode) + GET_TARGET_PROPERTY(sources ${target} SOURCES) + FOREACH(source ${sources}) + IF(source MATCHES ".*/") + STRING(REPLACE ${libgit2_SOURCE_DIR}/ "" rel ${source}) + IF(rel) + STRING(REGEX REPLACE "/([^/]*)$" "" rel ${rel}) + IF(rel) + STRING(REPLACE "/" "\\\\" rel ${rel}) + SOURCE_GROUP(${rel} FILES ${source}) + ENDIF() + ENDIF() + ENDIF() + ENDFOREACH() + ENDIF() +ENDFUNCTION()
  5. Download patch debian/libgit2/azure-pipelines/coverity.yml

    --- 0.43.1-3/debian/libgit2/azure-pipelines/coverity.yml 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/azure-pipelines/coverity.yml 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,26 @@ +resources: +- repo: self + +jobs: +- job: coverity + displayName: 'Coverity' + pool: + vmImage: 'ubuntu-18.04' + steps: + - script: | + cd $(Build.SourcesDirectory)/azure-pipelines/docker + docker build -t libgit2/xenial --build-arg BASE=ubuntu:xenial -f xenial . + displayName: 'Build Docker image' + - task: Docker@0 + displayName: Analyze + inputs: + action: 'Run an image' + imageName: libgit2/xenial + volumes: | + $(Build.SourcesDirectory):/home/libgit2/source + $(Build.BinariesDirectory):/home/libgit2/build + envVars: | + COVERITY_TOKEN=$(COVERITY_TOKEN) + workDir: '/home/libgit2/build' + containerCommand: '/home/libgit2/source/azure-pipelines/coverity.sh' + detached: false
  6. Download patch debian/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in

    --- 0.43.1-3/debian/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,29 @@ +@CHECK_PROTOTYPE_DEFINITION_HEADER@ + +static void cmakeRequireSymbol(int dummy, ...) { + (void) dummy; +} + +static void checkSymbol(void) { +#ifndef @CHECK_PROTOTYPE_DEFINITION_SYMBOL@ + cmakeRequireSymbol(0, &@CHECK_PROTOTYPE_DEFINITION_SYMBOL@); +#endif +} + +@CHECK_PROTOTYPE_DEFINITION_PROTO@ { + return @CHECK_PROTOTYPE_DEFINITION_RETURN@; +} + +#ifdef __CLASSIC_C__ +int main() { + int ac; + char*av[]; +#else +int main(int ac, char *av[]) { +#endif + checkSymbol(); + if (ac > 1000) { + return *av[0]; + } + return 0; +}
  7. Download patch debian/libgit2/docs/diff-internals.md

    --- 0.43.1-3/debian/libgit2/docs/diff-internals.md 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/docs/diff-internals.md 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,92 @@ +Diff is broken into four phases: + +1. Building a list of things that have changed. These changes are called + deltas (git_diff_delta objects) and are grouped into a git_diff_list. +2. Applying file similarity measurement for rename and copy detection (and + to potentially split files that have changed radically). This step is + optional. +3. Computing the textual diff for each delta. Not all deltas have a + meaningful textual diff. For those that do, the textual diff can + either be generated on the fly and passed to output callbacks or can be + turned into a git_diff_patch object. +4. Formatting the diff and/or patch into standard text formats (such as + patches, raw lists, etc). + +In the source code, step 1 is implemented in `src/diff.c`, step 2 in +`src/diff_tform.c`, step 3 in `src/diff_patch.c`, and step 4 in +`src/diff_print.c`. Additionally, when it comes to accessing file +content, everything goes through diff drivers that are implemented in +`src/diff_driver.c`. + +External Objects +---------------- + +* `git_diff_options` represents user choices about how a diff should be + performed and is passed to most diff generating functions. +* `git_diff_file` represents an item on one side of a possible delta +* `git_diff_delta` represents a pair of items that have changed in some + way - it contains two `git_diff_file` plus a status and other stuff. +* `git_diff_list` is a list of deltas along with information about how + those particular deltas were found. +* `git_diff_patch` represents the actual diff between a pair of items. In + some cases, a delta may not have a corresponding patch, if the objects + are binary, for example. The content of a patch will be a set of hunks + and lines. +* A `hunk` is range of lines described by a `git_diff_range` (i.e. "lines + 10-20 in the old file became lines 12-23 in the new"). It will have a + header that compactly represents that information, and it will have a + number of lines of context surrounding added and deleted lines. +* A `line` is simple a line of data along with a `git_diff_line_t` value + that tells how the data should be interpreted (e.g. context or added). + +Internal Objects +---------------- + +* `git_diff_file_content` is an internal structure that represents the + data on one side of an item to be diffed; it is an augmented + `git_diff_file` with more flags and the actual file data. + + * it is created from a repository plus a) a git_diff_file, b) a git_blob, + or c) raw data and size + * there are three main operations on git_diff_file_content: + + * _initialization_ sets up the data structure and does what it can up to, + but not including loading and looking at the actual data + * _loading_ loads the data, preprocesses it (i.e. applies filters) and + potentially analyzes it (to decide if binary) + * _free_ releases loaded data and frees any allocated memory + +* The internal structure of a `git_diff_patch` stores the actual diff + between a pair of `git_diff_file_content` items + + * it may be "unset" if the items are not diffable + * "empty" if the items are the same + * otherwise it will consist of a set of hunks each of which covers some + number of lines of context, additions and deletions + * a patch is created from two git_diff_file_content items + * a patch is fully instantiated in three phases: + + * initial creation and initialization + * loading of data and preliminary data examination + * diffing of data and optional storage of diffs + * (TBD) if a patch is asked to store the diffs and the size of the diff + is significantly smaller than the raw data of the two sides, then the + patch may be flattened using a pool of string data + +* `git_diff_output` is an internal structure that represents an output + target for a `git_diff_patch` + * It consists of file, hunk, and line callbacks, plus a payload + * There is a standard flattened output that can be used for plain text output + * Typically we use a `git_xdiff_output` which drives the callbacks via the + xdiff code taken from core Git. + +* `git_diff_driver` is an internal structure that encapsulates the logic + for a given type of file + * a driver is looked up based on the name and mode of a file. + * the driver can then be used to: + * determine if a file is binary (by attributes, by git_diff_options + settings, or by examining the content) + * give you a function pointer that is used to evaluate function context + for hunk headers + * At some point, the logic for getting a filtered version of file content + or calculating the OID of a file may be moved into the driver.
  8. Download patch debian/libgit2/cmake/Modules/FindCoreFoundation.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/FindCoreFoundation.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/FindCoreFoundation.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,26 @@ +# Find CoreFoundation.framework +# This will define : +# +# COREFOUNDATION_FOUND +# COREFOUNDATION_LIBRARIES +# COREFOUNDATION_LDFLAGS +# + +FIND_PATH(COREFOUNDATION_INCLUDE_DIR NAMES CoreFoundation.h) +FIND_LIBRARY(COREFOUNDATION_LIBRARIES NAMES CoreFoundation) +IF (COREFOUNDATION_INCLUDE_DIR AND COREFOUNDATION_LIBRARIES) + IF (NOT CoreFoundation_FIND_QUIETLY) + MESSAGE(STATUS "Found CoreFoundation ${COREFOUNDATION_LIBRARIES}") + ENDIF() + SET(COREFOUNDATION_FOUND TRUE) + SET(COREFOUNDATION_LDFLAGS "-framework CoreFoundation") +ENDIF () + +IF (CoreFoundation_FIND_REQUIRED AND NOT COREFOUNDATION_FOUND) + MESSAGE(FATAL_ERROR "CoreFoundation not found") +ENDIF() + +MARK_AS_ADVANCED( + COREFOUNDATION_INCLUDE_DIR + COREFOUNDATION_LIBRARIES +)
  9. Download patch Cargo.toml

    --- 0.43.1-3/Cargo.toml 2020-03-17 14:23:20.000000000 +0000 +++ 0.44.1-0ubuntu1/Cargo.toml 2020-05-04 02:09:09.000000000 +0000 @@ -1,6 +1,6 @@ [package] name = "cargo" -version = "0.43.1" +version = "0.44.0" edition = "2018" authors = ["Yehuda Katz <wycats@gmail.com>", "Carl Lerche <me@carllerche.com>", @@ -23,29 +23,30 @@ atty = "0.2" bytesize = "1.0" cargo-platform = { path = "crates/cargo-platform", version = "0.1.1" } crates-io = { path = "crates/crates-io", version = "0.31" } +crossbeam-channel = "0.4" crossbeam-utils = "0.7" crypto-hash = "0.3.1" curl = { version = "0.4.23", features = ["http2"] } curl-sys = "0.4.22" env_logger = "0.7.0" -pretty_env_logger = { version = "0.3", optional = true } +pretty_env_logger = { version = "0.4", optional = true } anyhow = "1.0" filetime = "0.2" flate2 = { version = "1.0.3", features = ["zlib"] } fs2 = "0.4" -git2 = "0.11.0" -git2-curl = "0.12.0" +git2 = "0.13.0" +git2-curl = "0.14.0" glob = "0.3.0" hex = "0.4" home = "0.5" humantime = "2.0.0" ignore = "0.4.7" lazy_static = "1.2.0" -jobserver = "0.1.13" +jobserver = "0.1.21" lazycell = "1.2.0" libc = "0.2" log = "0.4.6" -libgit2-sys = "0.10.0" +libgit2-sys = "0.12.0" memchr = "2.1.3" num_cpus = "1.0" opener = "0.4" @@ -59,7 +60,7 @@ serde_ignored = "0.1.0" serde_json = { version = "1.0.30", features = ["raw_value"] } shell-escape = "0.1.4" strip-ansi-escapes = "0.1.0" -tar = { version = "0.4.18", default-features = false } +tar = { version = "0.4.26", default-features = false } tempfile = "3.0" termcolor = "1.0" toml = "0.5.3"
  10. Download patch debian/libgit2/docs/code_of_conduct.md

    --- 0.43.1-3/debian/libgit2/docs/code_of_conduct.md 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/docs/code_of_conduct.md 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,75 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [libgit2@gmail.com][email]. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[email]: mailto:libgit2@gmail.com +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/
  11. Download patch debian/libgit2/include/git2/cert.h

    --- 0.43.1-3/debian/libgit2/include/git2/cert.h 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/include/git2/cert.h 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,135 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_cert_h__ +#define INCLUDE_git_cert_h__ + +#include "common.h" + +/** + * @file git2/cert.h + * @brief Git certificate objects + * @defgroup git_cert Certificate objects + * @ingroup Git + * @{ + */ +GIT_BEGIN_DECL + +/** + * Type of host certificate structure that is passed to the check callback + */ +typedef enum git_cert_t { + /** + * No information about the certificate is available. This may + * happen when using curl. + */ + GIT_CERT_NONE, + /** + * The `data` argument to the callback will be a pointer to + * the DER-encoded data. + */ + GIT_CERT_X509, + /** + * The `data` argument to the callback will be a pointer to a + * `git_cert_hostkey` structure. + */ + GIT_CERT_HOSTKEY_LIBSSH2, + /** + * The `data` argument to the callback will be a pointer to a + * `git_strarray` with `name:content` strings containing + * information about the certificate. This is used when using + * curl. + */ + GIT_CERT_STRARRAY, +} git_cert_t; + +/** + * Parent type for `git_cert_hostkey` and `git_cert_x509`. + */ +struct git_cert { + /** + * Type of certificate. A `GIT_CERT_` value. + */ + git_cert_t cert_type; +}; + +/** + * Callback for the user's custom certificate checks. + * + * @param cert The host certificate + * @param valid Whether the libgit2 checks (OpenSSL or WinHTTP) think + * this certificate is valid + * @param host Hostname of the host libgit2 connected to + * @param payload Payload provided by the caller + * @return 0 to proceed with the connection, < 0 to fail the connection + * or > 0 to indicate that the callback refused to act and that + * the existing validity determination should be honored + */ +typedef int GIT_CALLBACK(git_transport_certificate_check_cb)(git_cert *cert, int valid, const char *host, void *payload); + +/** + * Type of SSH host fingerprint + */ +typedef enum { + /** MD5 is available */ + GIT_CERT_SSH_MD5 = (1 << 0), + /** SHA-1 is available */ + GIT_CERT_SSH_SHA1 = (1 << 1), + /** SHA-256 is available */ + GIT_CERT_SSH_SHA256 = (1 << 2), +} git_cert_ssh_t; + +/** + * Hostkey information taken from libssh2 + */ +typedef struct { + git_cert parent; /**< The parent cert */ + + /** + * A hostkey type from libssh2, either + * `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1` + */ + git_cert_ssh_t type; + + /** + * Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will + * have the MD5 hash of the hostkey. + */ + unsigned char hash_md5[16]; + + /** + * Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will + * have the SHA-1 hash of the hostkey. + */ + unsigned char hash_sha1[20]; + + /** + * Hostkey hash. If type has `GIT_CERT_SSH_SHA256` set, this will + * have the SHA-256 hash of the hostkey. + */ + unsigned char hash_sha256[32]; +} git_cert_hostkey; + +/** + * X.509 certificate information + */ +typedef struct { + git_cert parent; /**< The parent cert */ + + /** + * Pointer to the X.509 certificate data + */ + void *data; + + /** + * Length of the memory block pointed to by `data`. + */ + size_t len; +} git_cert_x509; + +/** @} */ +GIT_END_DECL +#endif
  12. Download patch debian/libgit2/include/git2/branch.h
  13. Download patch debian/libgit2/cmake/Modules/SelectHTTPSBackend.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/SelectHTTPSBackend.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/SelectHTTPSBackend.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,127 @@ +# Select the backend to use + +INCLUDE(SanitizeBool) + +# We try to find any packages our backends might use +FIND_PACKAGE(OpenSSL) +FIND_PACKAGE(mbedTLS) +IF (CMAKE_SYSTEM_NAME MATCHES "Darwin") + FIND_PACKAGE(Security) + FIND_PACKAGE(CoreFoundation) +ENDIF() + +# Auto-select TLS backend +SanitizeBool(USE_HTTPS) +IF (USE_HTTPS STREQUAL ON) + IF (SECURITY_FOUND) + IF (SECURITY_HAS_SSLCREATECONTEXT) + SET(HTTPS_BACKEND "SecureTransport") + ELSE() + MESSAGE(STATUS "Security framework is too old, falling back to OpenSSL") + SET(HTTPS_BACKEND "OpenSSL") + ENDIF() + ELSEIF (WINHTTP) + SET(HTTPS_BACKEND "WinHTTP") + ELSEIF(OPENSSL_FOUND) + SET(HTTPS_BACKEND "OpenSSL") + ELSEIF(MBEDTLS_FOUND) + SET(HTTPS_BACKEND "mbedTLS") + ELSE() + MESSAGE(FATAL_ERROR "Unable to autodetect a usable HTTPS backend." + "Please pass the backend name explicitly (-DUSE_HTTPS=backend)") + ENDIF() +ELSEIF(USE_HTTPS) + # HTTPS backend was explicitly set + SET(HTTPS_BACKEND ${USE_HTTPS}) +ELSE() + SET(HTTPS_BACKEND NO) +ENDIF() + +IF(HTTPS_BACKEND) + # Check that we can find what's required for the selected backend + IF (HTTPS_BACKEND STREQUAL "SecureTransport") + IF (NOT COREFOUNDATION_FOUND) + MESSAGE(FATAL_ERROR "Cannot use SecureTransport backend, CoreFoundation.framework not found") + ENDIF() + IF (NOT SECURITY_FOUND) + MESSAGE(FATAL_ERROR "Cannot use SecureTransport backend, Security.framework not found") + ENDIF() + IF (NOT SECURITY_HAS_SSLCREATECONTEXT) + MESSAGE(FATAL_ERROR "Cannot use SecureTransport backend, SSLCreateContext not supported") + ENDIF() + + SET(GIT_SECURE_TRANSPORT 1) + LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${SECURITY_INCLUDE_DIR}) + LIST(APPEND LIBGIT2_LIBS ${COREFOUNDATION_LDFLAGS} ${SECURITY_LDFLAGS}) + LIST(APPEND LIBGIT2_PC_LIBS ${COREFOUNDATION_LDFLAGS} ${SECURITY_LDFLAGS}) + ELSEIF (HTTPS_BACKEND STREQUAL "OpenSSL") + IF (NOT OPENSSL_FOUND) + MESSAGE(FATAL_ERROR "Asked for OpenSSL TLS backend, but it wasn't found") + ENDIF() + + SET(GIT_OPENSSL 1) + LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${OPENSSL_INCLUDE_DIR}) + LIST(APPEND LIBGIT2_LIBS ${OPENSSL_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS ${OPENSSL_LDFLAGS}) + LIST(APPEND LIBGIT2_PC_REQUIRES "openssl") + ELSEIF(HTTPS_BACKEND STREQUAL "mbedTLS") + IF (NOT MBEDTLS_FOUND) + MESSAGE(FATAL_ERROR "Asked for mbedTLS backend, but it wasn't found") + ENDIF() + + IF(NOT CERT_LOCATION) + MESSAGE(STATUS "Auto-detecting default certificates location") + IF(CMAKE_SYSTEM_NAME MATCHES Darwin) + # Check for an Homebrew installation + SET(OPENSSL_CMD "/usr/local/opt/openssl/bin/openssl") + ELSE() + SET(OPENSSL_CMD "openssl") + ENDIF() + EXECUTE_PROCESS(COMMAND ${OPENSSL_CMD} version -d OUTPUT_VARIABLE OPENSSL_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) + IF(OPENSSL_DIR) + STRING(REGEX REPLACE "^OPENSSLDIR: \"(.*)\"$" "\\1/" OPENSSL_DIR ${OPENSSL_DIR}) + + SET(OPENSSL_CA_LOCATIONS + "ca-bundle.pem" # OpenSUSE Leap 42.1 + "cert.pem" # Ubuntu 14.04, FreeBSD + "certs/ca-certificates.crt" # Ubuntu 16.04 + "certs/ca.pem" # Debian 7 + ) + FOREACH(SUFFIX IN LISTS OPENSSL_CA_LOCATIONS) + SET(LOC "${OPENSSL_DIR}${SUFFIX}") + IF(NOT CERT_LOCATION AND EXISTS "${OPENSSL_DIR}${SUFFIX}") + SET(CERT_LOCATION ${LOC}) + ENDIF() + ENDFOREACH() + ELSE() + MESSAGE(FATAL_ERROR "Unable to find OpenSSL executable. Please provide default certificate location via CERT_LOCATION") + ENDIF() + ENDIF() + + IF(CERT_LOCATION) + IF(NOT EXISTS ${CERT_LOCATION}) + MESSAGE(FATAL_ERROR "Cannot use CERT_LOCATION=${CERT_LOCATION} as it doesn't exist") + ENDIF() + ADD_FEATURE_INFO(CERT_LOCATION ON "using certificates from ${CERT_LOCATION}") + ADD_DEFINITIONS(-DGIT_DEFAULT_CERT_LOCATION="${CERT_LOCATION}") + ENDIF() + + SET(GIT_MBEDTLS 1) + LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${MBEDTLS_INCLUDE_DIR}) + LIST(APPEND LIBGIT2_LIBS ${MBEDTLS_LIBRARIES}) + # mbedTLS has no pkgconfig file, hence we can't require it + # https://github.com/ARMmbed/mbedtls/issues/228 + # For now, pass its link flags as our own + LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES}) + ELSEIF (HTTPS_BACKEND STREQUAL "WinHTTP") + # WinHTTP setup was handled in the WinHTTP-specific block above + ELSE() + MESSAGE(FATAL_ERROR "Asked for backend ${HTTPS_BACKEND} but it wasn't found") + ENDIF() + + SET(GIT_HTTPS 1) + ADD_FEATURE_INFO(HTTPS GIT_HTTPS "using ${HTTPS_BACKEND}") +ELSE() + SET(GIT_HTTPS 0) + ADD_FEATURE_INFO(HTTPS NO "") +ENDIF()
  14. Download patch debian/libgit2/cmake/Modules/FindPkgLibraries.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/FindPkgLibraries.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/FindPkgLibraries.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,28 @@ +INCLUDE(FindPkgConfig) + +# This function will find and set up a pkg-config based module. +# If a pc-file was found, it will resolve library paths to +# absolute paths. Furthermore, the function will automatically +# fall back to use static libraries in case no dynamic libraries +# were found. +FUNCTION(FIND_PKGLIBRARIES prefix package) + PKG_CHECK_MODULES(${prefix} ${package}) + IF(NOT ${prefix}_FOUND) + RETURN() + ENDIF() + + FOREACH(LIBRARY ${${prefix}_LIBRARIES}) + FIND_LIBRARY(${LIBRARY}_RESOLVED ${LIBRARY} PATHS ${${prefix}_LIBRARY_DIRS}) + IF(${${LIBRARY}_RESOLVED} STREQUAL "${LIBRARY}_RESOLVED-NOTFOUND") + MESSAGE(FATAL_ERROR "could not resolve ${LIBRARY}") + ENDIF() + LIST(APPEND RESOLVED_LIBRARIES ${${LIBRARY}_RESOLVED}) + ENDFOREACH(LIBRARY) + + SET(${prefix}_FOUND 1 PARENT_SCOPE) + SET(${prefix}_LIBRARIES ${RESOLVED_LIBRARIES} PARENT_SCOPE) + SET(${prefix}_INCLUDE_DIRS ${${prefix}_INCLUDE_DIRS} PARENT_SCOPE) + SET(${prefix}_LDFLAGS ${${prefix}_LDFLAGS} PARENT_SCOPE) + + MESSAGE(STATUS " Resolved libraries: ${RESOLVED_LIBRARIES}") +ENDFUNCTION()
  15. Download patch debian/libgit2/cmake/Modules/FindPCRE2.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/FindPCRE2.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/FindPCRE2.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,37 @@ +# Copyright (C) 2007-2009 LuaDist. +# Created by Peter Kapec <kapecp@gmail.com> +# Redistribution and use of this file is allowed according to the terms of the MIT license. +# For details see the COPYRIGHT file distributed with LuaDist. +# Note: +# Searching headers and libraries is very simple and is NOT as powerful as scripts +# distributed with CMake, because LuaDist defines directories to search for. +# Everyone is encouraged to contact the author with improvements. Maybe this file +# becomes part of CMake distribution sometimes. + +# - Find pcre +# Find the native PCRE2 headers and libraries. +# +# PCRE2_INCLUDE_DIRS - where to find pcre.h, etc. +# PCRE2_LIBRARIES - List of libraries when using pcre. +# PCRE2_FOUND - True if pcre found. + +# Look for the header file. +FIND_PATH(PCRE2_INCLUDE_DIR NAMES pcre2posix.h) + +# Look for the library. +FIND_LIBRARY(PCRE2_LIBRARY NAMES pcre2-8) + +# Handle the QUIETLY and REQUIRED arguments and set PCRE2_FOUND to TRUE if all listed variables are TRUE. +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE2 DEFAULT_MSG PCRE2_LIBRARY PCRE2_INCLUDE_DIR) + +# Copy the results to the output variables. +IF(PCRE2_FOUND) + SET(PCRE2_LIBRARIES ${PCRE2_LIBRARY}) + SET(PCRE2_INCLUDE_DIRS ${PCRE2_INCLUDE_DIR}) +ELSE(PCRE2_FOUND) + SET(PCRE2_LIBRARIES) + SET(PCRE2_INCLUDE_DIRS) +ENDIF(PCRE2_FOUND) + +MARK_AS_ADVANCED(PCRE2_INCLUDE_DIRS PCRE2_LIBRARIES)
  16. Download patch debian/libgit2/include/git2/annotated_commit.h

    --- 0.43.1-3/debian/libgit2/include/git2/annotated_commit.h 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/include/git2/annotated_commit.h 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,125 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_annotated_commit_h__ +#define INCLUDE_git_annotated_commit_h__ + +#include "common.h" +#include "repository.h" +#include "types.h" + +/** + * @file git2/annotated_commit.h + * @brief Git annotated commit routines + * @defgroup git_annotated_commit Git annotated commit routines + * @ingroup Git + * @{ + */ +GIT_BEGIN_DECL + +/** + * Creates a `git_annotated_commit` from the given reference. + * The resulting git_annotated_commit must be freed with + * `git_annotated_commit_free`. + * + * @param out pointer to store the git_annotated_commit result in + * @param repo repository that contains the given reference + * @param ref reference to use to lookup the git_annotated_commit + * @return 0 on success or error code + */ +GIT_EXTERN(int) git_annotated_commit_from_ref( + git_annotated_commit **out, + git_repository *repo, + const git_reference *ref); + +/** + * Creates a `git_annotated_commit` from the given fetch head data. + * The resulting git_annotated_commit must be freed with + * `git_annotated_commit_free`. + * + * @param out pointer to store the git_annotated_commit result in + * @param repo repository that contains the given commit + * @param branch_name name of the (remote) branch + * @param remote_url url of the remote + * @param id the commit object id of the remote branch + * @return 0 on success or error code + */ +GIT_EXTERN(int) git_annotated_commit_from_fetchhead( + git_annotated_commit **out, + git_repository *repo, + const char *branch_name, + const char *remote_url, + const git_oid *id); + +/** + * Creates a `git_annotated_commit` from the given commit id. + * The resulting git_annotated_commit must be freed with + * `git_annotated_commit_free`. + * + * An annotated commit contains information about how it was + * looked up, which may be useful for functions like merge or + * rebase to provide context to the operation. For example, + * conflict files will include the name of the source or target + * branches being merged. It is therefore preferable to use the + * most specific function (eg `git_annotated_commit_from_ref`) + * instead of this one when that data is known. + * + * @param out pointer to store the git_annotated_commit result in + * @param repo repository that contains the given commit + * @param id the commit object id to lookup + * @return 0 on success or error code + */ +GIT_EXTERN(int) git_annotated_commit_lookup( + git_annotated_commit **out, + git_repository *repo, + const git_oid *id); + +/** + * Creates a `git_annotated_comit` from a revision string. + * + * See `man gitrevisions`, or + * http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for + * information on the syntax accepted. + * + * @param out pointer to store the git_annotated_commit result in + * @param repo repository that contains the given commit + * @param revspec the extended sha syntax string to use to lookup the commit + * @return 0 on success or error code + */ +GIT_EXTERN(int) git_annotated_commit_from_revspec( + git_annotated_commit **out, + git_repository *repo, + const char *revspec); + +/** + * Gets the commit ID that the given `git_annotated_commit` refers to. + * + * @param commit the given annotated commit + * @return commit id + */ +GIT_EXTERN(const git_oid *) git_annotated_commit_id( + const git_annotated_commit *commit); + +/** + * Get the refname that the given `git_annotated_commit` refers to. + * + * @param commit the given annotated commit + * @return ref name. + */ +GIT_EXTERN(const char *) git_annotated_commit_ref( + const git_annotated_commit *commit); + +/** + * Frees a `git_annotated_commit`. + * + * @param commit annotated commit to free + */ +GIT_EXTERN(void) git_annotated_commit_free( + git_annotated_commit *commit); + +/** @} */ +GIT_END_DECL +#endif
  17. Download patch debian/libgit2/cmake/Modules/FindGSSAPI.cmake
  18. Download patch debian/libgit2/AUTHORS

    --- 0.43.1-3/debian/libgit2/AUTHORS 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/AUTHORS 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,78 @@ +The following people contribute or have contributed +to the libgit2 project (sorted alphabetically): + +Alex Budovski +Alexei Sholik +Andreas Ericsson +Anton "antong" Gyllenberg +Ankur Sethi +Arthur Schreiber +Ben Noordhuis +Ben Straub +Benjamin C Meyer +Brian Downing +Brian Lopez +Carlos Martín Nieto +Colin Timmermans +Daniel Huckstep +Dave Borowitz +David Boyce +David Glesser +Dmitry Kakurin +Dmitry Kovega +Emeric Fermas +Emmanuel Rodriguez +Eric Myhre +Erik Aigner +Florian Forster +Holger Weiss +Ingmar Vanhassel +J. David Ibáñez +Jacques Germishuys +Jakob Pfender +Jason Penny +Jason R. McNeil +Jerome Lambourg +Johan 't Hart +John Wiegley +Jonathan "Duke" Leto +Julien Miotte +Julio Espinoza-Sokal +Justin Love +Kelly "kelly.leahy" Leahy +Kirill A. Shutemov +Lambert CLARA +Luc Bertrand +Marc Pegon +Marcel Groothuis +Marco Villegas +Michael "schu" Schubert +Microsoft Corporation +Olivier Ramonat +Peter Drahoš +Pierre Habouzit +Pierre-Olivier Latour +Przemyslaw Pawelczyk +Ramsay Jones +Robert G. Jakabosky +Romain Geissler +Romain Muller +Russell Belfer +Sakari Jokinen +Samuel Charles "Sam" Day +Sarath Lakshman +Sascha Cunz +Sascha Peilicke +Scott Chacon +Sebastian Schuberth +Sergey Nikishin +Shawn O. Pearce +Shuhei Tanuma +Steve Frécinaux +Sven Strickroth +Tim Branyen +Tim Clem +Tim Harder +Torsten Bögershausen +Trent Mick +Vicent Marti
  19. Download patch debian/libgit2/include/git2/ignore.h

    --- 0.43.1-3/debian/libgit2/include/git2/ignore.h 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/include/git2/ignore.h 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_ignore_h__ +#define INCLUDE_git_ignore_h__ + +#include "common.h" +#include "types.h" + +GIT_BEGIN_DECL + +/** + * Add ignore rules for a repository. + * + * Excludesfile rules (i.e. .gitignore rules) are generally read from + * .gitignore files in the repository tree or from a shared system file + * only if a "core.excludesfile" config value is set. The library also + * keeps a set of per-repository internal ignores that can be configured + * in-memory and will not persist. This function allows you to add to + * that internal rules list. + * + * Example usage: + * + * error = git_ignore_add_rule(myrepo, "*.c\ndir/\nFile with space\n"); + * + * This would add three rules to the ignores. + * + * @param repo The repository to add ignore rules to. + * @param rules Text of rules, a la the contents of a .gitignore file. + * It is okay to have multiple rules in the text; if so, + * each rule should be terminated with a newline. + * @return 0 on success + */ +GIT_EXTERN(int) git_ignore_add_rule( + git_repository *repo, + const char *rules); + +/** + * Clear ignore rules that were explicitly added. + * + * Resets to the default internal ignore rules. This will not turn off + * rules in .gitignore files that actually exist in the filesystem. + * + * The default internal ignores ignore ".", ".." and ".git" entries. + * + * @param repo The repository to remove ignore rules from. + * @return 0 on success + */ +GIT_EXTERN(int) git_ignore_clear_internal_rules( + git_repository *repo); + +/** + * Test if the ignore rules apply to a given path. + * + * This function checks the ignore rules to see if they would apply to the + * given file. This indicates if the file would be ignored regardless of + * whether the file is already in the index or committed to the repository. + * + * One way to think of this is if you were to do "git check-ignore --no-index" + * on the given file, would it be shown or not? + * + * @param ignored boolean returning 0 if the file is not ignored, 1 if it is + * @param repo a repository object + * @param path the file to check ignores for, relative to the repo's workdir. + * @return 0 if ignore rules could be processed for the file (regardless + * of whether it exists or not), or an error < 0 if they could not. + */ +GIT_EXTERN(int) git_ignore_path_is_ignored( + int *ignored, + git_repository *repo, + const char *path); + +GIT_END_DECL + +#endif
  20. Download patch debian/libgit2/cmake/Modules/FindGSSFramework.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/FindGSSFramework.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/FindGSSFramework.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,28 @@ +# Find GSS.framework +# This will define : +# +# GSSFRAMEWORK_FOUND +# GSSFRAMEWORK_INCLUDE_DIR +# GSSFRAMEWORK_LIBRARIES +# GSSFRAMEWORK_LDFLAGS +# + +FIND_PATH(GSSFRAMEWORK_INCLUDE_DIR NAMES GSS.h) +FIND_LIBRARY(GSSFRAMEWORK_LIBRARIES NAMES GSS) +IF (GSSFRAMEWORK_INCLUDE_DIR AND GSSFRAMEWORK_LIBRARIES) + IF (NOT CoreFoundation_FIND_QUIETLY) + MESSAGE(STATUS "Found GSS.framework ${GSSFRAMEWORK_LIBRARIES}") + ENDIF() + SET(GSSFRAMEWORK_FOUND TRUE) + SET(GSSFRAMEWORK_LDFLAGS "-framework GSS") +ENDIF () + +IF (GSS_FIND_REQUIRED AND NOT GSSFRAMEWORK_FOUND) + MESSAGE(FATAL_ERROR "CoreFoundation not found") +ENDIF() + +MARK_AS_ADVANCED( + GSSFRAMEWORK_INCLUDE_DIR + GSSFRAMEWORK_LIBRARIES + GSSFRAMEWORK_LDFLAGS +)
  21. Download patch debian/libgit2/azure-pipelines/docker/entrypoint.sh

    --- 0.43.1-3/debian/libgit2/azure-pipelines/docker/entrypoint.sh 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/azure-pipelines/docker/entrypoint.sh 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,4 @@ +#!/bin/bash -e +useradd --shell /bin/bash libgit2 +chown --recursive libgit2:libgit2 /home/libgit2 +exec sudo --preserve-env --set-home --user=libgit2 "$@"
  22. Download patch debian/libgit2/include/git2/index.h
  23. Download patch debian/libgit2/include/git2/filter.h
  24. Download patch debian/libgit2/cmake/Modules/FindIconv.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/FindIconv.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/FindIconv.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,45 @@ +# - Try to find Iconv +# Once done this will define +# +# ICONV_FOUND - system has Iconv +# ICONV_INCLUDE_DIR - the Iconv include directory +# ICONV_LIBRARIES - Link these to use Iconv +# + +IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + # Already in cache, be silent + SET(ICONV_FIND_QUIETLY TRUE) +ENDIF() + +FIND_PATH(ICONV_INCLUDE_DIR iconv.h) +CHECK_FUNCTION_EXISTS(iconv_open libc_has_iconv) +FIND_LIBRARY(iconv_lib NAMES iconv libiconv libiconv-2 c) + +IF(ICONV_INCLUDE_DIR AND libc_has_iconv) + SET(ICONV_FOUND TRUE) + SET(ICONV_LIBRARIES "") + IF(NOT ICONV_FIND_QUIETLY) + MESSAGE(STATUS "Found Iconv: provided by libc") + ENDIF(NOT ICONV_FIND_QUIETLY) +ELSEIF(ICONV_INCLUDE_DIR AND iconv_lib) + SET(ICONV_FOUND TRUE) + # split iconv into -L and -l linker options, so we can + # set them for pkg-config + GET_FILENAME_COMPONENT(iconv_path ${iconv_lib} PATH) + GET_FILENAME_COMPONENT(iconv_name ${iconv_lib} NAME_WE) + STRING(REGEX REPLACE "^lib" "" iconv_name ${iconv_name}) + SET(ICONV_LIBRARIES "-L${iconv_path} -l${iconv_name}") + + IF(NOT ICONV_FIND_QUIETLY) + MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}") + ENDIF(NOT ICONV_FIND_QUIETLY) +ELSE() + IF(Iconv_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Iconv") + ENDIF(Iconv_FIND_REQUIRED) +ENDIF() + +MARK_AS_ADVANCED( + ICONV_INCLUDE_DIR + ICONV_LIBRARIES +)
  25. Download patch debian/libgit2/docs/contributing.md

    --- 0.43.1-3/debian/libgit2/docs/contributing.md 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/docs/contributing.md 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,184 @@ +# Welcome to libgit2! + +We're making it easy to do interesting things with git, and we'd love to have +your help. + +## Licensing + +By contributing to libgit2, you agree to release your contribution under +the terms of the license. Except for the `examples` and the +`deps` directories, all code is released under the [GPL v2 with +linking exception](../COPYING). + +The `examples` code is governed by the +[CC0 Public Domain Dedication](../examples/COPYING), so that you may copy +from them into your own application. + +The bundled dependencies in the `deps` directories are governed +by the following licenses: + +- http-parser is licensed under [MIT license](../deps/http-parser/COPYING) +- regex is governed by [LGPL v2.1+ license](../deps/regex/COPYING) +- winhttp is governed by [LGPL v2.1+](../deps/winhttp/COPYING.LGPL) and [GPL v2 with linking exception](../deps/winhttp/COPYING.GPL) +- zlib is governed by [zlib license](../deps/zlib/COPYING) + +## Discussion & Chat + +We hang out in the +[`#libgit2`](http://webchat.freenode.net/?channels=#libgit2)) channel on +irc.freenode.net. + +Also, feel free to open an +[Issue](https://github.com/libgit2/libgit2/issues/new) to start a discussion +about any concerns you have. We like to use Issues for that so there is an +easily accessible permanent record of the conversation. + +## Libgit2 Versions + +The `master` branch is the main branch where development happens. +Releases are tagged +(e.g. [v0.21.0](https://github.com/libgit2/libgit2/releases/tag/v0.21.0) ) +and when a critical bug fix needs to be backported, it will be done on a +`<tag>-maint` maintenance branch. + +## Reporting Bugs + +First, know which version of libgit2 your problem is in and include it in +your bug report. This can either be a tag (e.g. +[v0.17.0](https://github.com/libgit2/libgit2/releases/tag/v0.17.0)) or a +commit SHA +(e.g. [01be7863](https://github.com/libgit2/libgit2/commit/01be7863)). +Using [`git describe`](http://git-scm.com/docs/git-describe) is a +great way to tell us what version you're working with. + +If you're not running against the latest `master` branch version, +please compile and test against that to avoid re-reporting an issue that's +already been fixed. + +It's *incredibly* helpful to be able to reproduce the problem. Please +include a list of steps, a bit of code, and/or a zipped repository (if +possible). Note that some of the libgit2 developers are employees of +GitHub, so if your repository is private, find us on IRC and we'll figure +out a way to help you. + +## Pull Requests + +Our work flow is a [typical GitHub +flow](https://guides.github.com/introduction/flow/index.html), where +contributors fork the [libgit2 repository](https://github.com/libgit2/libgit2), +make their changes on branch, and submit a +[Pull Request](https://help.github.com/articles/using-pull-requests) +(a.k.a. "PR"). Pull requests should usually be targeted at the `master` +branch. + +Life will be a lot easier for you (and us) if you follow this pattern +(i.e. fork, named branch, submit PR). If you use your fork's `master` +branch directly, things can get messy. + +Please include a nice description of your changes when you submit your PR; +if we have to read the whole diff to figure out why you're contributing +in the first place, you're less likely to get feedback and have your change +merged in. + +In addition to outlining your thought process in the PR's description, please +also try to document it in your commits. We welcome it if every commit has a +description of why you have been doing your changes alongside with your +reasoning why this is a good idea. The messages shall be written in +present-tense and in an imperative style (e.g. "Add feature foobar", not "Added +feature foobar" or "Adding feature foobar"). Lines should be wrapped at 80 +characters so people with small screens are able to read the commit messages in +their terminal without any problem. + +To make it easier to attribute commits to certain parts of our code base, we +also prefer to have the commit subject be prefixed with a "scope". E.g. if you +are changing code in our merging subsystem, make sure to prefix the subject with +"merge:". The first word following the colon shall start with an lowercase +letter. The maximum line length for the subject is 70 characters, preferably +shorter. + +If you are starting to work on a particular area, feel free to submit a PR +that highlights your work in progress (and note in the PR title that it's +not ready to merge). These early PRs are welcome and will help in getting +visibility for your fix, allow others to comment early on the changes and +also let others know that you are currently working on something. + +Before wrapping up a PR, you should be sure to: + +* Write tests to cover any functional changes +* Update documentation for any changed public APIs +* Add to the [`changelog.md`](changelog.md) file describing any major changes + +## Unit Tests + +We believe that our unit tests allow us to keep the quality of libgit2 +high: any new changes must not cause unit test failures, and new changes +should include unit tests that cover the bug fixes or new features. +For bug fixes, we prefer unit tests that illustrate the failure before +the change, but pass with your changes. + +In addition to new tests, please ensure that your changes do not cause +any other test failures. Running the entire test suite is helpful +before you submit a pull request. When you build libgit2, the test +suite will also be built. You can run most of the tests by simply running +the resultant `libgit2_clar` binary. If you want to run a specific +unit test, you can name it with the `-s` option. For example: + + libgit2_clar -sstatus::worktree::long_filenames + +Or you can run an entire class of tests. For example, to run all the +worktree status tests: + + libgit2_clar -sstatus::worktree + +The default test run is fairly exhaustive, but it will exclude some +unit tests by default: in particular, those that talk to network +servers and the tests that manipulate the filesystem in onerous +ways (and may need to have special privileges to run). To run the +network tests: + + libgit2_clar -ionline + +In addition, various tests may be enabled by environment variables, +like the ones that write exceptionally large repositories or manipulate +the filesystem structure in unexpected ways. These tests *may be +dangerous* to run on a normal machine and may harm your filesystem. It's +not recommended that you run these; instead, the continuous integration +servers will run these (in a sandbox). + +## Porting Code From Other Open-Source Projects + +`libgit2` is licensed under the terms of the GPL v2 with a linking +exception. Any code brought in must be compatible with those terms. + +The most common case is porting code from core Git. Git is a pure GPL +project, which means that in order to port code to this project, we need the +explicit permission of the author. Check the +[`git.git-authors`](https://github.com/libgit2/libgit2/blob/development/git.git-authors) +file for authors who have already consented. + +Other licenses have other requirements; check the license of the library +you're porting code *from* to see what you need to do. As a general rule, +MIT and BSD (3-clause) licenses are typically no problem. Apache 2.0 +license typically doesn't work due to GPL incompatibility. + +If your pull request uses code from core Git, another project, or code +from a forum / Stack Overflow, then *please* flag this in your PR and make +sure you've given proper credit to the original author in the code +snippet. + +## Style Guide + +The public API of `libgit2` is [ANSI C](http://en.wikipedia.org/wiki/ANSI_C) +(a.k.a. C89) compatible. Internally, `libgit2` is written using a portable +subset of C99 - in order to compile with GCC, Clang, MSVC, etc., we keep +local variable declarations at the tops of blocks only and avoid `//` style +comments. Additionally, `libgit2` follows some extra conventions for +function and type naming, code formatting, and testing. + +We like to keep the source code consistent and easy to read. Maintaining +this takes some discipline, but it's been more than worth it. Take a look +at the [conventions file](conventions.md). + +## Starter Projects + +See our [projects list](projects.md).
  26. Download patch debian/libgit2/azure-pipelines/coverity.sh

    --- 0.43.1-3/debian/libgit2/azure-pipelines/coverity.sh 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/azure-pipelines/coverity.sh 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,62 @@ +#!/bin/bash -e + +if test -z "$COVERITY_TOKEN" +then + echo "Need to set a coverity token" + exit 1 +fi + +case $(uname -m) in + i?86) + BITS=32;; + amd64|x86_64) + BITS=64;; + *) + echo "Unsupported arch '$(uname -m)'" + exit 1;; +esac + +SCAN_TOOL=https://scan.coverity.com/download/cxx/linux${BITS} +SOURCE_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")"/..) +BUILD_DIR=${SOURCE_DIR}/coverity-build +TOOL_DIR=${BUILD_DIR}/coverity-tools + +# Install coverity tools +if ! test -d "$TOOL_DIR" +then + mkdir -p "$TOOL_DIR" + curl --silent --show-error --location --data "project=libgit2&token=$COVERITY_TOKEN" "$SCAN_TOOL" | + tar -xzC "$TOOL_DIR" + ln -s "$(find "$TOOL_DIR" -type d -name 'cov-analysis*')" "$TOOL_DIR"/cov-analysis +fi + +cp "${SOURCE_DIR}/script/user_nodefs.h" "$TOOL_DIR"/cov-analysis/config/ + +# Build libgit2 with Coverity +mkdir -p "$BUILD_DIR" +cd "$BUILD_DIR" +cmake "$SOURCE_DIR" +COVERITY_UNSUPPORTED=1 \ + "$TOOL_DIR/cov-analysis/bin/cov-build" --dir cov-int \ + cmake --build . + +# Upload results +tar -czf libgit2.tgz cov-int +REVISION=$(cd ${SOURCE_DIR} && git rev-parse --short HEAD) +HTML="$(curl \ + --silent --show-error \ + --write-out "\n%{http_code}" \ + --form token="$COVERITY_TOKEN" \ + --form email=libgit2@gmail.com \ + --form file=@libgit2.tgz \ + --form version="$REVISION" \ + --form description="libgit2 build" \ + https://scan.coverity.com/builds?project=libgit2)" + +# Status code is the last line +STATUS_CODE="$(echo "$HTML" | tail -n1)" +if test "${STATUS_CODE}" != 200 && test "${STATUS_CODE}" != 201 +then + echo "Received error code ${STATUS_CODE} from Coverity" + exit 1 +fi
  27. Download patch debian/libgit2/include/git2/config.h
  28. Download patch crates/crates-io/lib.rs

    --- 0.43.1-3/crates/crates-io/lib.rs 2020-03-17 14:23:20.000000000 +0000 +++ 0.44.1-0ubuntu1/crates/crates-io/lib.rs 2020-05-04 02:09:09.000000000 +0000 @@ -11,7 +11,6 @@ use anyhow::{bail, Result}; use curl::easy::{Easy, List}; use percent_encoding::{percent_encode, NON_ALPHANUMERIC}; use serde::{Deserialize, Serialize}; -use serde_json; use url::Url; pub struct Registry {
  29. Download patch debian/libgit2/include/git2/credential_helpers.h

    --- 0.43.1-3/debian/libgit2/include/git2/credential_helpers.h 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/include/git2/credential_helpers.h 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_credential_helpers_h__ +#define INCLUDE_git_credential_helpers_h__ + +#include "transport.h" + +/** + * @file git2/credential_helpers.h + * @brief Utility functions for credential management + * @defgroup git_credential_helpers credential management helpers + * @ingroup Git + * @{ + */ +GIT_BEGIN_DECL + +/** + * Payload for git_credential_userpass_plaintext. + */ +typedef struct git_credential_userpass_payload { + const char *username; + const char *password; +} git_credential_userpass_payload; + + +/** + * Stock callback usable as a git_credential_acquire_cb. This calls + * git_cred_userpass_plaintext_new unless the protocol has not specified + * `GIT_CREDENTIAL_USERPASS_PLAINTEXT` as an allowed type. + * + * @param out The newly created credential object. + * @param url The resource for which we are demanding a credential. + * @param user_from_url The username that was embedded in a "user\@host" + * remote url, or NULL if not included. + * @param allowed_types A bitmask stating which credential types are OK to return. + * @param payload The payload provided when specifying this callback. (This is + * interpreted as a `git_credential_userpass_payload*`.) + */ +GIT_EXTERN(int) git_credential_userpass( + git_credential **out, + const char *url, + const char *user_from_url, + unsigned int allowed_types, + void *payload); + +/** @} */ +GIT_END_DECL +#endif
  30. Download patch debian/libgit2/include/git2/commit.h
  31. Download patch debian/control

    --- 0.43.1-3/debian/control 2020-04-18 18:32:51.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/control 2020-05-28 00:06:34.000000000 +0000 @@ -1,6 +1,7 @@ Source: cargo Section: devel -Maintainer: Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> Uploaders: Luca Bruno <lucab@debian.org>, Angus Lees <gus@debian.org>, Ximin Luo <infinity0@debian.org>, @@ -18,8 +19,8 @@ Build-Depends: debhelper (>= 12~), python3:native, libcurl4-gnutls-dev | libcurl4-openssl-dev, libssh2-1-dev, - libgit2-dev (>= 0.27), libhttp-parser-dev, + libpcre3-dev, libssl-dev, zlib1g-dev, git <!nocheck>
  32. Download patch debian/libgit2/azure-pipelines/docker/docurium

    --- 0.43.1-3/debian/libgit2/azure-pipelines/docker/docurium 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/azure-pipelines/docker/docurium 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,3 @@ +FROM ubuntu:bionic +RUN apt update && apt install -y cmake pkg-config ruby ruby-dev llvm libclang-dev libssl-dev python-pygments +RUN gem install docurium
  33. Download patch ci/azure-test-all.yml

    --- 0.43.1-3/ci/azure-test-all.yml 2020-03-17 14:23:20.000000000 +0000 +++ 0.44.1-0ubuntu1/ci/azure-test-all.yml 2020-05-04 02:09:09.000000000 +0000 @@ -16,6 +16,10 @@ steps: - bash: rustup component add clippy || echo "clippy not available" displayName: "Install clippy (maybe)" +# Some tests also rely on rustfmt +- bash: rustup component add rustfmt || echo "rustfmt not available" + displayName: "Install rustfmt (maybe)" + # Deny warnings on CI to avoid warnings getting into the codebase, and note the # `force-system-lib-on-osx` which is intended to fix compile issues on OSX where # compiling curl from source on OSX yields linker errors on Azure.
  34. Download patch debian/libgit2/docs/changelog.md
  35. Download patch debian/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,96 @@ +# - Check if the protoype we expect is correct. +# check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER VARIABLE) +# FUNCTION - The name of the function (used to check if prototype exists) +# PROTOTYPE- The prototype to check. +# RETURN - The return value of the function. +# HEADER - The header files required. +# VARIABLE - The variable to store the result. +# Example: +# check_prototype_definition(getpwent_r +# "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)" +# "NULL" +# "unistd.h;pwd.h" +# SOLARIS_GETPWENT_R) +# The following variables may be set before calling this macro to +# modify the way the check is run: +# +# CMAKE_REQUIRED_FLAGS = string of compile command line flags +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) +# CMAKE_REQUIRED_INCLUDES = list of include directories +# CMAKE_REQUIRED_LIBRARIES = list of libraries to link + +#============================================================================= +# Copyright 2005-2009 Kitware, Inc. +# Copyright 2010-2011 Andreas Schneider <asn@cryptomilk.org> +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) +# + +get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) + +function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE) + + if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$") + set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n") + + set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS}) + if (CMAKE_REQUIRED_LIBRARIES) + set(CHECK_PROTOTYPE_DEFINITION_LIBS + "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + else(CMAKE_REQUIRED_LIBRARIES) + set(CHECK_PROTOTYPE_DEFINITION_LIBS) + endif(CMAKE_REQUIRED_LIBRARIES) + if (CMAKE_REQUIRED_INCLUDES) + set(CMAKE_SYMBOL_EXISTS_INCLUDES + "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") + else(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_SYMBOL_EXISTS_INCLUDES) + endif(CMAKE_REQUIRED_INCLUDES) + + foreach(_FILE ${_HEADER}) + set(CHECK_PROTOTYPE_DEFINITION_HEADER + "${CHECK_PROTOTYPE_DEFINITION_HEADER}#include <${_FILE}>\n") + endforeach(_FILE) + + set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION}) + set(CHECK_PROTOTYPE_DEFINITION_PROTO ${_PROTOTYPE}) + set(CHECK_PROTOTYPE_DEFINITION_RETURN ${_RETURN}) + + configure_file("${__check_proto_def_dir}/CheckPrototypeDefinition.c.in" + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c" @ONLY) + + file(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c _SOURCE) + + try_compile(${_VARIABLE} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c + COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CHECK_PROTOTYPE_DEFINITION_FLAGS} + "${CHECK_PROTOTYPE_DEFINITION_LIBS}" + "${CMAKE_SYMBOL_EXISTS_INCLUDES}" + OUTPUT_VARIABLE OUTPUT) + + if (${_VARIABLE}) + set(${_VARIABLE} 1 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}") + message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - True") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n" + "${OUTPUT}\n\n") + else (${_VARIABLE}) + message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False") + set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n" + "${OUTPUT}\n\n${_SOURCE}\n\n") + endif (${_VARIABLE}) + endif("${_VARIABLE}" MATCHES "^${_VARIABLE}$") + +endfunction(CHECK_PROTOTYPE_DEFINITION)
  36. Download patch debian/libgit2/include/git2/diff.h
  37. Download patch debian/libgit2/include/git2/clone.h
  38. Download patch debian/libgit2/git.git-authors

    --- 0.43.1-3/debian/libgit2/git.git-authors 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/git.git-authors 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,77 @@ +# This document lists the authors that have given voice to +# their decision regarding relicensing the GPL'd code from +# git.git to the GPL + gcc-exception license used by libgit2. +# +# Note that the permission is given for libgit2 use only. For +# other uses, you must ask each of the contributors yourself. +# +# To show the owners of a file in git.git, one can run the +# following command: +# +# git blame -C -C -M -- file | \ +# sed -e 's/[^(]*(\([^0-9]*\).*/\1/' -e 's/[\t ]*$//' | \ +# sort | uniq -c | sort -nr +# +# If everyone on the list that produces are on the list in +# the recently added file "git.git-authors", it *should* be +# safe to include that code in libgit2, but make sure to +# read the file to ensure the code doesn't originate from +# somewhere else. +# +# The format of this list is +# "ok/no/ask/???"<tab>"Author"<space>"<email>" +# +# "ok" means the author consents to relicensing all their +# contributed code (possibly with some exceptions) +# "no" means the author does not consent +# "ask" means that the contributor wants to give/withhold +# his/her consent on a patch-by-patch basis. +# "???" means the person is a prominent contributor who has +# not yet made his/her standpoint clear. +# +# Please try to keep the list alphabetically ordered. It will +# help in case we get all 600-ish git.git authors on it. +# +# (Paul Kocher is the author of the mozilla-sha1 implementation +# but has otherwise not contributed to git.) +# +ok Adam Simpkins <adam@adamsimpkins.net> (http transport) +ok Adrian Johnson <ajohnson@redneon.com> +ok Alexey Shumkin <alex.crezoff@gmail.com> +ok Andreas Ericsson <ae@op5.se> +ok Antoine Pelisse <apelisse@gmail.com> +ok Boyd Lynn Gerber <gerberb@zenez.com> +ok Brandon Casey <drafnel@gmail.com> +ok Brian Downing <bdowning@lavos.net> +ok Brian Gernhardt <benji@silverinsanity.com> +ok Christian Couder <chriscool@tuxfamily.org> +ok Daniel Barkalow <barkalow@iabervon.org> +ok Elijah Newren <newren@gmail.com> +ok Florian Forster <octo@verplant.org> +ok Gustaf Hendeby <hendeby@isy.liu.se> +ok Holger Weiss <holger@zedat.fu-berlin.de> +ok Jeff King <peff@peff.net> +ok Johannes Schindelin <Johannes.Schindelin@gmx.de> +ok Johannes Sixt <j6t@kdbg.org> +ask Jonathan Nieder <jrnieder@gmail.com> +ok Jonathan Tan <jonathantanmy@google.com> +ok Junio C Hamano <gitster@pobox.com> +ok Kristian Høgsberg <krh@redhat.com> +ok Linus Torvalds <torvalds@linux-foundation.org> +ok Lukas Sandström <lukass@etek.chalmers.se> +ok Matthieu Moy <Matthieu.Moy@imag.fr> +ok Michael Haggerty <mhagger@alum.mit.edu> +ok Nicolas Pitre <nico@fluxnic.net> <nico@cam.org> +ok Paolo Bonzini <bonzini@gnu.org> +ok Paul Kocher <paul@cryptography.com> +ok Peter Hagervall <hager@cs.umu.se> +ok Petr Onderka <gsvick@gmail.com> +ok Pierre Habouzit <madcoder@debian.org> +ok Pieter de Bie <pdebie@ai.rug.nl> +ok René Scharfe <rene.scharfe@lsrfire.ath.cx> +ok Sebastian Schuberth <sschuberth@gmail.com> +ok Shawn O. Pearce <spearce@spearce.org> +ok Steffen Prohaska <prohaska@zib.de> +ok Sven Verdoolaege <skimo@kotnet.org> +ask Thomas Rast <tr@thomasrast.ch> (ok before 6-Oct-2013) +ok Torsten Bögershausen <tboegi@web.de>
  39. Download patch debian/libgit2/azure-pipelines.yml

    --- 0.43.1-3/debian/libgit2/azure-pipelines.yml 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/azure-pipelines.yml 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,190 @@ +resources: +- repo: self + +trigger: +- master +- maint/* + +jobs: +- job: linux_amd64_xenial_gcc_openssl + displayName: 'Linux (amd64; Xenial; GCC; OpenSSL)' + pool: + vmImage: 'ubuntu-18.04' + steps: + - template: azure-pipelines/docker.yml + parameters: + docker: + image: xenial + base: ubuntu:xenial + environmentVariables: | + CC=gcc + CMAKE_GENERATOR=Ninja + CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON + GITTEST_NEGOTIATE_PASSWORD=${{ variables.GITTEST_NEGOTIATE_PASSWORD }} + +- job: linux_amd64_xenial_gcc_mbedtls + displayName: 'Linux (amd64; Xenial; GCC; mbedTLS)' + pool: + vmImage: 'ubuntu-18.04' + steps: + - template: azure-pipelines/docker.yml + parameters: + docker: + image: xenial + base: ubuntu:xenial + environmentVariables: | + CC=gcc + CMAKE_GENERATOR=Ninja + CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON + GITTEST_NEGOTIATE_PASSWORD=${{ variables.GITTEST_NEGOTIATE_PASSWORD }} + +- job: linux_amd64_xenial_clang_openssl + displayName: 'Linux (amd64; Xenial; Clang; OpenSSL)' + pool: + vmImage: 'ubuntu-18.04' + steps: + - template: azure-pipelines/docker.yml + parameters: + docker: + image: xenial + base: ubuntu:xenial + environmentVariables: | + CC=clang + CMAKE_GENERATOR=Ninja + CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON + GITTEST_NEGOTIATE_PASSWORD=${{ variables.GITTEST_NEGOTIATE_PASSWORD }} + +- job: linux_amd64_xenial_clang_mbedtls + displayName: 'Linux (amd64; Xenial; Clang; mbedTLS)' + pool: + vmImage: 'ubuntu-18.04' + steps: + - template: azure-pipelines/docker.yml + parameters: + docker: + image: xenial + base: ubuntu:xenial + environmentVariables: | + CC=clang + CMAKE_GENERATOR=Ninja + CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON + GITTEST_NEGOTIATE_PASSWORD=${{ variables.GITTEST_NEGOTIATE_PASSWORD }} + +- job: macos + displayName: 'macOS (amd64; 10.15)' + pool: + vmImage: 'macOS-10.15' + steps: + - bash: . '$(Build.SourcesDirectory)/azure-pipelines/setup-osx.sh' + displayName: Setup + - template: azure-pipelines/bash.yml + parameters: + environmentVariables: + TMPDIR: $(Agent.TempDirectory) + PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig + CMAKE_GENERATOR: Ninja + CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON + SKIP_SSH_TESTS: true + GITTEST_NEGOTIATE_PASSWORD: ${{ variables.GITTEST_NEGOTIATE_PASSWORD }} + +- job: windows_vs_amd64 + displayName: 'Windows (amd64; Visual Studio)' + pool: + vmImage: 'vs2017-win2016' + steps: + - template: azure-pipelines/bash.yml + parameters: + environmentVariables: + CMAKE_GENERATOR: Visual Studio 15 2017 + CMAKE_OPTIONS: -A x64 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON + SKIP_SSH_TESTS: true + SKIP_NEGOTIATE_TESTS: true + +- job: windows_vs_x86 + displayName: 'Windows (x86; Visual Studio)' + pool: + vmImage: 'vs2017-win2016' + steps: + - template: azure-pipelines/bash.yml + parameters: + environmentVariables: + CMAKE_GENERATOR: Visual Studio 15 2017 + CMAKE_OPTIONS: -A Win32 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS + SKIP_SSH_TESTS: true + SKIP_NEGOTIATE_TESTS: true + +- job: windows_mingw_amd64 + displayName: 'Windows (amd64; MinGW)' + pool: + vmImage: 'vs2017-win2016' + steps: + - bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh' + displayName: Setup + env: + TEMP: $(Agent.TempDirectory) + ARCH: amd64 + - template: azure-pipelines/bash.yml + parameters: + environmentVariables: + BUILD_PATH: $(Agent.TempDirectory)\mingw64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin + CMAKE_GENERATOR: MinGW Makefiles + CMAKE_OPTIONS: -DDEPRECATE_HARD=ON + SKIP_SSH_TESTS: true + SKIP_NEGOTIATE_TESTS: true + +- job: windows_mingw_x86 + displayName: 'Windows (x86; MinGW)' + pool: + vmImage: 'vs2017-win2016' + steps: + - bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh' + displayName: Setup + workingDirectory: '$(Build.BinariesDirectory)' + env: + TEMP: $(Agent.TempDirectory) + ARCH: x86 + - template: azure-pipelines/bash.yml + parameters: + environmentVariables: + BUILD_PATH: $(Agent.TempDirectory)\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin + CMAKE_GENERATOR: MinGW Makefiles + CMAKE_OPTIONS: -DDEPRECATE_HARD=ON + SKIP_SSH_TESTS: true + SKIP_NEGOTIATE_TESTS: true + +- job: documentation + displayName: 'Generate Documentation' + pool: + vmImage: 'ubuntu-18.04' + steps: + - script: | + cd $(Build.SourcesDirectory)/azure-pipelines/docker + docker build -t libgit2/docurium --build-arg BASE=ubuntu:trusty -f docurium . + displayName: 'Build Docker image' + - script: | + git config user.name 'Documentation Generation' + git config user.email 'libgit2@users.noreply.github.com' + git branch gh-pages origin/gh-pages + docker run --rm -v $(Build.SourcesDirectory):/home/libgit2/source -w /home/libgit2/source libgit2/docurium:latest cm doc api.docurium + git checkout gh-pages + cp -R * '$(Build.BinariesDirectory)' + displayName: 'Generate Documentation' + - task: archivefiles@2 + displayName: 'Archive Documentation' + inputs: + rootFolderOrFile: '$(Build.BinariesDirectory)' + includeRootFolder: false + archiveFile: '$(Build.ArtifactStagingDirectory)/api-documentation.zip' + - task: publishbuildartifacts@1 + displayName: 'Upload Documentation Artifact' + inputs: + pathToPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: 'docs' + - script: | + git remote -v + echo 'machine github.com' > ~/.netrc + echo 'login $(GITHUB_USERNAME)' >> ~/.netrc + echo 'password $(GITHUB_PAT)' >> ~/.netrc + git push origin gh-pages + displayName: 'Publish Documentation' + condition: and(eq(variables['Build.Repository.Name'], 'libgit2/libgit2'), eq(variables['Build.Reason'], 'IndividualCI'))
  40. Download patch debian/libgit2/azure-pipelines/setup-mingw.sh

    --- 0.43.1-3/debian/libgit2/azure-pipelines/setup-mingw.sh 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/azure-pipelines/setup-mingw.sh 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,15 @@ +#!/bin/sh -e + +echo "##############################################################################" +echo "## Downloading mingw" +echo "##############################################################################" + +case "$ARCH" in + amd64) + MINGW_URI="https://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-x86_64-8.1.0-release-win32-seh-rt_v6-rev0.zip";; + x86) + MINGW_URI="https://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-i686-8.1.0-release-win32-sjlj-rt_v6-rev0.zip";; +esac + +curl -s -L "$MINGW_URI" -o "$TEMP"/mingw-"$ARCH".zip +unzip -q "$TEMP"/mingw-"$ARCH".zip -d "$TEMP"
  41. Download patch debian/libgit2/azure-pipelines/nightly.yml
  42. Download patch debian/libgit2/include/git2/deprecated.h
  43. Download patch debian/libgit2/include/git2/common.h
  44. Download patch debian/libgit2/include/git2/graph.h

    --- 0.43.1-3/debian/libgit2/include/git2/graph.h 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/include/git2/graph.h 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_graph_h__ +#define INCLUDE_git_graph_h__ + +#include "common.h" +#include "types.h" +#include "oid.h" + +/** + * @file git2/graph.h + * @brief Git graph traversal routines + * @defgroup git_revwalk Git graph traversal routines + * @ingroup Git + * @{ + */ +GIT_BEGIN_DECL + +/** + * Count the number of unique commits between two commit objects + * + * There is no need for branches containing the commits to have any + * upstream relationship, but it helps to think of one as a branch and + * the other as its upstream, the `ahead` and `behind` values will be + * what git would report for the branches. + * + * @param ahead number of unique from commits in `upstream` + * @param behind number of unique from commits in `local` + * @param repo the repository where the commits exist + * @param local the commit for local + * @param upstream the commit for upstream + */ +GIT_EXTERN(int) git_graph_ahead_behind(size_t *ahead, size_t *behind, git_repository *repo, const git_oid *local, const git_oid *upstream); + + +/** + * Determine if a commit is the descendant of another commit. + * + * Note that a commit is not considered a descendant of itself, in contrast + * to `git merge-base --is-ancestor`. + * + * @param commit a previously loaded commit. + * @param ancestor a potential ancestor commit. + * @return 1 if the given commit is a descendant of the potential ancestor, + * 0 if not, error code otherwise. + */ +GIT_EXTERN(int) git_graph_descendant_of( + git_repository *repo, + const git_oid *commit, + const git_oid *ancestor); + +/** @} */ +GIT_END_DECL +#endif
  45. Download patch debian/libgit2/include/git2/buffer.h

    --- 0.43.1-3/debian/libgit2/include/git2/buffer.h 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/include/git2/buffer.h 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,134 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_buf_h__ +#define INCLUDE_git_buf_h__ + +#include "common.h" + +/** + * @file git2/buffer.h + * @brief Buffer export structure + * + * @ingroup Git + * @{ + */ +GIT_BEGIN_DECL + +/** + * A data buffer for exporting data from libgit2 + * + * Sometimes libgit2 wants to return an allocated data buffer to the + * caller and have the caller take responsibility for freeing that memory. + * This can be awkward if the caller does not have easy access to the same + * allocation functions that libgit2 is using. In those cases, libgit2 + * will fill in a `git_buf` and the caller can use `git_buf_dispose()` to + * release it when they are done. + * + * A `git_buf` may also be used for the caller to pass in a reference to + * a block of memory they hold. In this case, libgit2 will not resize or + * free the memory, but will read from it as needed. + * + * Some APIs may occasionally do something slightly unusual with a buffer, + * such as setting `ptr` to a value that was passed in by the user. In + * those cases, the behavior will be clearly documented by the API. + */ +typedef struct { + /** + * The buffer contents. + * + * `ptr` points to the start of the allocated memory. If it is NULL, + * then the `git_buf` is considered empty and libgit2 will feel free + * to overwrite it with new data. + */ + char *ptr; + + /** + * `asize` holds the known total amount of allocated memory if the `ptr` + * was allocated by libgit2. It may be larger than `size`. If `ptr` + * was not allocated by libgit2 and should not be resized and/or freed, + * then `asize` will be set to zero. + */ + size_t asize; + + /** + * `size` holds the size (in bytes) of the data that is actually used. + */ + size_t size; +} git_buf; + +/** + * Static initializer for git_buf from static buffer + */ +#define GIT_BUF_INIT_CONST(STR,LEN) { (char *)(STR), 0, (size_t)(LEN) } + +/** + * Free the memory referred to by the git_buf. + * + * Note that this does not free the `git_buf` itself, just the memory + * pointed to by `buffer->ptr`. This will not free the memory if it looks + * like it was not allocated internally, but it will clear the buffer back + * to the empty state. + * + * @param buffer The buffer to deallocate + */ +GIT_EXTERN(void) git_buf_dispose(git_buf *buffer); + +/** + * Resize the buffer allocation to make more space. + * + * This will attempt to grow the buffer to accommodate the target size. + * + * If the buffer refers to memory that was not allocated by libgit2 (i.e. + * the `asize` field is zero), then `ptr` will be replaced with a newly + * allocated block of data. Be careful so that memory allocated by the + * caller is not lost. As a special variant, if you pass `target_size` as + * 0 and the memory is not allocated by libgit2, this will allocate a new + * buffer of size `size` and copy the external data into it. + * + * Currently, this will never shrink a buffer, only expand it. + * + * If the allocation fails, this will return an error and the buffer will be + * marked as invalid for future operations, invaliding the contents. + * + * @param buffer The buffer to be resized; may or may not be allocated yet + * @param target_size The desired available size + * @return 0 on success, -1 on allocation failure + */ +GIT_EXTERN(int) git_buf_grow(git_buf *buffer, size_t target_size); + +/** + * Set buffer to a copy of some raw data. + * + * @param buffer The buffer to set + * @param data The data to copy into the buffer + * @param datalen The length of the data to copy into the buffer + * @return 0 on success, -1 on allocation failure + */ +GIT_EXTERN(int) git_buf_set( + git_buf *buffer, const void *data, size_t datalen); + +/** +* Check quickly if buffer looks like it contains binary data +* +* @param buf Buffer to check +* @return 1 if buffer looks like non-text data +*/ +GIT_EXTERN(int) git_buf_is_binary(const git_buf *buf); + +/** +* Check quickly if buffer contains a NUL byte +* +* @param buf Buffer to check +* @return 1 if buffer contains a NUL byte +*/ +GIT_EXTERN(int) git_buf_contains_nul(const git_buf *buf); + +GIT_END_DECL + +/** @} */ + +#endif
  46. Download patch debian/libgit2/cmake/Modules/SanitizeBool.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/SanitizeBool.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/SanitizeBool.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,20 @@ +FUNCTION(SanitizeBool VAR) + STRING(TOLOWER "${${VAR}}" VALUE) + IF(VALUE STREQUAL "on") + SET(${VAR} "ON" PARENT_SCOPE) + ELSEIF(VALUE STREQUAL "yes") + SET(${VAR} "ON" PARENT_SCOPE) + ELSEIF(VALUE STREQUAL "true") + SET(${VAR} "ON" PARENT_SCOPE) + ELSEIF(VALUE STREQUAL "1") + SET(${VAR} "ON" PARENT_SCOPE) + ELSEIF(VALUE STREQUAL "off") + SET(${VAR} "OFF" PARENT_SCOPE) + ELSEIF(VALUE STREQUAL "no") + SET(${VAR} "OFF" PARENT_SCOPE) + ELSEIF(VALUE STREQUAL "false") + SET(${VAR} "OFF" PARENT_SCOPE) + ELSEIF(VALUE STREQUAL "0") + SET(${VAR} "OFF" PARENT_SCOPE) + ENDIF() +ENDFUNCTION()
  47. Download patch crates/resolver-tests/tests/resolve.rs

    --- 0.43.1-3/crates/resolver-tests/tests/resolve.rs 2020-03-17 14:23:20.000000000 +0000 +++ 0.44.1-0ubuntu1/crates/resolver-tests/tests/resolve.rs 2020-05-04 02:09:09.000000000 +0000 @@ -61,7 +61,7 @@ proptest! { config .configure( 1, - None, + false, None, false, false, @@ -569,7 +569,7 @@ fn test_resolving_minimum_version_with_t config .configure( 1, - None, + false, None, false, false,
  48. Download patch debian/libgit2/include/git2/attr.h
  49. Download patch debian/libgit2/cmake/Modules/FindmbedTLS.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/FindmbedTLS.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/FindmbedTLS.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,93 @@ +# - Try to find mbedTLS +# Once done this will define +# +# Read-Only variables +# MBEDTLS_FOUND - system has mbedTLS +# MBEDTLS_INCLUDE_DIR - the mbedTLS include directory +# MBEDTLS_LIBRARY_DIR - the mbedTLS library directory +# MBEDTLS_LIBRARIES - Link these to use mbedTLS +# MBEDTLS_LIBRARY - path to mbedTLS library +# MBEDX509_LIBRARY - path to mbedTLS X.509 library +# MBEDCRYPTO_LIBRARY - path to mbedTLS Crypto library +# +# Hint +# MBEDTLS_ROOT_DIR can be pointed to a local mbedTLS installation. + +SET(_MBEDTLS_ROOT_HINTS + ${MBEDTLS_ROOT_DIR} + ENV MBEDTLS_ROOT_DIR +) + +SET(_MBEDTLS_ROOT_HINTS_AND_PATHS + HINTS ${_MBEDTLS_ROOT_HINTS} + PATHS ${_MBEDTLS_ROOT_PATHS} +) + +FIND_PATH(MBEDTLS_INCLUDE_DIR + NAMES mbedtls/version.h + ${_MBEDTLS_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES include +) + +IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARIES) + # Already in cache, be silent + SET(MBEDTLS_FIND_QUIETLY TRUE) +ENDIF() + +FIND_LIBRARY(MBEDTLS_LIBRARY + NAMES mbedtls libmbedtls + ${_MBEDTLS_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES library +) +FIND_LIBRARY(MBEDX509_LIBRARY + NAMES mbedx509 libmbedx509 + ${_MBEDTLS_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES library +) +FIND_LIBRARY(MBEDCRYPTO_LIBRARY + NAMES mbedcrypto libmbedcrypto + ${_MBEDTLS_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES library +) + +IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY AND MBEDX509_LIBRARY AND MBEDCRYPTO_LIBRARY) + SET(MBEDTLS_FOUND TRUE) +ENDIF() + +IF(MBEDTLS_FOUND) + # split mbedTLS into -L and -l linker options, so we can set them for pkg-config + GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_DIR ${MBEDTLS_LIBRARY} PATH) + GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY} NAME_WE) + GET_FILENAME_COMPONENT(MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY} NAME_WE) + GET_FILENAME_COMPONENT(MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY} NAME_WE) + STRING(REGEX REPLACE "^lib" "" MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY_FILE}) + STRING(REGEX REPLACE "^lib" "" MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY_FILE}) + STRING(REGEX REPLACE "^lib" "" MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY_FILE}) + SET(MBEDTLS_LIBRARIES "-L${MBEDTLS_LIBRARY_DIR} -l${MBEDTLS_LIBRARY_FILE} -l${MBEDX509_LIBRARY_FILE} -l${MBEDCRYPTO_LIBRARY_FILE}") + + IF(NOT MBEDTLS_FIND_QUIETLY) + MESSAGE(STATUS "Found mbedTLS:") + FILE(READ ${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h MBEDTLSCONTENT) + STRING(REGEX MATCH "MBEDTLS_VERSION_STRING +\"[0-9|.]+\"" MBEDTLSMATCH ${MBEDTLSCONTENT}) + IF (MBEDTLSMATCH) + STRING(REGEX REPLACE "MBEDTLS_VERSION_STRING +\"([0-9|.]+)\"" "\\1" MBEDTLS_VERSION ${MBEDTLSMATCH}) + MESSAGE(STATUS " version ${MBEDTLS_VERSION}") + ENDIF(MBEDTLSMATCH) + MESSAGE(STATUS " TLS: ${MBEDTLS_LIBRARY}") + MESSAGE(STATUS " X509: ${MBEDX509_LIBRARY}") + MESSAGE(STATUS " Crypto: ${MBEDCRYPTO_LIBRARY}") + ENDIF(NOT MBEDTLS_FIND_QUIETLY) +ELSE(MBEDTLS_FOUND) + IF(MBEDTLS_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find mbedTLS") + ENDIF(MBEDTLS_FIND_REQUIRED) +ENDIF(MBEDTLS_FOUND) + +MARK_AS_ADVANCED( + MBEDTLS_INCLUDE_DIR + MBEDTLS_LIBRARY_DIR + MBEDTLS_LIBRARIES + MBEDTLS_LIBRARY + MBEDX509_LIBRARY + MBEDCRYPTO_LIBRARY +)
  50. Download patch debian/libgit2/azure-pipelines/bash.yml

    --- 0.43.1-3/debian/libgit2/azure-pipelines/bash.yml 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/azure-pipelines/bash.yml 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,17 @@ +# These are the steps used for building on machines with bash. +steps: +- bash: . '$(Build.SourcesDirectory)/azure-pipelines/build.sh' + displayName: Build + workingDirectory: '$(Build.BinariesDirectory)' + env: ${{ parameters.environmentVariables }} +- bash: . '$(Build.SourcesDirectory)/azure-pipelines/test.sh' + displayName: Test + workingDirectory: '$(Build.BinariesDirectory)' + env: ${{ parameters.environmentVariables }} +- task: PublishTestResults@2 + displayName: Publish Test Results + condition: succeededOrFailed() + inputs: + testResultsFiles: 'results_*.xml' + searchFolder: '$(Build.BinariesDirectory)' + mergeTestResults: true
  51. Download patch crates/cargo-platform/src/lib.rs

    --- 0.43.1-3/crates/cargo-platform/src/lib.rs 2020-03-17 14:23:20.000000000 +0000 +++ 0.44.1-0ubuntu1/crates/cargo-platform/src/lib.rs 2020-05-04 02:09:09.000000000 +0000 @@ -84,16 +84,14 @@ impl Platform { )), _ => (), }, - Cfg::KeyPair(name, _) => match name.as_str() { - "feature" => - warnings.push(String::from( - "Found `feature = ...` in `target.'cfg(...)'.dependencies`. \ - This key is not supported for selecting dependencies \ - and will not work as expected. \ - Use the [features] section instead: \ - https://doc.rust-lang.org/cargo/reference/features.html" - )), - _ => (), + Cfg::KeyPair(name, _) => if name.as_str() == "feature" { + warnings.push(String::from( + "Found `feature = ...` in `target.'cfg(...)'.dependencies`. \ + This key is not supported for selecting dependencies \ + and will not work as expected. \ + Use the [features] section instead: \ + https://doc.rust-lang.org/cargo/reference/features.html" + )) }, } }
  52. Download patch debian/libgit2/cmake/Modules/FindPCRE.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/FindPCRE.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/FindPCRE.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,38 @@ +# Copyright (C) 2007-2009 LuaDist. +# Created by Peter Kapec <kapecp@gmail.com> +# Redistribution and use of this file is allowed according to the terms of the MIT license. +# For details see the COPYRIGHT file distributed with LuaDist. +# Note: +# Searching headers and libraries is very simple and is NOT as powerful as scripts +# distributed with CMake, because LuaDist defines directories to search for. +# Everyone is encouraged to contact the author with improvements. Maybe this file +# becomes part of CMake distribution sometimes. + +# - Find pcre +# Find the native PCRE headers and libraries. +# +# PCRE_INCLUDE_DIRS - where to find pcre.h, etc. +# PCRE_LIBRARIES - List of libraries when using pcre. +# PCRE_FOUND - True if pcre found. + +# Look for the header file. +FIND_PATH(PCRE_INCLUDE_DIR NAMES pcreposix.h) + +# Look for the library. +FIND_LIBRARY(PCRE_LIBRARY NAMES pcre) +FIND_LIBRARY(PCRE_POSIX_LIBRARY NAMES pcreposix) + +# Handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if all listed variables are TRUE. +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARY PCRE_POSIX_LIBRARY PCRE_INCLUDE_DIR) + +# Copy the results to the output variables. +IF(PCRE_FOUND) + SET(PCRE_LIBRARIES ${PCRE_LIBRARY} ${PCRE_POSIX_LIBRARY}) + SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR}) +ELSE(PCRE_FOUND) + SET(PCRE_LIBRARIES) + SET(PCRE_INCLUDE_DIRS) +ENDIF(PCRE_FOUND) + +MARK_AS_ADVANCED(PCRE_INCLUDE_DIRS PCRE_LIBRARIES)
  53. Download patch debian/libgit2/docs/differences-from-git.md

    --- 0.43.1-3/debian/libgit2/docs/differences-from-git.md 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/docs/differences-from-git.md 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,27 @@ +# Differences from Git + +In some instances, the functionality of libgit2 deviates slightly from Git. This can be because of technical limitations when developing a library, licensing limitations when converting functionality from Git to libgit2, or various other reasons. + +Repository and Workdir Path Reporting +------------------------------------- + +When asking Git for the absolute path of a repository via `git rev-parse --absolute-git-dir`, it will output the path to the ".git" folder without a trailing slash. In contrast to that, the call `git_repository_path(repo)` will return the path with a trailing slash: + +``` +git rev-parse --absolute-git-dir -> /home/user/projects/libgit2/.git +git_repository_path(repo) -> /home/user/projects/libgit2/.git/ +``` + +The same difference exists when listing worktrees: + +``` +git worktree list -> /home/user/projects/libgit2 +git_repository_workdir(repo) -> /home/user/projects/libgit2/ +``` + +Windows Junction Points +----------------------- + +In libgit2, junction points are treated like symbolic links. They're handled specially in `git_win32__file_attribute_to_stat` in `src/win/w32_util.h`. This means that libgit2 tracks the directory itself as a link. + +In Git for Windows, junction points are treated like regular directories. This means that Git for Windows tracks the contents of the directory.
  54. Download patch debian/libgit2/docs/projects.md

    --- 0.43.1-3/debian/libgit2/docs/projects.md 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/docs/projects.md 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,93 @@ +Projects For LibGit2 +==================== + +So, you want to start helping out with `libgit2`? That's fantastic! We +welcome contributions and we promise we'll try to be nice. + +This is a list of libgit2 related projects that new contributors can take +on. It includes a number of good starter projects as well as some larger +ideas that no one is actively working on. + +## Before You Start + +Please start by reading the [README.md](../README.md), +[contributing.md](contributing.md), and [conventions.md](conventions.md) +files before diving into one of these projects. Those explain our work +flow and coding conventions to help ensure that your work will be easily +integrated into libgit2. + +Next, work through the build instructions and make sure you can clone the +repository, compile it, and run the tests successfully. That will make +sure that your development environment is set up correctly and you are +ready to start on libgit2 development. + +## Starter Projects + +These are good small projects to get started with libgit2. + +* Look at the `examples/` programs, find an existing one that mirrors a + core Git command and add a missing command-line option. There are many + gaps right now and this helps demonstrate how to use the library. Here + are some specific ideas (though there are many more): + * Fix the `examples/diff.c` implementation of the `-B` + (a.k.a. `--break-rewrites`) command line option to actually look for + the optional `[<n>][/<m>]` configuration values. There is an + existing comment that reads `/* TODO: parse thresholds */`. The + trick to this one will be doing it in a manner that is clean and + simple, but still handles the various cases correctly (e.g. `-B/70%` + is apparently a legal setting). + * As an extension to the matching idea for `examples/log.c`, add the + `-i` option to use `strcasestr()` for matches. + * For `examples/log.c`, implement the `--first-parent` option now that + libgit2 supports it in the revwalk API. +* Pick a Git command that is not already emulated in `examples/` and write + a new example that mirrors the behavior. Examples don't have to be + perfect emulations, but should demonstrate how to use the libgit2 APIs + to get results that are similar to Git commands. This lets you (and us) + easily exercise a particular facet of the API and measure compatibility + and feature parity with core git. +* Submit a PR to clarify documentation! While we do try to document all of + the APIs, your fresh eyes on the documentation will find areas that are + confusing much more easily. + +If none of these appeal to you, take a look at our issues list to see if +there are any unresolved issues you'd like to jump in on. + +## Larger Projects + +These are ideas for larger projects mostly taken from our backlog of +[Issues](https://github.com/libgit2/libgit2/issues). Please don't dive +into one of these as a first project for libgit2 - we'd rather get to +know you first by successfully shipping your work on one of the smaller +projects above. + +Some of these projects are broken down into subprojects and/or have +some incremental steps listed towards the larger goal. Those steps +might make good smaller projects by themselves. + +* Port part of the Git test suite to run against the command line emulation + in `examples/` + * Pick a Git command that is emulated in our `examples/` area + * Extract the Git tests that exercise that command + * Convert the tests to call our emulation + * These tests could go in `examples/tests/`... +* Add hooks API to enumerate and manage hooks (not run them at this point) + * Enumeration of available hooks + * Lookup API to see which hooks have a script and get the script + * Read/write API to load a hook script and write a hook script + * Eventually, callback API to invoke a hook callback when libgit2 + executes the action in question +* Isolate logic of ignore evaluation into a standalone API +* Upgrade internal libxdiff code to latest from core Git +* Tree builder improvements: + * Extend to allow building a tree hierarchy +* Apply-patch API +* Add a patch editing API to enable "git add -p" type operations +* Textconv API to filter binary data before generating diffs (something + like the current Filter API, probably). +* Performance profiling and improvement +* Support "git replace" ref replacements +* Include conflicts in diff results and in status + * GIT_DELTA_CONFLICT for items in conflict (with multiple files) + * Appropriate flags for status +* Support sparse checkout (i.e. "core.sparsecheckout" and ".git/info/sparse-checkout")
  55. Download patch debian/libgit2/azure-pipelines/docker/xenial

    --- 0.43.1-3/debian/libgit2/azure-pipelines/docker/xenial 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/azure-pipelines/docker/xenial 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,67 @@ +ARG BASE +FROM $BASE AS apt +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + bzip2 \ + clang \ + cmake \ + curl \ + gcc \ + git \ + krb5-user \ + libcurl4-gnutls-dev \ + libgcrypt20-dev \ + libkrb5-dev \ + libpcre3-dev \ + libssl-dev \ + libz-dev \ + make \ + ninja-build \ + openjdk-8-jre-headless \ + openssh-server \ + openssl \ + pkgconf \ + python \ + sudo \ + valgrind \ + && \ + rm -rf /var/lib/apt/lists/* + +FROM apt AS mbedtls +RUN cd /tmp && \ + curl --location --silent --show-error https://tls.mbed.org/download/mbedtls-2.16.2-apache.tgz | \ + tar -xz && \ + cd mbedtls-2.16.2 && \ + scripts/config.pl set MBEDTLS_MD4_C 1 && \ + CFLAGS=-fPIC cmake -G Ninja -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=OFF -DUSE_STATIC_MBEDTLS_LIBRARY=ON . && \ + ninja install && \ + cd .. && \ + rm -rf mbedtls-2.16.2 + +FROM mbedtls AS libssh2 +RUN cd /tmp && \ + curl --insecure --location --silent --show-error https://www.libssh2.org/download/libssh2-1.8.2.tar.gz | \ + tar -xz && \ + cd libssh2-1.8.2 && \ + CFLAGS=-fPIC cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCRYPTO_BACKEND=Libgcrypt . && \ + ninja install && \ + cd .. && \ + rm -rf libssh2-1.8.2 + +FROM libssh2 AS valgrind +RUN cd /tmp && \ + curl --insecure --location --silent --show-error https://sourceware.org/pub/valgrind/valgrind-3.15.0.tar.bz2 | \ + tar -xj && \ + cd valgrind-3.15.0 && \ + ./configure && \ + make && \ + make install && \ + cd .. && \ + rm -rf valgrind-3.15.0 + +FROM valgrind AS configure +COPY entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod a+x /usr/local/bin/entrypoint.sh +RUN mkdir /var/run/sshd + +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
  56. Download patch debian/libgit2/CMakeLists.txt
  57. Download patch debian/libgit2/cmake/Modules/EnableWarnings.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/EnableWarnings.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/EnableWarnings.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,15 @@ +MACRO(ENABLE_WARNINGS flag) + ADD_C_FLAG_IF_SUPPORTED(-W${flag}) +ENDMACRO() + +MACRO(DISABLE_WARNINGS flag) + ADD_C_FLAG_IF_SUPPORTED(-Wno-${flag}) +ENDMACRO() + +IF(ENABLE_WERROR) + IF(MSVC) + ADD_COMPILE_OPTIONS(-WX) + ELSE() + ADD_C_FLAG_IF_SUPPORTED(-Werror) + ENDIF() +ENDIF()
  58. Download patch CHANGELOG.md

    --- 0.43.1-3/CHANGELOG.md 2020-03-17 14:23:20.000000000 +0000 +++ 0.44.1-0ubuntu1/CHANGELOG.md 2020-05-04 02:09:09.000000000 +0000 @@ -1,25 +1,106 @@ # Changelog +## Cargo 1.43 (2020-04-23) +[9d32b7b0...HEAD](https://github.com/rust-lang/cargo/compare/9d32b7b0...HEAD) + +### Added +- 🔥 Profiles may now be specified in config files (and environment variables). + [#7823](https://github.com/rust-lang/cargo/pull/7823) + +### Changed +- `cargo install --git` now honors workspaces in a git repository. This allows + workspace settings, like `[patch]`, `[replace]`, or `[profile]` to be used. + [#7768](https://github.com/rust-lang/cargo/pull/7768) + +### Fixed + +### Nightly only +- Added `build.out-dir` config variable to set the output directory. + [#7810](https://github.com/rust-lang/cargo/pull/7810) +- Added `-Zjobserver-per-rustc` feature to support improved performance for + parallel rustc. + [#7731](https://github.com/rust-lang/cargo/pull/7731) + + + ## Cargo 1.42 (2020-03-12) -[0bf7aafe...HEAD](https://github.com/rust-lang/cargo/compare/0bf7aafe...HEAD) +[0bf7aafe...rust-1.42.0](https://github.com/rust-lang/cargo/compare/0bf7aafe...rust-1.42.0) ### Added - Added documentation on git authentication. [#7658](https://github.com/rust-lang/cargo/pull/7658) - Bitbucket Pipeline badges are now supported on crates.io. [#7663](https://github.com/rust-lang/cargo/pull/7663) +- `cargo vendor` now accepts the `--versioned-dirs` option to force it to + always include the version number in each package's directory name. + [#7631](https://github.com/rust-lang/cargo/pull/7631) +- The `proc_macro` crate is now automatically added to the extern prelude for + proc-macro packages. This means that `extern crate proc_macro;` is no longer + necessary for proc-macros. + [#7700](https://github.com/rust-lang/cargo/pull/7700) ### Changed - Emit a warning if `debug_assertions`, `test`, `proc_macro`, or `feature=` is used in a `cfg()` expression. [#7660](https://github.com/rust-lang/cargo/pull/7660) +- Large update to the Cargo documentation, adding new chapters on Cargo + targets, workspaces, and features. + [#7733](https://github.com/rust-lang/cargo/pull/7733) +- Windows: `.lib` DLL import libraries are now copied next to the dll for all + Windows MSVC targets. Previously it was only supported for + `pc-windows-msvc`. This adds DLL support for `uwp-windows-msvc` targets. + [#7758](https://github.com/rust-lang/cargo/pull/7758) +- The `ar` field in the `[target]` configuration is no longer read. It has + been ignored for over 4 years. + [#7763](https://github.com/rust-lang/cargo/pull/7763) +- Bash completion file simplified and updated for latest changes. + [#7789](https://github.com/rust-lang/cargo/pull/7789) +- Credentials are only loaded when needed, instead of every Cargo command. + [#7774](https://github.com/rust-lang/cargo/pull/7774) ### Fixed -- Removed `--offline` empty index check, which was a false positive in some cases. +- Removed `--offline` empty index check, which was a false positive in some + cases. [#7655](https://github.com/rust-lang/cargo/pull/7655) +- Files and directories starting with a `.` can now be included in a package + by adding it to the `include` list. + [#7680](https://github.com/rust-lang/cargo/pull/7680) +- Fixed `cargo login` removing alternative registry tokens when previous + entries existed in the credentials file. + [#7708](https://github.com/rust-lang/cargo/pull/7708) +- Fixed `cargo vendor` from panicking when used with alternative registries. + [#7718](https://github.com/rust-lang/cargo/pull/7718) +- Fixed incorrect explanation in the fingerprint debug log message. + [#7749](https://github.com/rust-lang/cargo/pull/7749) +- A `[source]` that is defined multiple times will now result in an error. + Previously it was randomly picking a source, which could cause + non-deterministic behavior. + [#7751](https://github.com/rust-lang/cargo/pull/7751) +- `dep_kinds` in `cargo metadata` are now de-duplicated. + [#7756](https://github.com/rust-lang/cargo/pull/7756) +- Fixed packaging where `Cargo.lock` was listed in `.gitignore` in a + subdirectory inside a git repository. Previously it was assuming + `Cargo.lock` was at the root of the repo. + [#7779](https://github.com/rust-lang/cargo/pull/7779) +- Partial file transfer errors will now cause an automatic retry. + [#7788](https://github.com/rust-lang/cargo/pull/7788) +- Linux: Fixed panic if CPU iowait stat decreases. + [#7803](https://github.com/rust-lang/cargo/pull/7803) +- Fixed using the wrong sysroot for detecting host compiler settings when + `--sysroot` is passed in via `RUSTFLAGS`. + [#7798](https://github.com/rust-lang/cargo/pull/7798) ### Nightly only - +- `build-std` now uses `--extern` instead of `--sysroot` to find sysroot + pacakges. + [#7699](https://github.com/rust-lang/cargo/pull/7699) +- Added `--config` command-line option to set config settings. + [#7649](https://github.com/rust-lang/cargo/pull/7649) +- Added `include` config setting which allows including another config file. + [#7649](https://github.com/rust-lang/cargo/pull/7649) +- Profiles in config files now support any named profile. Previously it was + limited to dev/release. + [#7750](https://github.com/rust-lang/cargo/pull/7750) ## Cargo 1.41 (2020-01-30) [5da4b4d4...rust-1.41.0](https://github.com/rust-lang/cargo/compare/5da4b4d4...rust-1.41.0)
  59. Download patch debian/libgit2/include/git2/blame.h
  60. Download patch debian/libgit2/docs/merge-df_conflicts.txt

    --- 0.43.1-3/debian/libgit2/docs/merge-df_conflicts.txt 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/docs/merge-df_conflicts.txt 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,41 @@ +Anc / Our / Thr represent the ancestor / ours / theirs side of a merge +from branch "branch" into HEAD. Workdir represents the expected files in +the working directory. Index represents the expected files in the index, +with stage markers. + + Anc Our Thr Workdir Index +1 D D + D/F D/F D/F [0] + +2 D D+ D~HEAD (mod/del) D/F [0] + D/F D/F D [1] + D [2] + +3 D D D/F D/F [0] + D/F + +4 D D+ D~branch (mod/del) D/F [0] + D/F D/F D [1] + D [3] + +5 D D/F (add/add) D/F [2] + D/F D/F [3] + D/F + +6 D/F D/F D D [0] + D + +7 D/F D/F+ D/F (mod/del) D/F [1] + D D~branch (fil/dir) D/F [2] + D [3] + +8 D/F D/F D D [0] + D + +9 D/F D/F+ D/F (mod/del) D/F [1] + D D~HEAD (fil/dir) D [2] + D/F [3] + +10 D/F D/F (fil/dir) D/F [0] + D D~HEAD D [2] + D
  61. Download patch debian/bootstrap.py
  62. Download patch debian/libgit2/azure-pipelines/test.sh
  63. Download patch debian/libgit2/cmake/Modules/FindHTTP_Parser.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/FindHTTP_Parser.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/FindHTTP_Parser.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,39 @@ +# - Try to find http-parser +# +# Defines the following variables: +# +# HTTP_PARSER_FOUND - system has http-parser +# HTTP_PARSER_INCLUDE_DIR - the http-parser include directory +# HTTP_PARSER_LIBRARIES - Link these to use http-parser +# HTTP_PARSER_VERSION_MAJOR - major version +# HTTP_PARSER_VERSION_MINOR - minor version +# HTTP_PARSER_VERSION_STRING - the version of http-parser found + +# Find the header and library +FIND_PATH(HTTP_PARSER_INCLUDE_DIR NAMES http_parser.h) +FIND_LIBRARY(HTTP_PARSER_LIBRARY NAMES http_parser libhttp_parser) + +# Found the header, read version +if (HTTP_PARSER_INCLUDE_DIR AND EXISTS "${HTTP_PARSER_INCLUDE_DIR}/http_parser.h") + FILE(READ "${HTTP_PARSER_INCLUDE_DIR}/http_parser.h" HTTP_PARSER_H) + IF (HTTP_PARSER_H) + STRING(REGEX REPLACE ".*#define[\t ]+HTTP_PARSER_VERSION_MAJOR[\t ]+([0-9]+).*" "\\1" HTTP_PARSER_VERSION_MAJOR "${HTTP_PARSER_H}") + STRING(REGEX REPLACE ".*#define[\t ]+HTTP_PARSER_VERSION_MINOR[\t ]+([0-9]+).*" "\\1" HTTP_PARSER_VERSION_MINOR "${HTTP_PARSER_H}") + SET(HTTP_PARSER_VERSION_STRING "${HTTP_PARSER_VERSION_MAJOR}.${HTTP_PARSER_VERSION_MINOR}") + ENDIF() + UNSET(HTTP_PARSER_H) +ENDIF() + +# Handle the QUIETLY and REQUIRED arguments and set HTTP_PARSER_FOUND +# to TRUE if all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(HTTP_Parser REQUIRED_VARS HTTP_PARSER_INCLUDE_DIR HTTP_PARSER_LIBRARY) + +# Hide advanced variables +MARK_AS_ADVANCED(HTTP_PARSER_INCLUDE_DIR HTTP_PARSER_LIBRARY) + +# Set standard variables +IF (HTTP_PARSER_FOUND) + SET(HTTP_PARSER_LIBRARIES ${HTTP_PARSER_LIBRARY}) + set(HTTP_PARSER_INCLUDE_DIRS ${HTTP_PARSER_INCLUDE_DIR}) +ENDIF()
  64. Download patch debian/libgit2/api.docurium

    --- 0.43.1-3/debian/libgit2/api.docurium 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/api.docurium 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,13 @@ +{ + "name": "libgit2", + "github": "libgit2/libgit2", + "input": "include", + "prefix": "git_", + "output": "docs", + "branch": "gh-pages", + "examples": "examples", + "legacy": { + "input": {"src/git": ["v0.1.0"], + "src/git2": ["v0.2.0", "v0.3.0"]} + } +}
  65. Download patch azure-pipelines.yml

    --- 0.43.1-3/azure-pipelines.yml 2020-03-17 14:23:20.000000000 +0000 +++ 0.44.1-0ubuntu1/azure-pipelines.yml 2020-05-04 02:09:09.000000000 +0000 @@ -93,6 +93,8 @@ jobs: - job: docs pool: vmImage: ubuntu-16.04 + variables: + TOOLCHAIN: nightly steps: - template: ci/azure-install-rust.yml - bash: | @@ -105,5 +107,11 @@ jobs: displayName: "Build documentation" - bash: cd src/doc && mdbook build --dest-dir ../../target/doc displayName: "Build mdbook documentation" - variables: - TOOLCHAIN: stable + - bash: | + set -e + rustup component add rust-docs + cd src/doc + curl -sSLo linkcheck.sh \ + https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh + sh linkcheck.sh --all cargo + displayName: "Check for broken links"
  66. Download patch debian/libgit2/docs/troubleshooting.md

    --- 0.43.1-3/debian/libgit2/docs/troubleshooting.md 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/docs/troubleshooting.md 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,13 @@ +Troubleshooting libgit2 Problems +================================ + +CMake Failures +-------------- + +* **`Asked for OpenSSL TLS backend, but it wasn't found`** + CMake cannot find your SSL/TLS libraries. By default, libgit2 always + builds with HTTPS support, and you are encouraged to install the + OpenSSL libraries for your system (eg, `apt-get install libssl-dev`). + + For development, if you simply want to disable HTTPS support entirely, + pass the `-DUSE_HTTPS=OFF` argument to `cmake` when configuring it.
  67. Download patch debian/libgit2/docs/threading.md

    --- 0.43.1-3/debian/libgit2/docs/threading.md 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/docs/threading.md 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,107 @@ +Threading in libgit2 +================== + +Unless otherwise specified, libgit2 objects cannot be safely accessed by +multiple threads simultaneously. + +There are also caveats on the cryptographic libraries libgit2 or its +dependencies link to (more on this later). For libgit2 itself, +provided you take the following into consideration you won't run into +issues: + +Sharing objects +--------------- + +Use an object from a single thread at a time. Most data structures do +not guard against concurrent access themselves. This is because they +are rarely used in isolation and it makes more sense to synchronize +access via a larger lock or similar mechanism. + +There are some objects which are read-only/immutable and are thus safe +to share across threads, such as references and configuration +snapshots. + +Error messages +-------------- + +The error message is thread-local. The `git_error_last()` call must +happen on the same thread as the error in order to get the +message. Often this will be the case regardless, but if you use +something like the [GCD](http://en.wikipedia.org/wiki/Grand_Central_Dispatch) +on macOS (where code is executed on an arbitrary thread), the code +must make sure to retrieve the error code on the thread where the error +happened. + +Threading and cryptographic libraries +======================================= + +On Windows +---------- + +When built as a native Windows DLL, libgit2 uses WinCNG and WinHTTP, +both of which are thread-safe. You do not need to do anything special. + +When using libssh2 which itself uses WinCNG, there are no special +steps necessary. If you are using a MinGW or similar environment where +libssh2 uses OpenSSL or libgcrypt, then the general case affects +you. + +On macOS +----------- + +By default we make use of CommonCrypto and SecureTransport for cryptographic +support. These are thread-safe and you do not need to do anything special. + +Note that libssh2 may still use OpenSSL itself. In that case, the +general case still affects you if you use ssh. + +General Case +------------ + +libgit2 will default to OpenSSL for HTTPS transport (except on Windows and +macOS, as mentioned above). On any system, mbedTLS _may_ be optionally +enabled as the security provider. OpenSSL is thread-safe starting at +version 1.1.0. If your copy of libgit2 is linked against that version, +you do not need to take any further steps. + +Older versions of OpenSSL are made to be thread-implementation agnostic, and the +users of the library must set which locking function it should use. libgit2 +cannot know what to set as the user of libgit2 may also be using OpenSSL independently and +the locking settings must then live outside the lifetime of libgit2. + +Even if libgit2 doesn't use OpenSSL directly, OpenSSL can still be used by +libssh2 depending on the configuration. If OpenSSL is used by +more than one library, you only need to set up threading for OpenSSL once. + +If libgit2 is linked against OpenSSL < 1.1.0, it provides a last-resort convenience function +`git_openssl_set_locking()` (available in `sys/openssl.h`) to use the +platform-native mutex mechanisms to perform the locking, which you can use +if you do not want to use OpenSSL outside of libgit2, or you +know that libgit2 will outlive the rest of the operations. It is then not +safe to use OpenSSL multi-threaded after libgit2's shutdown function +has been called. Note `git_openssl_set_locking()` only works if +libgit2 uses OpenSSL directly - if OpenSSL is only used as a dependency +of libssh2 as described above, `git_openssl_set_locking()` is a no-op. + +If your programming language offers a package/bindings for OpenSSL, +you should very strongly prefer to use that in order to set up +locking, as they provide a level of coordination which is impossible +when using this function. + +See the +[OpenSSL documentation](https://www.openssl.org/docs/crypto/threads.html) +on threading for more details, and http://trac.libssh2.org/wiki/MultiThreading +for a specific example of providing the threading callbacks. + +libssh2 may be linked against OpenSSL or libgcrypt. If it uses OpenSSL, +see the above paragraphs. If it uses libgcrypt, then you need to +set up its locking before using it multi-threaded. libgit2 has no +direct connection to libgcrypt and thus has no convenience functions for +it (but libgcrypt has macros). Read libgcrypt's +[threading documentation for more information](http://www.gnupg.org/documentation/manuals/gcrypt/Multi_002dThreading.html) + +It is your responsibility as an application author or packager to know +what your dependencies are linked against and to take the appropriate +steps to ensure the cryptographic libraries are thread-safe. We agree +that this situation is far from ideal but at this time it is something +the application authors need to deal with.
  68. Download patch debian/libgit2/docs/release.md

    --- 0.43.1-3/debian/libgit2/docs/release.md 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/docs/release.md 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,83 @@ +# Releasing the library + +We have three kinds of releases: "full" releases, maintenance releases and security releases. Full ones release the state of the `master` branch whereas maintenance releases provide bugfixes building on top of the currently released series. Security releases are also for the current series but only contain security fixes on top of the previous release. + +## Full release + +We aim to release once every six months. We start the process by opening an issue. This is accompanied with a feature freeze. From now until the release, only bug fixes are to be merged. Use the following as a base for the issue + + Release v0.X + + Let's release v0.X, codenamed: <something witty> + + - [ ] Bump the versions in the headers (`include/git2/version.h`) + - [ ] Bump the versions in the clib manifest (`package.json`) + - [ ] Make a release candidate + - [ ] Plug any final leaks + - [ ] Fix any last-minute issues + - [ ] Make sure changelog.md reflects everything worth discussing + - [ ] Update the version in changelog.md and the header + - [ ] Produce a release candidate + - [ ] Tag + - [ ] Create maint/v0.X + - [ ] Update any bindings the core team works with + +We tag at least one release candidate. This RC must carry the new version in the headers, including the SOVERSION. If there are no significant issues found, we can go straight to the release after a single RC. This is up to the discretion of the release manager. There is no set time to have the candidate out, but we should we should give downstream projects at least a week to give feedback. + +Preparing the first release candidate includes updating the version number of libgit2 to the new version number. To do so, a pull request shall be submitted that adjusts the version number in the following places: + +- docs/changelog.md +- include/git2/version.h +- package.json + +As soon as the pull request is merged, the merge commit shall be tagged with a lightweight tag. + +The tagging happens via GitHub's "releases" tab which lets us attach release notes to a particular tag. In the description we include the changes in `docs/changelog.md` between the last full release. Use the following as a base for the release notes + + This is the first release of the v0.X series, <codename>. The changelog follows. + +followed by the three sections in the changelog. For release candidates we can avoid copying the full changelog and only include any new entries. + +During the freeze, and certainly after the first release candidate, any bindings the core team work with should be updated in order to discover any issues that might come up with the multitude of approaches to memory management, embedding or linking. + +Create a branch `maint/v0.X` at the current state of `master` after you've created the tag. This will be used for maintenance releases and lets our dependents track the latest state of the series. + +## Maintenance release + +Every once in a while, when we feel we've accumulated a significant amount of backportable fixes in the mainline branch, we produce a maintenance release in order to provide fixes or improvements for those who track the releases. This also lets our users and integrators receive updates without having to upgrade to the next full release. + +As a rule of thumb, it's a good idea to produce a maintenance release for the current series when we're getting ready for a full release. This gives the (still) current series a last round of fixes without having to upgrade (which with us potentially means adjusting to API changes). + +Start by opening an issue. Use the following as a base. + + Release v0.X.Y + + Enough fixes have accumulated, let's release v0.X.Y + + - [ ] Select the changes we want to backport + - [ ] Update maint/v0.X + - [ ] Tag + +The list of changes to backport does not need to be comprehensive and we might not backport something if the code in mainline has diverged significantly. These fixes do not include those which require API or ABI changes as we release under the same SOVERSION. + +Do not merge into the `maint/v0.X` until we are getting ready to produce a new release. There is always the possibility that we will need to produce a security release and those must only include the relevant security fixes and not arbitrary fixes we were planning on releasing at some point. + +Here we do not use release candidates as the changes are supposed to be small and proven. + +## Security releases + +This is the same as a maintenance release, except that the fix itself will most likely be developed in a private repository and will only be visible to a select group of people until the release. + +We have committed to providing security fixes for the latest two released versions. E.g. if the latest version is v0.28.x, then we will provide security fixes for both v0.28.x and v0.27.y. + +## Updating documentation + +We use docurium to generate our documentation. It is a tool written in ruby which leverages libclang's documentation parser. Install docurium + + gem install docurium + +and run it against our description file with the tip of master checked out. + + cm doc api.docurium + +It will start up a few proceses and write out the results as a new commit onto the `gh-pages` branch. That can be pushed to GitHub to update what will show up on our documentation reference site.
  69. Download patch debian/libgit2/include/git2/global.h

    --- 0.43.1-3/debian/libgit2/include/git2/global.h 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/include/git2/global.h 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_global_h__ +#define INCLUDE_git_global_h__ + +#include "common.h" + +GIT_BEGIN_DECL + +/** + * Init the global state + * + * This function must be called before any other libgit2 function in + * order to set up global state and threading. + * + * This function may be called multiple times - it will return the number + * of times the initialization has been called (including this one) that have + * not subsequently been shutdown. + * + * @return the number of initializations of the library, or an error code. + */ +GIT_EXTERN(int) git_libgit2_init(void); + +/** + * Shutdown the global state + * + * Clean up the global state and threading context after calling it as + * many times as `git_libgit2_init()` was called - it will return the + * number of remainining initializations that have not been shutdown + * (after this one). + * + * @return the number of remaining initializations of the library, or an + * error code. + */ +GIT_EXTERN(int) git_libgit2_shutdown(void); + +/** @} */ +GIT_END_DECL +#endif +
  70. Download patch debian/libgit2/docs/conventions.md
  71. Download patch debian/libgit2/COPYING
  72. Download patch crates/cargo-platform/LICENSE-MIT

    --- 0.43.1-3/crates/cargo-platform/LICENSE-MIT 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/crates/cargo-platform/LICENSE-MIT 2020-05-04 02:09:09.000000000 +0000 @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE.
  73. Download patch debian/debcargo-conf.patch
  74. Download patch debian/libgit2/include/git2/checkout.h
  75. Download patch debian/libgit2/include/git2/blob.h
  76. Download patch debian/libgit2/azure-pipelines/docker/bionic

    --- 0.43.1-3/debian/libgit2/azure-pipelines/docker/bionic 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/azure-pipelines/docker/bionic 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,42 @@ +ARG BASE +FROM $BASE AS apt +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + clang \ + cmake \ + curl \ + gcc \ + git \ + libcurl4-openssl-dev \ + libpcre3-dev \ + libssh2-1-dev \ + libssl-dev \ + libz-dev \ + ninja-build \ + openjdk-8-jre-headless \ + openssh-server \ + openssl \ + pkgconf \ + python \ + sudo \ + valgrind \ + && \ + rm -rf /var/lib/apt/lists/* + +FROM apt AS mbedtls +RUN cd /tmp && \ + curl --location --silent --show-error https://tls.mbed.org/download/mbedtls-2.16.2-apache.tgz | \ + tar -xz && \ + cd mbedtls-2.16.2 && \ + scripts/config.pl set MBEDTLS_MD4_C 1 && \ + CFLAGS=-fPIC cmake -G Ninja -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=OFF -DUSE_STATIC_MBEDTLS_LIBRARY=ON . && \ + ninja install && \ + cd .. && \ + rm -rf mbedtls-2.16.2 + +FROM mbedtls AS configure +COPY entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod a+x /usr/local/bin/entrypoint.sh +RUN mkdir /var/run/sshd + +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
  77. Download patch debian/libgit2/azure-pipelines/build.sh

    --- 0.43.1-3/debian/libgit2/azure-pipelines/build.sh 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/azure-pipelines/build.sh 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# +# Environment variables: +# +# SOURCE_DIR: Set to the directory of the libgit2 source (optional) +# If not set, it will be derived relative to this script. + +set -e + +SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )} +BUILD_DIR=$(pwd) +BUILD_PATH=${BUILD_PATH:=$PATH} +CMAKE=$(which cmake) +CMAKE_GENERATOR=${CMAKE_GENERATOR:-Unix Makefiles} + +indent() { sed "s/^/ /"; } + +echo "Source directory: ${SOURCE_DIR}" +echo "Build directory: ${BUILD_DIR}" +echo "" + +if [ "$(uname -s)" = "Darwin" ]; then + echo "macOS version:" + sw_vers | indent +fi + +if [ -f "/etc/debian_version" ]; then + echo "Debian version:" + (source /etc/lsb-release && echo "${DISTRIB_DESCRIPTION}") | indent +fi + +echo "Kernel version:" +uname -a 2>&1 | indent + +echo "CMake version:" +env PATH="$BUILD_PATH" "$CMAKE" --version 2>&1 | indent + +if test -n "$CC"; then + echo "Compiler version:" + "$CC" --version 2>&1 | indent +fi +echo "" + +echo "##############################################################################" +echo "## Configuring build environment" +echo "##############################################################################" + +echo cmake ${SOURCE_DIR} -DENABLE_WERROR=ON -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON -G \"${CMAKE_GENERATOR}\" ${CMAKE_OPTIONS} +env PATH="$BUILD_PATH" "$CMAKE" ${SOURCE_DIR} -DENABLE_WERROR=ON -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON -G "${CMAKE_GENERATOR}" ${CMAKE_OPTIONS} + +echo "" +echo "##############################################################################" +echo "## Building libgit2" +echo "##############################################################################" + +env PATH="$BUILD_PATH" "$CMAKE" --build .
  78. Download patch crates/cargo-test-support/src/git.rs

    --- 0.43.1-3/crates/cargo-test-support/src/git.rs 2020-03-17 14:23:20.000000000 +0000 +++ 0.44.1-0ubuntu1/crates/cargo-test-support/src/git.rs 2020-05-04 02:09:09.000000000 +0000 @@ -39,7 +39,6 @@ use some of the helper functions in this */ use crate::{path2url, project, Project, ProjectBuilder}; -use git2; use std::fs::{self, File}; use std::io::prelude::*; use std::path::{Path, PathBuf};
  79. Download patch crates/cargo-platform/LICENSE-APACHE
  80. Download patch crates/cargo-test-support/Cargo.toml

    --- 0.43.1-3/crates/cargo-test-support/Cargo.toml 2020-03-17 14:23:20.000000000 +0000 +++ 0.44.1-0ubuntu1/crates/cargo-test-support/Cargo.toml 2020-05-04 02:09:09.000000000 +0000 @@ -12,7 +12,7 @@ cargo = { path = "../.." } cargo-test-macro = { path = "../cargo-test-macro" } filetime = "0.2" flate2 = "1.0" -git2 = "0.11" +git2 = "0.13" glob = "0.3" lazy_static = "1.0" remove_dir_all = "0.5"
  81. Download patch debian/libgit2/include/git2/apply.h

    --- 0.43.1-3/debian/libgit2/include/git2/apply.h 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/include/git2/apply.h 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,149 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_apply_h__ +#define INCLUDE_git_apply_h__ + +#include "common.h" +#include "types.h" +#include "oid.h" +#include "diff.h" + +/** + * @file git2/apply.h + * @brief Git patch application routines + * @defgroup git_apply Git patch application routines + * @ingroup Git + * @{ + */ +GIT_BEGIN_DECL + +/** + * When applying a patch, callback that will be made per delta (file). + * + * When the callback: + * - returns < 0, the apply process will be aborted. + * - returns > 0, the delta will not be applied, but the apply process + * continues + * - returns 0, the delta is applied, and the apply process continues. + * + * @param delta The delta to be applied + * @param payload User-specified payload + */ +typedef int GIT_CALLBACK(git_apply_delta_cb)( + const git_diff_delta *delta, + void *payload); + +/** + * When applying a patch, callback that will be made per hunk. + * + * When the callback: + * - returns < 0, the apply process will be aborted. + * - returns > 0, the hunk will not be applied, but the apply process + * continues + * - returns 0, the hunk is applied, and the apply process continues. + * + * @param hunk The hunk to be applied + * @param payload User-specified payload + */ +typedef int GIT_CALLBACK(git_apply_hunk_cb)( + const git_diff_hunk *hunk, + void *payload); + +/** Flags controlling the behavior of git_apply */ +typedef enum { + /** + * Don't actually make changes, just test that the patch applies. + * This is the equivalent of `git apply --check`. + */ + GIT_APPLY_CHECK = (1 << 0), +} git_apply_flags_t; + +/** + * Apply options structure + * + * Initialize with `GIT_APPLY_OPTIONS_INIT`. Alternatively, you can + * use `git_apply_options_init`. + * + * @see git_apply_to_tree, git_apply + */ +typedef struct { + unsigned int version; /**< The version */ + + /** When applying a patch, callback that will be made per delta (file). */ + git_apply_delta_cb delta_cb; + + /** When applying a patch, callback that will be made per hunk. */ + git_apply_hunk_cb hunk_cb; + + /** Payload passed to both delta_cb & hunk_cb. */ + void *payload; + + /** Bitmask of git_apply_flags_t */ + unsigned int flags; +} git_apply_options; + +#define GIT_APPLY_OPTIONS_VERSION 1 +#define GIT_APPLY_OPTIONS_INIT {GIT_APPLY_OPTIONS_VERSION} + +GIT_EXTERN(int) git_apply_options_init(git_apply_options *opts, unsigned int version); + +/** + * Apply a `git_diff` to a `git_tree`, and return the resulting image + * as an index. + * + * @param out the postimage of the application + * @param repo the repository to apply + * @param preimage the tree to apply the diff to + * @param diff the diff to apply + * @param options the options for the apply (or null for defaults) + */ +GIT_EXTERN(int) git_apply_to_tree( + git_index **out, + git_repository *repo, + git_tree *preimage, + git_diff *diff, + const git_apply_options *options); + +/** Possible application locations for git_apply */ +typedef enum { + /** + * Apply the patch to the workdir, leaving the index untouched. + * This is the equivalent of `git apply` with no location argument. + */ + GIT_APPLY_LOCATION_WORKDIR = 0, + + /** + * Apply the patch to the index, leaving the working directory + * untouched. This is the equivalent of `git apply --cached`. + */ + GIT_APPLY_LOCATION_INDEX = 1, + + /** + * Apply the patch to both the working directory and the index. + * This is the equivalent of `git apply --index`. + */ + GIT_APPLY_LOCATION_BOTH = 2, +} git_apply_location_t; + +/** + * Apply a `git_diff` to the given repository, making changes directly + * in the working directory, the index, or both. + * + * @param repo the repository to apply to + * @param diff the diff to apply + * @param location the location to apply (workdir, index or both) + * @param options the options for the apply (or null for defaults) + */ +GIT_EXTERN(int) git_apply( + git_repository *repo, + git_diff *diff, + git_apply_location_t location, + const git_apply_options *options); + +/** @} */ +GIT_END_DECL +#endif
  82. Download patch debian/libgit2/cmake/Modules/SelectHashes.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/SelectHashes.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/SelectHashes.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,69 @@ +# Select a hash backend + +INCLUDE(SanitizeBool) + +# USE_SHA1=CollisionDetection(ON)/HTTPS/Generic/OFF + +SanitizeBool(USE_SHA1) +IF(USE_SHA1 STREQUAL ON OR USE_SHA1 STREQUAL "CollisionDetection") + SET(SHA1_BACKEND "CollisionDetection") +ELSEIF(USE_SHA1 STREQUAL "HTTPS") + message(STATUS "Checking HTTPS backend… ${HTTPS_BACKEND}") + IF(HTTPS_BACKEND STREQUAL "SecureTransport") + SET(SHA1_BACKEND "CommonCrypto") + ELSEIF(HTTPS_BACKEND STREQUAL "WinHTTP") + SET(SHA1_BACKEND "Win32") + ELSEIF(HTTPS_BACKEND) + SET(SHA1_BACKEND ${HTTPS_BACKEND}) + ELSE() + ENDIF() + IF(NOT HTTPS_BACKEND) + SET(SHA1_BACKEND "CollisionDetection") + ENDIF() + message(STATUS "Using SHA1 backend ${SHA1_BACKEND}") +ELSEIF(USE_SHA1 STREQUAL "Generic") + SET(SHA1_BACKEND "Generic") +# ELSEIF(NOT USE_SHA1) +ELSE() + MESSAGE(FATAL_ERROR "Invalid value for USE_SHA1: ${USE_SHA1}") +ENDIF() + +IF(SHA1_BACKEND STREQUAL "CollisionDetection") + SET(GIT_SHA1_COLLISIONDETECT 1) + ADD_DEFINITIONS(-DSHA1DC_NO_STANDARD_INCLUDES=1) + ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\") + ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\") + FILE(GLOB SRC_SHA1 hash/sha1/collisiondetect.* hash/sha1/sha1dc/*) +ELSEIF(SHA1_BACKEND STREQUAL "OpenSSL") + # OPENSSL_FOUND should already be set, we're checking HTTPS_BACKEND + + SET(GIT_SHA1_OPENSSL 1) + IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + LIST(APPEND LIBGIT2_PC_LIBS "-lssl") + ELSE() + LIST(APPEND LIBGIT2_PC_REQUIRES "openssl") + ENDIF() + FILE(GLOB SRC_SHA1 hash/sha1/openssl.*) +ELSEIF(SHA1_BACKEND STREQUAL "CommonCrypto") + SET(GIT_SHA1_COMMON_CRYPTO 1) + FILE(GLOB SRC_SHA1 hash/sha1/common_crypto.*) +ELSEIF(SHA1_BACKEND STREQUAL "mbedTLS") + SET(GIT_SHA1_MBEDTLS 1) + FILE(GLOB SRC_SHA1 hash/sha1/mbedtls.*) + LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${MBEDTLS_INCLUDE_DIR}) + LIST(APPEND LIBGIT2_LIBS ${MBEDTLS_LIBRARIES}) + # mbedTLS has no pkgconfig file, hence we can't require it + # https://github.com/ARMmbed/mbedtls/issues/228 + # For now, pass its link flags as our own + LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES}) +ELSEIF(SHA1_BACKEND STREQUAL "Win32") + SET(GIT_SHA1_WIN32 1) + FILE(GLOB SRC_SHA1 hash/sha1/win32.*) +ELSEIF(SHA1_BACKEND STREQUAL "Generic") + FILE(GLOB SRC_SHA1 hash/sha1/generic.*) +# ELSEIF(NOT USE_SHA1) +ELSE() + MESSAGE(FATAL_ERROR "Asked for unknown SHA1 backend: ${SHA1_BACKEND}") +ENDIF() + +ADD_FEATURE_INFO(SHA ON "using ${SHA1_BACKEND}")
  83. Download patch debian/libgit2/cmake/Modules/PkgBuildConfig.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/PkgBuildConfig.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/PkgBuildConfig.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,77 @@ +# pkg-config file generation +# + +function(pkg_build_config) + set(options) + set(oneValueArgs NAME DESCRIPTION VERSION FILENAME LIBS_SELF) + set(multiValueArgs LIBS PRIVATE_LIBS REQUIRES CFLAGS) + + cmake_parse_arguments(PKGCONFIG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if (NOT DEFINED PKGCONFIG_FILENAME AND DEFINED PKGCONFIG_NAME) + set(PKGCONFIG_FILENAME ${PKGCONFIG_NAME}) + endif() + if (NOT DEFINED PKGCONFIG_FILENAME) + message(FATAL_ERROR "Missing FILENAME argument") + endif() + set(PKGCONFIG_FILE "${PROJECT_BINARY_DIR}/${PKGCONFIG_FILENAME}.pc") + + if (NOT DEFINED PKGCONFIG_DESCRIPTION) + message(FATAL_ERROR "Missing DESCRIPTION argument") + endif() + + if (NOT DEFINED PKGCONFIG_VERSION) + message(FATAL_ERROR "Missing VERSION argument") + endif() + + # Write .pc "header" + file(WRITE "${PKGCONFIG_FILE}" + "prefix=\"${CMAKE_INSTALL_PREFIX}\"\n" + "libdir=\"${CMAKE_INSTALL_FULL_LIBDIR}\"\n" + "includedir=\"${CMAKE_INSTALL_FULL_INCLUDEDIR}\"\n" + "\n" + "Name: ${PKGCONFIG_NAME}\n" + "Description: ${PKGCONFIG_DESCRIPTION}\n" + "Version: ${PKGCONFIG_VERSION}\n" + ) + + # Prepare Libs + if(NOT DEFINED PKGCONFIG_LIBS_SELF) + set(PKGCONFIG_LIBS_SELF "${PKGCONFIG_FILE}") + endif() + + if(NOT DEFINED PKGCONFIG_LIBS) + set(PKGCONFIG_LIBS "-l${PKGCONFIG_LIBS_SELF}") + else() + list(INSERT PKGCONFIG_LIBS 0 "-l${PKGCONFIG_LIBS_SELF}") + endif() + + list(REMOVE_DUPLICATES PKGCONFIG_LIBS) + string(REPLACE ";" " " PKGCONFIG_LIBS "${PKGCONFIG_LIBS}") + file(APPEND "${PKGCONFIG_FILE}" "Libs: -L\${libdir} ${PKGCONFIG_LIBS}\n") + + # Prepare Libs.private + if(DEFINED PKGCONFIG_PRIVATE_LIBS) + list(REMOVE_DUPLICATES PKGCONFIG_PRIVATE_LIBS) + string(REPLACE ";" " " PKGCONFIG_PRIVATE_LIBS "${PKGCONFIG_PRIVATE_LIBS}") + file(APPEND "${PKGCONFIG_FILE}" "Libs.private: ${PKGCONFIG_PRIVATE_LIBS}\n") + endif() + + # Prepare Requires.private + if(DEFINED PKGCONFIG_REQUIRES) + list(REMOVE_DUPLICATES PKGCONFIG_REQUIRES) + string(REPLACE ";" " " PKGCONFIG_REQUIRES "${PKGCONFIG_REQUIRES}") + file(APPEND "${PKGCONFIG_FILE}" "Requires.private: ${PKGCONFIG_REQUIRES}\n") + endif() + + # Prepare Cflags + if(DEFINED PKGCONFIG_CFLAGS) + string(REPLACE ";" " " PKGCONFIG_CFLAGS "${PKGCONFIG_CFLAGS}") + else() + set(PKGCONFIG_CFLAGS "") + endif() + file(APPEND "${PKGCONFIG_FILE}" "Cflags: -I\${includedir} ${PKGCONFIG_CFLAGS}\n") + + # Install .pc file + install(FILES "${PKGCONFIG_FILE}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") +endfunction()
  84. Download patch debian/libgit2/cmake/Modules/FindStatNsec.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/FindStatNsec.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/FindStatNsec.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,26 @@ +INCLUDE(FeatureSummary) + +CHECK_STRUCT_HAS_MEMBER ("struct stat" st_mtim "sys/types.h;sys/stat.h" + HAVE_STRUCT_STAT_ST_MTIM LANGUAGE C) +CHECK_STRUCT_HAS_MEMBER ("struct stat" st_mtimespec "sys/types.h;sys/stat.h" + HAVE_STRUCT_STAT_ST_MTIMESPEC LANGUAGE C) +CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtime_nsec sys/stat.h + HAVE_STRUCT_STAT_MTIME_NSEC LANGUAGE C) + +IF (HAVE_STRUCT_STAT_ST_MTIM) + CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtim.tv_nsec sys/stat.h + HAVE_STRUCT_STAT_NSEC LANGUAGE C) +ELSEIF (HAVE_STRUCT_STAT_ST_MTIMESPEC) + CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtimespec.tv_nsec sys/stat.h + HAVE_STRUCT_STAT_NSEC LANGUAGE C) +ELSE () + SET( HAVE_STRUCT_STAT_NSEC ON ) +ENDIF() + +IF (HAVE_STRUCT_STAT_NSEC OR WIN32) + OPTION( USE_NSEC "Care about sub-second file mtimes and ctimes" ON ) +ELSE() + SET(USE_NSEC OFF) +ENDIF() + +ADD_FEATURE_INFO(nanoseconds USE_NSEC "whether to use sub-second file mtimes and ctimes")
  85. Download patch debian/libgit2/azure-pipelines/docker.yml

    --- 0.43.1-3/debian/libgit2/azure-pipelines/docker.yml 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/azure-pipelines/docker.yml 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,51 @@ +# These are the steps used in a container-based build in VSTS. +steps: +- ${{ if eq(parameters.qemu, 'true') }}: + - script: docker run --rm --privileged multiarch/qemu-user-static:register --reset + displayName: 'Register Docker QEMU' + +- task: cache@2 + displayName: Cache Docker layers + inputs: + key: docker + path: /tmp/dockercache +- script: | + if [ -f /tmp/dockercache/${{parameters.docker.image}}.tar ]; then docker load < /tmp/dockercache/${{parameters.docker.image}}.tar; fi + displayName: 'Load Docker cache' +- script: | + cd $(Build.SourcesDirectory)/azure-pipelines/docker && + docker build -t libgit2/${{parameters.docker.image}} --build-arg BASE=${{parameters.docker.base}} -f ${{parameters.docker.image}} . && + if [ ! -d /tmp/dockercache ]; then mkdir /tmp/dockercache; fi && + docker save libgit2/${{parameters.docker.image}} $(docker history -q libgit2/${{parameters.docker.image}} | grep -v '<missing>') > /tmp/dockercache/${{parameters.docker.image}}.tar + displayName: 'Build Docker image' +- task: docker@0 + displayName: Build + inputs: + action: 'Run an image' + imageName: libgit2/${{ parameters.docker.image }} + volumes: | + $(Build.SourcesDirectory):/home/libgit2/source + $(Build.BinariesDirectory):/home/libgit2/build + envVars: ${{ parameters.environmentVariables }} + workDir: '/home/libgit2/build' + containerCommand: '/home/libgit2/source/azure-pipelines/build.sh' + detached: false +- task: docker@0 + displayName: Test + inputs: + action: 'Run an image' + imageName: libgit2/${{ parameters.docker.image }} + volumes: | + $(Build.SourcesDirectory):/home/libgit2/source + $(Build.BinariesDirectory):/home/libgit2/build + envVars: ${{ parameters.environmentVariables }} + workDir: '/home/libgit2/build' + containerCommand: '/home/libgit2/source/azure-pipelines/test.sh' + detached: false +- task: publishtestresults@2 + displayName: Publish Test Results + condition: succeededOrFailed() + inputs: + testResultsFiles: 'results_*.xml' + searchFolder: '$(Build.BinariesDirectory)' + mergeTestResults: true
  86. Download patch debian/libgit2/include/git2/cherrypick.h

    --- 0.43.1-3/debian/libgit2/include/git2/cherrypick.h 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/include/git2/cherrypick.h 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,92 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_cherrypick_h__ +#define INCLUDE_git_cherrypick_h__ + +#include "common.h" +#include "types.h" +#include "merge.h" + +/** + * @file git2/cherrypick.h + * @brief Git cherry-pick routines + * @defgroup git_cherrypick Git cherry-pick routines + * @ingroup Git + * @{ + */ +GIT_BEGIN_DECL + +/** + * Cherry-pick options + */ +typedef struct { + unsigned int version; + + /** For merge commits, the "mainline" is treated as the parent. */ + unsigned int mainline; + + git_merge_options merge_opts; /**< Options for the merging */ + git_checkout_options checkout_opts; /**< Options for the checkout */ +} git_cherrypick_options; + +#define GIT_CHERRYPICK_OPTIONS_VERSION 1 +#define GIT_CHERRYPICK_OPTIONS_INIT {GIT_CHERRYPICK_OPTIONS_VERSION, 0, GIT_MERGE_OPTIONS_INIT, GIT_CHECKOUT_OPTIONS_INIT} + +/** + * Initialize git_cherrypick_options structure + * + * Initializes a `git_cherrypick_options` with default values. Equivalent to creating + * an instance with GIT_CHERRYPICK_OPTIONS_INIT. + * + * @param opts The `git_cherrypick_options` struct to initialize. + * @param version The struct version; pass `GIT_CHERRYPICK_OPTIONS_VERSION`. + * @return Zero on success; -1 on failure. + */ +GIT_EXTERN(int) git_cherrypick_options_init( + git_cherrypick_options *opts, + unsigned int version); + +/** + * Cherry-picks the given commit against the given "our" commit, producing an + * index that reflects the result of the cherry-pick. + * + * The returned index must be freed explicitly with `git_index_free`. + * + * @param out pointer to store the index result in + * @param repo the repository that contains the given commits + * @param cherrypick_commit the commit to cherry-pick + * @param our_commit the commit to cherry-pick against (eg, HEAD) + * @param mainline the parent of the `cherrypick_commit`, if it is a merge + * @param merge_options the merge options (or null for defaults) + * @return zero on success, -1 on failure. + */ +GIT_EXTERN(int) git_cherrypick_commit( + git_index **out, + git_repository *repo, + git_commit *cherrypick_commit, + git_commit *our_commit, + unsigned int mainline, + const git_merge_options *merge_options); + +/** + * Cherry-pick the given commit, producing changes in the index and working directory. + * + * @param repo the repository to cherry-pick + * @param commit the commit to cherry-pick + * @param cherrypick_options the cherry-pick options (or null for defaults) + * @return zero on success, -1 on failure. + */ +GIT_EXTERN(int) git_cherrypick( + git_repository *repo, + git_commit *commit, + const git_cherrypick_options *cherrypick_options); + +/** @} */ +GIT_END_DECL + +#endif +
  87. Download patch debian/libgit2/.HEADER

    --- 0.43.1-3/debian/libgit2/.HEADER 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/.HEADER 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,24 @@ +/* + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, + * as published by the Free Software Foundation. + * + * In addition to the permissions in the GNU General Public License, + * the authors give you unlimited permission to link the compiled + * version of this file into combinations with other programs, + * and to distribute those combinations without any restriction + * coming from the use of this file. (The General Public License + * restrictions do apply in other respects; for example, they cover + * modification of the file, and distribution when not linked into + * a combined executable.) + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */
  88. Download patch debian/libgit2/include/git2/indexer.h

    --- 0.43.1-3/debian/libgit2/include/git2/indexer.h 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/include/git2/indexer.h 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,146 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef _INCLUDE_git_indexer_h__ +#define _INCLUDE_git_indexer_h__ + +#include "common.h" +#include "types.h" +#include "oid.h" + +GIT_BEGIN_DECL + +/** A git indexer object */ +typedef struct git_indexer git_indexer; + +/** + * This structure is used to provide callers information about the + * progress of indexing a packfile, either directly or part of a + * fetch or clone that downloads a packfile. + */ +typedef struct git_indexer_progress { + /** number of objects in the packfile being indexed */ + unsigned int total_objects; + + /** received objects that have been hashed */ + unsigned int indexed_objects; + + /** received_objects: objects which have been downloaded */ + unsigned int received_objects; + + /** + * locally-available objects that have been injected in order + * to fix a thin pack + */ + unsigned int local_objects; + + /** number of deltas in the packfile being indexed */ + unsigned int total_deltas; + + /** received deltas that have been indexed */ + unsigned int indexed_deltas; + + /** size of the packfile received up to now */ + size_t received_bytes; +} git_indexer_progress; + +/** + * Type for progress callbacks during indexing. Return a value less + * than zero to cancel the indexing or download. + * + * @param stats Structure containing information about the state of the tran sfer + * @param payload Payload provided by caller + */ +typedef int GIT_CALLBACK(git_indexer_progress_cb)(const git_indexer_progress *stats, void *payload); + +/** + * Options for indexer configuration + */ +typedef struct git_indexer_options { + unsigned int version; + + /** progress_cb function to call with progress information */ + git_indexer_progress_cb progress_cb; + /** progress_cb_payload payload for the progress callback */ + void *progress_cb_payload; + + /** Do connectivity checks for the received pack */ + unsigned char verify; +} git_indexer_options; + +#define GIT_INDEXER_OPTIONS_VERSION 1 +#define GIT_INDEXER_OPTIONS_INIT { GIT_INDEXER_OPTIONS_VERSION } + +/** + * Initializes a `git_indexer_options` with default values. Equivalent to + * creating an instance with GIT_INDEXER_OPTIONS_INIT. + * + * @param opts the `git_indexer_options` struct to initialize. + * @param version Version of struct; pass `GIT_INDEXER_OPTIONS_VERSION` + * @return Zero on success; -1 on failure. + */ +GIT_EXTERN(int) git_indexer_options_init( + git_indexer_options *opts, + unsigned int version); + +/** + * Create a new indexer instance + * + * @param out where to store the indexer instance + * @param path to the directory where the packfile should be stored + * @param mode permissions to use creating packfile or 0 for defaults + * @param odb object database from which to read base objects when + * fixing thin packs. Pass NULL if no thin pack is expected (an error + * will be returned if there are bases missing) + * @param opts Optional structure containing additional options. See + * `git_indexer_options` above. + */ +GIT_EXTERN(int) git_indexer_new( + git_indexer **out, + const char *path, + unsigned int mode, + git_odb *odb, + git_indexer_options *opts); + +/** + * Add data to the indexer + * + * @param idx the indexer + * @param data the data to add + * @param size the size of the data in bytes + * @param stats stat storage + */ +GIT_EXTERN(int) git_indexer_append(git_indexer *idx, const void *data, size_t size, git_indexer_progress *stats); + +/** + * Finalize the pack and index + * + * Resolve any pending deltas and write out the index file + * + * @param idx the indexer + */ +GIT_EXTERN(int) git_indexer_commit(git_indexer *idx, git_indexer_progress *stats); + +/** + * Get the packfile's hash + * + * A packfile's name is derived from the sorted hashing of all object + * names. This is only correct after the index has been finalized. + * + * @param idx the indexer instance + */ +GIT_EXTERN(const git_oid *) git_indexer_hash(const git_indexer *idx); + +/** + * Free the indexer and its resources + * + * @param idx the indexer to free + */ +GIT_EXTERN(void) git_indexer_free(git_indexer *idx); + +GIT_END_DECL + +#endif
  89. Download patch debian/libgit2/include/git2/credential.h
  90. Download patch debian/libgit2/cmake/Modules/AddCFlagIfSupported.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/AddCFlagIfSupported.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/AddCFlagIfSupported.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,30 @@ +# - Append compiler flag to CMAKE_C_FLAGS if compiler supports it +# ADD_C_FLAG_IF_SUPPORTED(<flag>) +# <flag> - the compiler flag to test +# This internally calls the CHECK_C_COMPILER_FLAG macro. + +INCLUDE(CheckCCompilerFlag) + +MACRO(ADD_C_FLAG _FLAG) + STRING(TOUPPER ${_FLAG} UPCASE) + STRING(REGEX REPLACE "[-=]" "_" UPCASE_PRETTY ${UPCASE}) + STRING(REGEX REPLACE "^_+" "" UPCASE_PRETTY ${UPCASE_PRETTY}) + CHECK_C_COMPILER_FLAG(${_FLAG} IS_${UPCASE_PRETTY}_SUPPORTED) + + IF(IS_${UPCASE_PRETTY}_SUPPORTED) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_FLAG}") + ELSE() + MESSAGE(FATAL_ERROR "Required flag ${_FLAG} is not supported") + ENDIF() +ENDMACRO() + +MACRO(ADD_C_FLAG_IF_SUPPORTED _FLAG) + STRING(TOUPPER ${_FLAG} UPCASE) + STRING(REGEX REPLACE "[-=]" "_" UPCASE_PRETTY ${UPCASE}) + STRING(REGEX REPLACE "^_+" "" UPCASE_PRETTY ${UPCASE_PRETTY}) + CHECK_C_COMPILER_FLAG(${_FLAG} IS_${UPCASE_PRETTY}_SUPPORTED) + + IF(IS_${UPCASE_PRETTY}_SUPPORTED) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_FLAG}") + ENDIF() +ENDMACRO()
  91. Download patch debian/libgit2/.github/ISSUE_TEMPLATE

    --- 0.43.1-3/debian/libgit2/.github/ISSUE_TEMPLATE 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/.github/ISSUE_TEMPLATE 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,19 @@ +You are opening a _bug report_ against the libgit2 project: we use +GitHub Issues for tracking bug reports and feature requests. If you +have a question about an API or usage, please ask on StackOverflow: +http://stackoverflow.com/questions/tagged/libgit2. If you want to +have high-level discussions about the libgit2 project itself, visit +https://github.com/libgit2/discussions. + +Otherwise, to report a bug, please fill out the reproduction steps +(below) and delete these introductory paragraphs. Thanks! + +### Reproduction steps + +### Expected behavior + +### Actual behavior + +### Version of libgit2 (release number or SHA1) + +### Operating system(s) tested
  92. Download patch debian/libgit2/cmake/Modules/FindSecurity.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/FindSecurity.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/FindSecurity.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,28 @@ +# Find Security.framework +# This will define : +# +# SECURITY_FOUND +# SECURITY_LIBRARIES +# SECURITY_LDFLAGS +# SECURITY_HAS_SSLCREATECONTEXT +# + +FIND_PATH(SECURITY_INCLUDE_DIR NAMES Security/Security.h) +FIND_LIBRARY(SECURITY_LIBRARIES NAMES Security) +IF (SECURITY_INCLUDE_DIR AND SECURITY_LIBRARIES) + IF (NOT Security_FIND_QUIETLY) + MESSAGE(STATUS "Found Security ${SECURITY_LIBRARIES}") + ENDIF() + SET(SECURITY_FOUND TRUE) + SET(SECURITY_LDFLAGS "-framework Security") + CHECK_LIBRARY_EXISTS("${SECURITY_LIBRARIES}" SSLCreateContext "Security/SecureTransport.h" SECURITY_HAS_SSLCREATECONTEXT) +ENDIF () + +IF (Security_FIND_REQUIRED AND NOT SECURITY_FOUND) + MESSAGE(FATAL_ERROR "Security not found") +ENDIF() + +MARK_AS_ADVANCED( + SECURITY_INCLUDE_DIR + SECURITY_LIBRARIES +)
  93. Download patch debian/libgit2/docs/fuzzing.md

    --- 0.43.1-3/debian/libgit2/docs/fuzzing.md 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/docs/fuzzing.md 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,72 @@ +# Fuzzing + +libgit2 is currently using [libFuzzer](https://libfuzzer.info) to perform +automated fuzz testing. libFuzzer only works with clang. + +## Prerequisites for building fuzz targets: + +1. All the prerequisites for [building libgit2](https://github.com/libgit2/libgit2). +2. A recent version of clang. 6.0 is preferred. [pre-build Debian/Ubuntu + packages](https://github.com/libgit2/libgit2) + +## Build + +1. Create a build directory beneath the libgit2 source directory, and change + into it: `mkdir build && cd build` +2. Choose one sanitizers to add. The currently supported sanitizers are + [`address`](https://clang.llvm.org/docs/AddressSanitizer.html), + [`undefined`](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html), + and [`leak`/`address,leak`](https://clang.llvm.org/docs/LeakSanitizer.html). +3. Create the cmake build environment and configure the build with the + sanitizer chosen: `CC=/usr/bin/clang-6.0 CFLAGS="-fsanitize=address" cmake + -DBUILD_CLAR=OFF -DBUILD_FUZZERS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ..`. + Note that building the fuzzer targets is incompatible with the + tests and examples. +4. Build libgit2: `cmake --build .` +5. Exit the cmake build environment: `cd ..` + +## Run the fuzz targets + +1. `ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolize + LSAN_OPTIONS=allocator_may_return_null=1 + ASAN_OPTIONS=allocator_may_return_null=1 ./build/fuzzers/packfile_fuzzer + fuzzers/corpora/packfile/` + +The `LSAN_OPTIONS` and `ASAN_OPTIONS` are there to allow `malloc(3)` to return +`NULL`, which is expected if a huge chunk of memory is allocated. The +`LLVM_PROFILE_FILE` environment string can also be added to override the path +where libFuzzer will write the coverage report. + +## Get coverage + +In order to get coverage information, you need to add the "-fcoverage-mapping" +and "-fprofile-instr-generate CFLAGS, and then run the fuzz target with +`-runs=0`. That will produce a file called `default.profraw` (this behavior can +be overridden by setting the `LLVM_PROFILE_FILE="yourfile.profraw"` environment +variable). + +1. `llvm-profdata-6.0 merge -sparse default.profraw -o + fuzz_packfile_raw.profdata` transforms the data from a sparse representation + into a format that can be used by the other tools. +2. `llvm-cov-6.0 report ./build/fuzz/fuzz_packfile_raw + -instr-profile=fuzz_packfile_raw.profdata` shows a high-level per-file + coverage report. +3. `llvm-cov-6.0 show ./build/fuzz/fuzz_packfile_raw + -instr-profile=fuzz_packfile_raw.profdata [source file]` shows a line-by-line + coverage analysis of all the codebase (or a single source file). + +## Standalone mode + +In order to ensure that there are no regresions, each fuzzer target can be run +in a standalone mode. This can be done by passing `-DUSE_STANDALONE_FUZZERS=ON`. +This makes it compatible with gcc. This does not use the fuzzing engine, but +just invokes every file in the chosen corpus. + +In order to get full coverage, though, you might want to also enable one of the +sanitizers. You might need a recent version of clang to get full support. + +## References + +* [libFuzzer](https://llvm.org/docs/LibFuzzer.html) documentation. +* [Source-based Code + Coverage](https://clang.llvm.org/docs/SourceBasedCodeCoverage.html).
  94. Download patch debian/copyright
  95. Download patch debian/libgit2/include/git2/describe.h

    --- 0.43.1-3/debian/libgit2/include/git2/describe.h 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/include/git2/describe.h 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,189 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_describe_h__ +#define INCLUDE_git_describe_h__ + +#include "common.h" +#include "types.h" +#include "buffer.h" + +/** + * @file git2/describe.h + * @brief Git describing routines + * @defgroup git_describe Git describing routines + * @ingroup Git + * @{ + */ +GIT_BEGIN_DECL + +/** + * Reference lookup strategy + * + * These behave like the --tags and --all options to git-describe, + * namely they say to look for any reference in either refs/tags/ or + * refs/ respectively. + */ +typedef enum { + GIT_DESCRIBE_DEFAULT, + GIT_DESCRIBE_TAGS, + GIT_DESCRIBE_ALL, +} git_describe_strategy_t; + +/** + * Describe options structure + * + * Initialize with `GIT_DESCRIBE_OPTIONS_INIT`. Alternatively, you can + * use `git_describe_options_init`. + * + */ +typedef struct git_describe_options { + unsigned int version; + + unsigned int max_candidates_tags; /**< default: 10 */ + unsigned int describe_strategy; /**< default: GIT_DESCRIBE_DEFAULT */ + const char *pattern; + /** + * When calculating the distance from the matching tag or + * reference, only walk down the first-parent ancestry. + */ + int only_follow_first_parent; + /** + * If no matching tag or reference is found, the describe + * operation would normally fail. If this option is set, it + * will instead fall back to showing the full id of the + * commit. + */ + int show_commit_oid_as_fallback; +} git_describe_options; + +#define GIT_DESCRIBE_DEFAULT_MAX_CANDIDATES_TAGS 10 +#define GIT_DESCRIBE_DEFAULT_ABBREVIATED_SIZE 7 + +#define GIT_DESCRIBE_OPTIONS_VERSION 1 +#define GIT_DESCRIBE_OPTIONS_INIT { \ + GIT_DESCRIBE_OPTIONS_VERSION, \ + GIT_DESCRIBE_DEFAULT_MAX_CANDIDATES_TAGS, \ +} + +/** + * Initialize git_describe_options structure + * + * Initializes a `git_describe_options` with default values. Equivalent to creating + * an instance with GIT_DESCRIBE_OPTIONS_INIT. + * + * @param opts The `git_describe_options` struct to initialize. + * @param version The struct version; pass `GIT_DESCRIBE_OPTIONS_VERSION`. + * @return Zero on success; -1 on failure. + */ +GIT_EXTERN(int) git_describe_options_init(git_describe_options *opts, unsigned int version); + +/** + * Describe format options structure + * + * Initialize with `GIT_DESCRIBE_FORMAT_OPTIONS_INIT`. Alternatively, you can + * use `git_describe_format_options_init`. + * + */ +typedef struct { + unsigned int version; + + /** + * Size of the abbreviated commit id to use. This value is the + * lower bound for the length of the abbreviated string. The + * default is 7. + */ + unsigned int abbreviated_size; + + /** + * Set to use the long format even when a shorter name could be used. + */ + int always_use_long_format; + + /** + * If the workdir is dirty and this is set, this string will + * be appended to the description string. + */ + const char *dirty_suffix; +} git_describe_format_options; + +#define GIT_DESCRIBE_FORMAT_OPTIONS_VERSION 1 +#define GIT_DESCRIBE_FORMAT_OPTIONS_INIT { \ + GIT_DESCRIBE_FORMAT_OPTIONS_VERSION, \ + GIT_DESCRIBE_DEFAULT_ABBREVIATED_SIZE, \ + } + +/** + * Initialize git_describe_format_options structure + * + * Initializes a `git_describe_format_options` with default values. Equivalent to creating + * an instance with GIT_DESCRIBE_FORMAT_OPTIONS_INIT. + * + * @param opts The `git_describe_format_options` struct to initialize. + * @param version The struct version; pass `GIT_DESCRIBE_FORMAT_OPTIONS_VERSION`. + * @return Zero on success; -1 on failure. + */ +GIT_EXTERN(int) git_describe_format_options_init(git_describe_format_options *opts, unsigned int version); + +/** + * A struct that stores the result of a describe operation. + */ +typedef struct git_describe_result git_describe_result; + +/** + * Describe a commit + * + * Perform the describe operation on the given committish object. + * + * @param result pointer to store the result. You must free this once + * you're done with it. + * @param committish a committish to describe + * @param opts the lookup options (or NULL for defaults) + */ +GIT_EXTERN(int) git_describe_commit( + git_describe_result **result, + git_object *committish, + git_describe_options *opts); + +/** + * Describe a commit + * + * Perform the describe operation on the current commit and the + * worktree. After peforming describe on HEAD, a status is run and the + * description is considered to be dirty if there are. + * + * @param out pointer to store the result. You must free this once + * you're done with it. + * @param repo the repository in which to perform the describe + * @param opts the lookup options (or NULL for defaults) + */ +GIT_EXTERN(int) git_describe_workdir( + git_describe_result **out, + git_repository *repo, + git_describe_options *opts); + +/** + * Print the describe result to a buffer + * + * @param out The buffer to store the result + * @param result the result from `git_describe_commit()` or + * `git_describe_workdir()`. + * @param opts the formatting options (or NULL for defaults) + */ +GIT_EXTERN(int) git_describe_format( + git_buf *out, + const git_describe_result *result, + const git_describe_format_options *opts); + +/** + * Free the describe result. + */ +GIT_EXTERN(void) git_describe_result_free(git_describe_result *result); + +/** @} */ +GIT_END_DECL + +#endif
  96. Download patch debian/libgit2/include/git2/cred_helpers.h

    --- 0.43.1-3/debian/libgit2/include/git2/cred_helpers.h 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/include/git2/cred_helpers.h 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,15 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_cred_helpers_h__ +#define INCLUDE_git_cred_helpers_h__ + +/* These declarations have moved. */ +#ifndef GIT_DEPRECATE_HARD +# include "git2/credential_helpers.h" +#endif + +#endif
  97. Download patch debian/libgit2/docs/error-handling.md
  98. Download patch debian/libgit2/include/git2/errors.h

    --- 0.43.1-3/debian/libgit2/include/git2/errors.h 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/include/git2/errors.h 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,163 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_errors_h__ +#define INCLUDE_git_errors_h__ + +#include "common.h" + +/** + * @file git2/errors.h + * @brief Git error handling routines and variables + * @ingroup Git + * @{ + */ +GIT_BEGIN_DECL + +/** Generic return codes */ +typedef enum { + GIT_OK = 0, /**< No error */ + + GIT_ERROR = -1, /**< Generic error */ + GIT_ENOTFOUND = -3, /**< Requested object could not be found */ + GIT_EEXISTS = -4, /**< Object exists preventing operation */ + GIT_EAMBIGUOUS = -5, /**< More than one object matches */ + GIT_EBUFS = -6, /**< Output buffer too short to hold data */ + + /** + * GIT_EUSER is a special error that is never generated by libgit2 + * code. You can return it from a callback (e.g to stop an iteration) + * to know that it was generated by the callback and not by libgit2. + */ + GIT_EUSER = -7, + + GIT_EBAREREPO = -8, /**< Operation not allowed on bare repository */ + GIT_EUNBORNBRANCH = -9, /**< HEAD refers to branch with no commits */ + GIT_EUNMERGED = -10, /**< Merge in progress prevented operation */ + GIT_ENONFASTFORWARD = -11, /**< Reference was not fast-forwardable */ + GIT_EINVALIDSPEC = -12, /**< Name/ref spec was not in a valid format */ + GIT_ECONFLICT = -13, /**< Checkout conflicts prevented operation */ + GIT_ELOCKED = -14, /**< Lock file prevented operation */ + GIT_EMODIFIED = -15, /**< Reference value does not match expected */ + GIT_EAUTH = -16, /**< Authentication error */ + GIT_ECERTIFICATE = -17, /**< Server certificate is invalid */ + GIT_EAPPLIED = -18, /**< Patch/merge has already been applied */ + GIT_EPEEL = -19, /**< The requested peel operation is not possible */ + GIT_EEOF = -20, /**< Unexpected EOF */ + GIT_EINVALID = -21, /**< Invalid operation or input */ + GIT_EUNCOMMITTED = -22, /**< Uncommitted changes in index prevented operation */ + GIT_EDIRECTORY = -23, /**< The operation is not valid for a directory */ + GIT_EMERGECONFLICT = -24, /**< A merge conflict exists and cannot continue */ + + GIT_PASSTHROUGH = -30, /**< A user-configured callback refused to act */ + GIT_ITEROVER = -31, /**< Signals end of iteration with iterator */ + GIT_RETRY = -32, /**< Internal only */ + GIT_EMISMATCH = -33, /**< Hashsum mismatch in object */ + GIT_EINDEXDIRTY = -34, /**< Unsaved changes in the index would be overwritten */ + GIT_EAPPLYFAIL = -35, /**< Patch application failed */ +} git_error_code; + +/** + * Structure to store extra details of the last error that occurred. + * + * This is kept on a per-thread basis if GIT_THREADS was defined when the + * library was build, otherwise one is kept globally for the library + */ +typedef struct { + char *message; + int klass; +} git_error; + +/** Error classes */ +typedef enum { + GIT_ERROR_NONE = 0, + GIT_ERROR_NOMEMORY, + GIT_ERROR_OS, + GIT_ERROR_INVALID, + GIT_ERROR_REFERENCE, + GIT_ERROR_ZLIB, + GIT_ERROR_REPOSITORY, + GIT_ERROR_CONFIG, + GIT_ERROR_REGEX, + GIT_ERROR_ODB, + GIT_ERROR_INDEX, + GIT_ERROR_OBJECT, + GIT_ERROR_NET, + GIT_ERROR_TAG, + GIT_ERROR_TREE, + GIT_ERROR_INDEXER, + GIT_ERROR_SSL, + GIT_ERROR_SUBMODULE, + GIT_ERROR_THREAD, + GIT_ERROR_STASH, + GIT_ERROR_CHECKOUT, + GIT_ERROR_FETCHHEAD, + GIT_ERROR_MERGE, + GIT_ERROR_SSH, + GIT_ERROR_FILTER, + GIT_ERROR_REVERT, + GIT_ERROR_CALLBACK, + GIT_ERROR_CHERRYPICK, + GIT_ERROR_DESCRIBE, + GIT_ERROR_REBASE, + GIT_ERROR_FILESYSTEM, + GIT_ERROR_PATCH, + GIT_ERROR_WORKTREE, + GIT_ERROR_SHA1, + GIT_ERROR_HTTP +} git_error_t; + +/** + * Return the last `git_error` object that was generated for the + * current thread. + * + * The default behaviour of this function is to return NULL if no previous error has occurred. + * However, libgit2's error strings are not cleared aggressively, so a prior + * (unrelated) error may be returned. This can be avoided by only calling + * this function if the prior call to a libgit2 API returned an error. + * + * @return A git_error object. + */ +GIT_EXTERN(const git_error *) git_error_last(void); + +/** + * Clear the last library error that occurred for this thread. + */ +GIT_EXTERN(void) git_error_clear(void); + +/** + * Set the error message string for this thread. + * + * This function is public so that custom ODB backends and the like can + * relay an error message through libgit2. Most regular users of libgit2 + * will never need to call this function -- actually, calling it in most + * circumstances (for example, calling from within a callback function) + * will just end up having the value overwritten by libgit2 internals. + * + * This error message is stored in thread-local storage and only applies + * to the particular thread that this libgit2 call is made from. + * + * @param error_class One of the `git_error_t` enum above describing the + * general subsystem that is responsible for the error. + * @param string The formatted error message to keep + * @return 0 on success or -1 on failure + */ +GIT_EXTERN(int) git_error_set_str(int error_class, const char *string); + +/** + * Set the error message to a special value for memory allocation failure. + * + * The normal `git_error_set_str()` function attempts to `strdup()` the + * string that is passed in. This is not a good idea when the error in + * question is a memory allocation failure. That circumstance has a + * special setter function that sets the error string to a known and + * statically allocated internal value. + */ +GIT_EXTERN(void) git_error_set_oom(void); + +/** @} */ +GIT_END_DECL +#endif
  99. Download patch debian/libgit2/cmake/Modules/SelectGSSAPI.cmake

    --- 0.43.1-3/debian/libgit2/cmake/Modules/SelectGSSAPI.cmake 1970-01-01 00:00:00.000000000 +0000 +++ 0.44.1-0ubuntu1/debian/libgit2/cmake/Modules/SelectGSSAPI.cmake 2020-04-01 13:49:12.000000000 +0000 @@ -0,0 +1,56 @@ +# Select the backend to use + +# We try to find any packages our backends might use + +INCLUDE(SanitizeBool) + +FIND_PACKAGE(GSSAPI) +IF (CMAKE_SYSTEM_NAME MATCHES "Darwin") + INCLUDE(FindGSSFramework) +ENDIF() + +# Auto-select GSS backend +SanitizeBool(USE_GSSAPI) +IF (USE_GSSAPI STREQUAL ON) + IF (GSSFRAMEWORK_FOUND) + SET(GSS_BACKEND "GSS.framework") + ELSEIF(GSSAPI_FOUND) + SET(GSS_BACKEND "gssapi") + ELSE() + MESSAGE(FATAL_ERROR "Unable to autodetect a usable GSS backend." + "Please pass the backend name explicitly (-DUSE_GSS=backend)") + ENDIF() +ELSEIF(USE_GSSAPI) + # Backend was explicitly set + SET(GSS_BACKEND ${USE_GSSAPI}) +ELSE() + SET(GSS_BACKEND NO) +ENDIF() + +IF(GSS_BACKEND) + # Check that we can find what's required for the selected backend + IF (GSS_BACKEND STREQUAL "GSS.framework") + IF (NOT GSSFRAMEWORK_FOUND) + MESSAGE(FATAL_ERROR "Asked for GSS.framework backend, but it wasn't found") + ENDIF() + + LIST(APPEND LIBGIT2_LIBS ${GSSFRAMEWORK_LIBRARIES}) + + SET(GIT_GSSFRAMEWORK 1) + ADD_FEATURE_INFO(SPNEGO GIT_GSSFRAMEWORK "SPNEGO authentication support (${GSS_BACKEND})") + ELSEIF (GSS_BACKEND STREQUAL "gssapi") + IF (NOT GSSAPI_FOUND) + MESSAGE(FATAL_ERROR "Asked for gssapi GSS backend, but it wasn't found") + ENDIF() + + LIST(APPEND LIBGIT2_LIBS ${GSSAPI_LIBRARIES}) + + SET(GIT_GSSAPI 1) + ADD_FEATURE_INFO(SPNEGO GIT_GSSAPI "SPNEGO authentication support (${GSS_BACKEND})") + ELSE() + MESSAGE(FATAL_ERROR "Asked for backend ${GSS_BACKEND} but it wasn't found") + ENDIF() +ELSE() + SET(GIT_GSSAPI 0) + ADD_FEATURE_INFO(SPNEGO NO "SPNEGO authentication support") +ENDIF()
  100. Download patch crates/cargo-test-support/src/lib.rs

    --- 0.43.1-3/crates/cargo-test-support/src/lib.rs 2020-03-17 14:23:20.000000000 +0000 +++ 0.44.1-0ubuntu1/crates/cargo-test-support/src/lib.rs 2020-05-04 02:09:09.000000000 +0000 @@ -120,9 +120,7 @@ use std::str; use std::time::{self, Duration}; use std::usize; -use cargo; use cargo::util::{is_ci, CargoResult, ProcessBuilder, ProcessError, Rustc}; -use filetime; use serde_json::{self, Value}; use url::Url; @@ -1645,6 +1643,7 @@ fn substitute_macros(input: &str) -> Str ("[FINISHED]", " Finished"), ("[ERROR]", "error:"), ("[WARNING]", "warning:"), + ("[NOTE]", "note:"), ("[DOCUMENTING]", " Documenting"), ("[FRESH]", " Fresh"), ("[UPDATING]", " Updating"), @@ -1666,7 +1665,6 @@ fn substitute_macros(input: &str) -> Str ("[IGNORED]", " Ignored"), ("[INSTALLED]", " Installed"), ("[REPLACED]", " Replaced"), - ("[NOTE]", " Note"), ]; let mut result = input.to_owned(); for &(pat, subst) in &macros { @@ -1805,9 +1803,9 @@ pub fn slow_cpu_multiplier(main: u64) -> Duration::from_secs(*SLOW_CPU_MULTIPLIER * main) } -pub fn clippy_is_available() -> bool { - if let Err(e) = process("clippy-driver").arg("-V").exec_with_output() { - eprintln!("clippy-driver not available, skipping clippy test"); +pub fn command_is_available(cmd: &str) -> bool { + if let Err(e) = process(cmd).arg("-V").exec_with_output() { + eprintln!("{} not available, skipping tests", cmd); eprintln!("{:?}", e); false } else {
  101. ...
  1. cargo