Merge remote-tracking branch 'debian/debian/sid' into proxmox/bookworm

This commit is contained in:
Fabian Grünbichler 2024-10-10 09:30:04 +02:00
commit cb0c835dc8
319 changed files with 25549 additions and 5951 deletions

2
.gitattributes vendored
View File

@ -1,2 +1,4 @@
* text=auto * text=auto
ci/**/*.sh text eol=lf
script/**/*.sh text eol=lf
tests/resources/** linguist-vendored tests/resources/** linguist-vendored

View File

@ -0,0 +1,109 @@
# Run a build step in a container or directly on the Actions runner
name: Download or Build Container
description: Download a container from the package registry, or build it if it's not found
inputs:
container:
description: Container name
type: string
required: true
dockerfile:
description: Dockerfile
type: string
base:
description: Container base
type: string
registry:
description: Docker registry to read and publish to
type: string
default: ghcr.io
config-path:
description: Path to Dockerfiles
type: string
github_token:
description: GitHub Token
type: string
runs:
using: 'composite'
steps:
- name: Download container
run: |
IMAGE_NAME="${{ inputs.container }}"
DOCKERFILE_PATH="${{ inputs.dockerfile }}"
DOCKER_REGISTRY="${{ inputs.registry }}"
DOCKERFILE_ROOT="${{ inputs.config-path }}"
if [ "${DOCKERFILE_PATH}" = "" ]; then
DOCKERFILE_PATH="${DOCKERFILE_ROOT}/${IMAGE_NAME}"
else
DOCKERFILE_PATH="${DOCKERFILE_ROOT}/${DOCKERFILE_PATH}"
fi
GIT_WORKTREE=$(cd "${GITHUB_ACTION_PATH}" && git rev-parse --show-toplevel)
echo "::: git worktree is ${GIT_WORKTREE}"
cd "${GIT_WORKTREE}"
DOCKER_CONTAINER="${GITHUB_REPOSITORY}/${IMAGE_NAME}"
DOCKER_REGISTRY_CONTAINER="${DOCKER_REGISTRY}/${DOCKER_CONTAINER}"
echo "dockerfile=${DOCKERFILE_PATH}" >> $GITHUB_ENV
echo "docker-container=${DOCKER_CONTAINER}" >> $GITHUB_ENV
echo "docker-registry-container=${DOCKER_REGISTRY_CONTAINER}" >> $GITHUB_ENV
# Identify the last git commit that touched the Dockerfiles
# Use this as a hash to identify the resulting docker containers
echo "::: dockerfile path is ${DOCKERFILE_PATH}"
DOCKER_SHA=$(git log -1 --pretty=format:"%h" -- "${DOCKERFILE_PATH}")
echo "docker-sha=${DOCKER_SHA}" >> $GITHUB_ENV
echo "::: docker sha is ${DOCKER_SHA}"
DOCKER_REGISTRY_CONTAINER_SHA="${DOCKER_REGISTRY_CONTAINER}:${DOCKER_SHA}"
echo "docker-registry-container-sha=${DOCKER_REGISTRY_CONTAINER_SHA}" >> $GITHUB_ENV
echo "docker-registry-container-latest=${DOCKER_REGISTRY_CONTAINER}:latest" >> $GITHUB_ENV
echo "::: logging in to ${DOCKER_REGISTRY} as ${GITHUB_ACTOR}"
exists="true"
docker login https://${DOCKER_REGISTRY} -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN} || exists="false"
echo "::: pulling ${DOCKER_REGISTRY_CONTAINER_SHA}"
if [ "${exists}" != "false" ]; then
docker pull ${DOCKER_REGISTRY_CONTAINER_SHA} || exists="false"
fi
if [ "${exists}" = "true" ]; then
echo "::: docker container exists in registry"
echo "docker-container-exists=true" >> $GITHUB_ENV
else
echo "::: docker container does not exist in registry"
echo "docker-container-exists=false" >> $GITHUB_ENV
fi
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
- name: Create container
run: |
if [ "${{ inputs.base }}" != "" ]; then
BASE_ARG="--build-arg BASE=${{ inputs.base }}"
fi
GIT_WORKTREE=$(cd "${GITHUB_ACTION_PATH}" && git rev-parse --show-toplevel)
echo "::: git worktree is ${GIT_WORKTREE}"
cd "${GIT_WORKTREE}"
docker build -t ${{ env.docker-registry-container-sha }} --build-arg UID=$(id -u) --build-arg GID=$(id -g) ${BASE_ARG} -f ${{ env.dockerfile }} .
docker tag ${{ env.docker-registry-container-sha }} ${{ env.docker-registry-container-latest }}
shell: bash
working-directory: source/${{ inputs.config-path }}
if: env.docker-container-exists != 'true'
- name: Publish container
run: |
docker push ${{ env.docker-registry-container-sha }}
docker push ${{ env.docker-registry-container-latest }}
shell: bash
if: env.docker-container-exists != 'true' && github.event_name != 'pull_request'

View File

@ -5,14 +5,19 @@ description: Run a build step in a container or directly on the Actions runner
inputs: inputs:
command: command:
description: Command to run description: Command to run
required: true
type: string type: string
required: true
container: container:
description: Optional container to run in description: Optional container to run in
type: string type: string
container-version: container-version:
description: Version of the container to run description: Version of the container to run
type: string type: string
shell:
description: Shell to use
type: string
required: true
default: 'bash'
runs: runs:
using: 'composite' using: 'composite'
@ -35,6 +40,7 @@ runs:
-e PKG_CONFIG_PATH \ -e PKG_CONFIG_PATH \
-e SKIP_NEGOTIATE_TESTS \ -e SKIP_NEGOTIATE_TESTS \
-e SKIP_SSH_TESTS \ -e SKIP_SSH_TESTS \
-e SKIP_PUSHOPTIONS_TESTS \
-e TSAN_OPTIONS \ -e TSAN_OPTIONS \
-e UBSAN_OPTIONS \ -e UBSAN_OPTIONS \
${{ inputs.container-version }} \ ${{ inputs.container-version }} \
@ -42,4 +48,4 @@ runs:
else else
${{ inputs.command }} ${{ inputs.command }}
fi fi
shell: bash shell: ${{ inputs.shell != '' && inputs.shell || 'bash' }}

6
.github/release.yml vendored
View File

@ -21,9 +21,15 @@ changelog:
- title: Documentation improvements - title: Documentation improvements
labels: labels:
- documentation - documentation
- title: Platform compatibility fixes
labels:
- compatibility
- title: Git compatibility fixes - title: Git compatibility fixes
labels: labels:
- git compatibility - git compatibility
- title: Dependency updates
labels:
- dependency
- title: Other changes - title: Other changes
labels: labels:
- '*' - '*'

View File

@ -6,10 +6,14 @@ on:
schedule: schedule:
- cron: '15 4 * * *' - cron: '15 4 * * *'
permissions:
contents: read
jobs: jobs:
# Run our nightly builds. We build a matrix with the various build # Run our benchmarks. We build a matrix with the various build
# targets and their details. Then we build either in a docker container # targets and their details. Unlike our CI builds, we run these
# (Linux) or on the actual hosts (macOS, Windows). # directly on the VM instead of in containers since we do not
# need the breadth of platform diversity.
build: build:
# Only run scheduled workflows on the main repository; prevents people # Only run scheduled workflows on the main repository; prevents people
# from using build minutes on their forks. # from using build minutes on their forks.
@ -27,7 +31,7 @@ jobs:
os: ubuntu-latest os: ubuntu-latest
setup-script: ubuntu setup-script: ubuntu
- name: "macOS" - name: "macOS"
os: macos-11 os: macos-12
env: env:
CC: clang CC: clang
CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release
@ -45,12 +49,12 @@ jobs:
id: windows id: windows
setup-script: win32 setup-script: win32
fail-fast: false fail-fast: false
name: "Build ${{ matrix.platform.name }}" name: "Benchmark ${{ matrix.platform.name }}"
env: ${{ matrix.platform.env }} env: ${{ matrix.platform.env }}
runs-on: ${{ matrix.platform.os }} runs-on: ${{ matrix.platform.os }}
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
path: source path: source
fetch-depth: 0 fetch-depth: 0
@ -72,11 +76,65 @@ jobs:
fi fi
mkdir benchmark && cd benchmark mkdir benchmark && cd benchmark
../source/tests/benchmarks/benchmark.sh --baseline-cli "git" --cli "${GIT2_CLI}" --json benchmarks.json --zip benchmarks.zip ../source/tests/benchmarks/benchmark.sh --baseline-cli "git" --cli "${GIT2_CLI}" --name libgit2 --json benchmarks.json --zip benchmarks.zip
shell: bash shell: bash
- name: Upload results - name: Upload results
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v4
with: with:
name: benchmark-${{ matrix.platform.id }} name: benchmark-${{ matrix.platform.id }}
path: benchmark path: benchmark
if: always() if: always()
# Publish the results
publish:
name: Publish results
needs: [ build ]
if: ${{ always() && github.repository == 'libgit2/libgit2' }}
runs-on: ubuntu-latest
steps:
- name: Check out benchmark repository
uses: actions/checkout@v4
with:
repository: libgit2/benchmarks
path: site
fetch-depth: 0
ssh-key: ${{ secrets.BENCHMARKS_PUBLISH_KEY }}
- name: Download test results
uses: actions/download-artifact@v4
- name: Publish API
run: |
# Move today's benchmark run into the right place
for platform in linux macos windows; do
TIMESTAMP=$(jq .time.start < "benchmark-${platform}/benchmarks.json")
TIMESTAMP_LEN=$(echo -n ${TIMESTAMP} | wc -c | xargs)
DENOMINATOR=1
if [ "${TIMESTAMP_LEN}" = "19" ]; then
DENOMINATOR="1000000000"
elif [ "${TIMESTAMP_LEN}" = "13" ]; then
DENOMINATOR="1000"
else
echo "unknown timestamp"
exit 1
fi
if [[ "$(uname -s)" == "Darwin" ]]; then
DATE=$(date -R -r $(("${TIMESTAMP}/${DENOMINATOR}")) +"%Y-%m-%d")
else
DATE=$(date -d @$(("${TIMESTAMP}/${DENOMINATOR}")) +"%Y-%m-%d")
fi
mkdir -p "site/public/api/runs/${DATE}"
cp "benchmark-${platform}/benchmarks.json" "site/public/api/runs/${DATE}/${platform}.json"
done
(cd site && node scripts/aggregate.js)
(
cd site &&
git config user.name 'Benchmark Site Generation' &&
git config user.email 'libgit2@users.noreply.github.com' &&
git add . &&
git commit --allow-empty -m"benchmark update ${DATE}" &&
git push origin main
)
shell: bash

View File

@ -24,6 +24,7 @@ jobs:
- name: xenial - name: xenial
- name: bionic - name: bionic
- name: focal - name: focal
- name: noble
- name: docurium - name: docurium
- name: bionic-x86 - name: bionic-x86
dockerfile: bionic dockerfile: bionic
@ -39,11 +40,12 @@ jobs:
qemu: true qemu: true
- name: centos7 - name: centos7
- name: centos8 - name: centos8
- name: fedora
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: "Create container: ${{ matrix.container.name }}" name: "Create container: ${{ matrix.container.name }}"
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
path: source path: source
fetch-depth: 0 fetch-depth: 0

118
.github/workflows/experimental.yml vendored Normal file
View File

@ -0,0 +1,118 @@
# Validation builds for experimental features; these shouldn't be
# required for pull request approval.
name: Experimental Features
on:
push:
branches: [ main, maint/* ]
pull_request:
branches: [ main, maint/* ]
workflow_dispatch:
env:
docker-registry: ghcr.io
docker-config-path: ci/docker
permissions:
contents: write
packages: write
jobs:
# Run our CI/CD builds. We build a matrix with the various build targets
# and their details. Then we build either in a docker container (Linux)
# or on the actual hosts (macOS, Windows).
build:
strategy:
matrix:
platform:
# All builds: experimental SHA256 support
- name: "Linux (SHA256, Xenial, Clang, OpenSSL)"
id: linux-sha256
os: ubuntu-latest
container:
name: xenial
env:
CC: clang
CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON -DEXPERIMENTAL_SHA256=ON
- name: "macOS (SHA256)"
id: macos-sha256
os: macos-12
setup-script: osx
env:
CC: clang
CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON -DEXPERIMENTAL_SHA256=ON
CMAKE_GENERATOR: Ninja
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
- name: "Windows (SHA256, amd64, Visual Studio)"
id: windows-sha256
os: windows-2019
env:
ARCH: amd64
CMAKE_GENERATOR: Visual Studio 16 2019
CMAKE_OPTIONS: -A x64 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DEXPERIMENTAL_SHA256=ON
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
fail-fast: false
env: ${{ matrix.platform.env }}
runs-on: ${{ matrix.platform.os }}
name: "Build: ${{ matrix.platform.name }}"
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
path: source
fetch-depth: 0
- name: Set up build environment
run: source/ci/setup-${{ matrix.platform.setup-script }}-build.sh
shell: bash
if: matrix.platform.setup-script != ''
- name: Setup QEMU
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
if: matrix.platform.container.qemu == true
- name: Set up container
uses: ./source/.github/actions/download-or-build-container
with:
registry: ${{ env.docker-registry }}
config-path: ${{ env.docker-config-path }}
container: ${{ matrix.platform.container.name }}
github_token: ${{ secrets.github_token }}
dockerfile: ${{ matrix.platform.container.dockerfile }}
if: matrix.platform.container.name != ''
- name: Prepare build
run: mkdir build
- name: Build
uses: ./source/.github/actions/run-build
with:
command: cd ${BUILD_WORKSPACE:-.}/build && ../source/ci/build.sh
container: ${{ matrix.platform.container.name }}
container-version: ${{ env.docker-registry-container-sha }}
shell: ${{ matrix.platform.shell }}
- name: Test
uses: ./source/.github/actions/run-build
with:
command: cd ${BUILD_WORKSPACE:-.}/build && ../source/ci/test.sh
container: ${{ matrix.platform.container.name }}
container-version: ${{ env.docker-registry-container-sha }}
shell: ${{ matrix.platform.shell }}
- name: Upload test results
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results-${{ matrix.platform.id }}
path: build/results_*.xml
test_results:
name: Test results
needs: [ build ]
if: always()
runs-on: ubuntu-latest
steps:
- name: Download test results
uses: actions/download-artifact@v3
- name: Generate test summary
uses: test-summary/action@v2
with:
paths: 'test-results-*/*.xml'

View File

@ -11,66 +11,68 @@ on:
env: env:
docker-registry: ghcr.io docker-registry: ghcr.io
docker-config-path: source/ci/docker docker-config-path: ci/docker
permissions:
contents: write
packages: write
jobs: jobs:
containers:
uses: ./.github/workflows/build-containers.yml
# Run our CI/CD builds. We build a matrix with the various build targets # Run our CI/CD builds. We build a matrix with the various build targets
# and their details. Then we build either in a docker container (Linux) # and their details. Then we build either in a docker container (Linux)
# or on the actual hosts (macOS, Windows). # or on the actual hosts (macOS, Windows).
build: build:
needs: [ containers ]
strategy: strategy:
matrix: matrix:
platform: platform:
- name: "Linux (Xenial, GCC, OpenSSL)" # All builds: core platforms
- name: "Linux (Noble, GCC, OpenSSL, libssh2)"
id: noble-gcc-openssl
os: ubuntu-latest
container:
name: noble
env:
CC: gcc
CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=libssh2 -DDEBUG_STRICT_ALLOC=ON -DDEBUG_STRICT_OPEN=ON
- name: "Linux (Noble, Clang, mbedTLS, OpenSSH)"
id: noble-clang-mbedtls
os: ubuntu-latest
container:
name: noble
env:
CC: clang
CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=exec
CMAKE_GENERATOR: Ninja
- name: "Linux (Xenial, GCC, OpenSSL, OpenSSH)"
id: xenial-gcc-openssl id: xenial-gcc-openssl
os: ubuntu-latest
container: container:
name: xenial name: xenial
env: env:
CC: gcc CC: gcc
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON -DDEBUG_STRICT_ALLOC=ON -DDEBUG_STRICT_OPEN=ON CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=exec -DDEBUG_STRICT_ALLOC=ON -DDEBUG_STRICT_OPEN=ON
os: ubuntu-latest - name: "Linux (Xenial, Clang, mbedTLS, libssh2)"
- name: Linux (Xenial, GCC, mbedTLS)
id: xenial-gcc-mbedtls id: xenial-gcc-mbedtls
container:
name: xenial
env:
CC: gcc
CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
os: ubuntu-latest os: ubuntu-latest
- name: "Linux (Xenial, Clang, OpenSSL)"
id: xenial-clang-openssl
container: container:
name: xenial name: xenial
env: env:
CC: clang CC: clang
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=libssh2
os: ubuntu-latest
- name: "Linux (Xenial, Clang, mbedTLS)"
id: xenial-clang-mbedtls
container:
name: xenial
env:
CC: clang
CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
CMAKE_GENERATOR: Ninja
os: ubuntu-latest
- name: "macOS" - name: "macOS"
id: macos id: macos
os: macos-11 os: macos-12
setup-script: osx
env: env:
CC: clang CC: clang
CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON
CMAKE_GENERATOR: Ninja
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
SKIP_SSH_TESTS: true SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true SKIP_NEGOTIATE_TESTS: true
setup-script: osx
- name: "Windows (amd64, Visual Studio, Schannel)" - name: "Windows (amd64, Visual Studio, Schannel)"
id: windows-amd64-vs id: windows-amd64-vs
os: windows-2019 os: windows-2019
@ -120,13 +122,15 @@ jobs:
SKIP_SSH_TESTS: true SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true SKIP_NEGOTIATE_TESTS: true
# Sanitizers # All builds: sanitizers
- name: "Sanitizer (Memory)" - name: "Sanitizer (Memory)"
id: memorysanitizer id: sanitizer-memory
os: ubuntu-latest
setup-script: sanitizer
container: container:
name: focal name: noble
env: env:
CC: clang-10 CC: clang
CFLAGS: -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer CFLAGS: -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local/msan -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local/msan -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja
@ -134,13 +138,29 @@ jobs:
SKIP_NEGOTIATE_TESTS: true SKIP_NEGOTIATE_TESTS: true
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10 ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
UBSAN_OPTIONS: print_stacktrace=1 UBSAN_OPTIONS: print_stacktrace=1
- name: "Sanitizer (Address)"
id: sanitizer-address
os: ubuntu-latest os: ubuntu-latest
- name: "Sanitizer (UndefinedBehavior)" setup-script: sanitizer
id: ubsanitizer
container: container:
name: focal name: noble
env: env:
CC: clang-10 CC: clang
CFLAGS: -fsanitize=address -ggdb -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON
CMAKE_GENERATOR: Ninja
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
UBSAN_OPTIONS: print_stacktrace=1
- name: "Sanitizer (UndefinedBehavior)"
id: sanitizer-ub
os: ubuntu-latest
setup-script: sanitizer
container:
name: noble
env:
CC: clang
CFLAGS: -fsanitize=undefined,nullability -fno-sanitize-recover=undefined,nullability -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer CFLAGS: -fsanitize=undefined,nullability -fno-sanitize-recover=undefined,nullability -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local -DUSE_HTTPS=OpenSSL -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local -DUSE_HTTPS=OpenSSL -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja
@ -148,13 +168,14 @@ jobs:
SKIP_NEGOTIATE_TESTS: true SKIP_NEGOTIATE_TESTS: true
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10 ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
UBSAN_OPTIONS: print_stacktrace=1 UBSAN_OPTIONS: print_stacktrace=1
os: ubuntu-latest
- name: "Sanitizer (Thread)" - name: "Sanitizer (Thread)"
id: threadsanitizer id: sanitizer-thread
os: ubuntu-latest
setup-script: sanitizer
container: container:
name: focal name: noble
env: env:
CC: clang-10 CC: clang
CFLAGS: -fsanitize=thread -fno-optimize-sibling-calls -fno-omit-frame-pointer CFLAGS: -fsanitize=thread -fno-optimize-sibling-calls -fno-omit-frame-pointer
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local -DUSE_HTTPS=OpenSSL -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local -DUSE_HTTPS=OpenSSL -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja
@ -163,44 +184,13 @@ jobs:
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10 ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
UBSAN_OPTIONS: print_stacktrace=1 UBSAN_OPTIONS: print_stacktrace=1
TSAN_OPTIONS: suppressions=/home/libgit2/source/script/thread-sanitizer.supp second_deadlock_stack=1 TSAN_OPTIONS: suppressions=/home/libgit2/source/script/thread-sanitizer.supp second_deadlock_stack=1
os: ubuntu-latest
# Experimental: SHA256 support
- name: "Linux (SHA256, Xenial, Clang, OpenSSL)"
id: xenial-clang-openssl
container:
name: xenial
env:
CC: clang
CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON -DEXPERIMENTAL_SHA256=ON
os: ubuntu-latest
- name: "macOS (SHA256)"
id: macos
os: macos-11
env:
CC: clang
CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON -DEXPERIMENTAL_SHA256=ON
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
setup-script: osx
- name: "Windows (SHA256, amd64, Visual Studio)"
id: windows-amd64-vs
os: windows-2019
env:
ARCH: amd64
CMAKE_GENERATOR: Visual Studio 16 2019
CMAKE_OPTIONS: -A x64 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DEXPERIMENTAL_SHA256=ON
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
fail-fast: false fail-fast: false
env: ${{ matrix.platform.env }} env: ${{ matrix.platform.env }}
runs-on: ${{ matrix.platform.os }} runs-on: ${{ matrix.platform.os }}
name: "Build: ${{ matrix.platform.name }}" name: "Build: ${{ matrix.platform.name }}"
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
path: source path: source
fetch-depth: 0 fetch-depth: 0
@ -211,38 +201,33 @@ jobs:
- name: Setup QEMU - name: Setup QEMU
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
if: matrix.platform.container.qemu == true if: matrix.platform.container.qemu == true
- name: Download container - name: Set up container
run: | uses: ./source/.github/actions/download-or-build-container
"${{ github.workspace }}/source/ci/getcontainer.sh" "${{ matrix.platform.container.name }}" "${{ matrix.platform.container.dockerfile }}" with:
env: registry: ${{ env.docker-registry }}
DOCKER_REGISTRY: ${{ env.docker-registry }} config-path: ${{ env.docker-config-path }}
GITHUB_TOKEN: ${{ secrets.github_token }} container: ${{ matrix.platform.container.name }}
working-directory: ${{ env.docker-config-path }} github_token: ${{ secrets.github_token }}
dockerfile: ${{ matrix.platform.container.dockerfile }}
if: matrix.platform.container.name != '' if: matrix.platform.container.name != ''
- name: Create container
run: |
if [ "${{ matrix.container.base }}" != "" ]; then
BASE_ARG="--build-arg BASE=${{ matrix.container.base }}"
fi
docker build -t ${{ env.docker-registry-container-sha }} --build-arg UID=$(id -u) --build-arg GID=$(id -g) ${BASE_ARG} -f ${{ env.dockerfile }} .
working-directory: ${{ env.docker-config-path }}
if: matrix.platform.container.name != '' && env.docker-container-exists != 'true'
- name: Prepare build - name: Prepare build
run: mkdir build run: mkdir build
- name: Build - name: Build
uses: ./source/.github/actions/run-build uses: ./source/.github/actions/run-build
with: with:
command: cd build && ../source/ci/build.sh command: cd ${BUILD_WORKSPACE:-.}/build && ../source/ci/build.sh
container: ${{ matrix.platform.container.name }} container: ${{ matrix.platform.container.name }}
container-version: ${{ env.docker-registry-container-sha }} container-version: ${{ env.docker-registry-container-sha }}
shell: ${{ matrix.platform.shell }}
- name: Test - name: Test
uses: ./source/.github/actions/run-build uses: ./source/.github/actions/run-build
with: with:
command: cd build && ../source/ci/test.sh command: cd ${BUILD_WORKSPACE:-.}/build && ../source/ci/test.sh
container: ${{ matrix.platform.container.name }} container: ${{ matrix.platform.container.name }}
container-version: ${{ env.docker-registry-container-sha }} container-version: ${{ env.docker-registry-container-sha }}
shell: ${{ matrix.platform.shell }}
- name: Upload test results - name: Upload test results
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
if: success() || failure() if: success() || failure()
with: with:
name: test-results-${{ matrix.platform.id }} name: test-results-${{ matrix.platform.id }}
@ -269,15 +254,22 @@ jobs:
# published to our documentation site. # published to our documentation site.
documentation: documentation:
name: Generate documentation name: Generate documentation
needs: [ containers ]
if: success() || failure() if: success() || failure()
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
path: source path: source
fetch-depth: 0 fetch-depth: 0
- name: Set up container
uses: ./source/.github/actions/download-or-build-container
with:
registry: ${{ env.docker-registry }}
config-path: ${{ env.docker-config-path }}
container: docurium
github_token: ${{ secrets.github_token }}
dockerfile: ${{ matrix.platform.container.dockerfile }}
- name: Generate documentation - name: Generate documentation
working-directory: source working-directory: source
run: | run: |
@ -293,7 +285,7 @@ jobs:
cm doc api.docurium cm doc api.docurium
git checkout gh-pages git checkout gh-pages
zip --exclude .git/\* --exclude .gitignore --exclude .gitattributes -r api-documentation.zip . zip --exclude .git/\* --exclude .gitignore --exclude .gitattributes -r api-documentation.zip .
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v4
name: Upload artifact name: Upload artifact
with: with:
name: api-documentation name: api-documentation

View File

@ -8,7 +8,11 @@ on:
env: env:
docker-registry: ghcr.io docker-registry: ghcr.io
docker-config-path: source/ci/docker docker-config-path: ci/docker
permissions:
contents: read
packages: write
jobs: jobs:
# Run our nightly builds. We build a matrix with the various build # Run our nightly builds. We build a matrix with the various build
@ -22,179 +26,80 @@ jobs:
strategy: strategy:
matrix: matrix:
platform: platform:
- name: Linux (Xenial, GCC, OpenSSL) # All builds: core platforms
- name: "Linux (Noble, GCC, OpenSSL, libssh2)"
id: noble-gcc-openssl
os: ubuntu-latest
container:
name: noble
env:
CC: gcc
CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=libssh2 -DDEBUG_STRICT_ALLOC=ON -DDEBUG_STRICT_OPEN=ON
- name: "Linux (Noble, Clang, mbedTLS, OpenSSH)"
id: noble-clang-mbedtls
os: ubuntu-latest
container:
name: noble
env:
CC: clang
CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=exec
CMAKE_GENERATOR: Ninja
- name: "Linux (Xenial, GCC, OpenSSL, OpenSSH)"
id: xenial-gcc-openssl
os: ubuntu-latest
container: container:
name: xenial name: xenial
env: env:
CC: gcc CC: gcc
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=exec -DDEBUG_STRICT_ALLOC=ON -DDEBUG_STRICT_OPEN=ON
- name: "Linux (Xenial, Clang, mbedTLS, libssh2)"
id: xenial-gcc-mbedtls
os: ubuntu-latest os: ubuntu-latest
- name: "Linux (Xenial, GCC, mbedTLS)"
container:
name: xenial
env:
CC: gcc
CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
os: ubuntu-latest
- name: "Linux (Xenial, Clang, OpenSSL)"
container: container:
name: xenial name: xenial
env: env:
CC: clang CC: clang
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=libssh2
os: ubuntu-latest
- name: "Linux (Xenial, Clang, mbedTLS)"
container:
name: xenial
env:
CC: clang
CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
CMAKE_GENERATOR: Ninja
os: ubuntu-latest
- name: "Linux (no threads)"
container:
name: xenial
env:
CC: gcc
CMAKE_OPTIONS: -DTHREADSAFE=OFF -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
CMAKE_GENERATOR: Ninja
os: ubuntu-latest
- name: "Linux (dynamically-loaded OpenSSL)"
container:
name: xenial
env:
CC: clang
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
CMAKE_GENERATOR: Ninja
os: ubuntu-latest
- name: "Linux (MemorySanitizer)"
container:
name: focal
env:
CC: clang-10
CFLAGS: -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local/msan -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON
CMAKE_GENERATOR: Ninja
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
UBSAN_OPTIONS: print_stacktrace=1
os: ubuntu-latest
- name: "Linux (UndefinedBehaviorSanitizer)"
container:
name: focal
env:
CC: clang-10
CFLAGS: -fsanitize=undefined,nullability -fno-sanitize-recover=undefined,nullability -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local -DUSE_HTTPS=OpenSSL -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON
CMAKE_GENERATOR: Ninja
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
os: ubuntu-latest
- name: "Linux (ThreadSanitizer)"
container:
name: focal
env:
CC: clang-10
CFLAGS: -fsanitize=thread -fno-optimize-sibling-calls -fno-omit-frame-pointer
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local -DUSE_HTTPS=OpenSSL -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON
CMAKE_GENERATOR: Ninja
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
TSAN_OPTIONS: suppressions=/home/libgit2/source/script/thread-sanitizer.supp second_deadlock_stack=1
os: ubuntu-latest
- name: "Linux (no mmap)"
container:
name: focal
env:
CC: clang-10
CFLAGS: -DNO_MMAP
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local
CMAKE_GENERATOR: Ninja
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
os: ubuntu-latest
- name: "Linux (CentOS 7)"
container:
name: centos7
env:
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
SKIP_NEGOTIATE_TESTS: true
os: ubuntu-latest
- name: "Linux (CentOS 7, dynamically-loaded OpenSSL)"
container:
name: centos7
env:
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
SKIP_NEGOTIATE_TESTS: true
os: ubuntu-latest
- name: "Linux (CentOS 8)"
container:
name: centos8
env:
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
SKIP_NEGOTIATE_TESTS: true
SKIP_SSH_TESTS: true
os: ubuntu-latest
- name: "Linux (CentOS 8, dynamically-loaded OpenSSL)"
container:
name: centos8
env:
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
SKIP_NEGOTIATE_TESTS: true
SKIP_SSH_TESTS: true
os: ubuntu-latest
- name: "macOS" - name: "macOS"
os: macos-11 id: macos
os: macos-12
setup-script: osx
env: env:
CC: clang CC: clang
CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON
CMAKE_GENERATOR: Ninja
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
SKIP_SSH_TESTS: true SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true SKIP_NEGOTIATE_TESTS: true
setup-script: osx - name: "Windows (amd64, Visual Studio, Schannel)"
- name: "Windows (amd64, Visual Studio, WinHTTP)" id: windows-amd64-vs
os: windows-2019 os: windows-2019
setup-script: win32
env: env:
ARCH: amd64 ARCH: amd64
CMAKE_GENERATOR: Visual Studio 16 2019 CMAKE_GENERATOR: Visual Studio 16 2019
CMAKE_OPTIONS: -A x64 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_HTTPS=WinHTTP CMAKE_OPTIONS: -A x64 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_HTTPS=Schannel -DUSE_SSH=ON -DCMAKE_PREFIX_PATH=D:\Temp\libssh2
BUILD_PATH: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin;D:\Temp\libssh2\bin
BUILD_TEMP: D:\Temp
SKIP_SSH_TESTS: true SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true SKIP_NEGOTIATE_TESTS: true
- name: "Windows (x86, Visual Studio, WinHTTP)" - name: "Windows (x86, Visual Studio, WinHTTP)"
id: windows-x86-vs
os: windows-2019 os: windows-2019
setup-script: win32
env: env:
ARCH: x86 ARCH: x86
CMAKE_GENERATOR: Visual Studio 16 2019 CMAKE_GENERATOR: Visual Studio 16 2019
CMAKE_OPTIONS: -A Win32 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_HTTPS=WinHTTP -DUSE_SHA1=HTTPS -DUSE_BUNDLED_ZLIB=ON CMAKE_OPTIONS: -A Win32 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON -DCMAKE_PREFIX_PATH=D:\Temp\libssh2
SKIP_SSH_TESTS: true BUILD_PATH: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin;D:\Temp\libssh2\bin
SKIP_NEGOTIATE_TESTS: true BUILD_TEMP: D:\Temp
- name: "Windows (amd64, Visual Studio, Schannel)"
os: windows-2019
env:
ARCH: amd64
CMAKE_GENERATOR: Visual Studio 16 2019
CMAKE_OPTIONS: -A x64 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_HTTPS=Schannel
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
- name: "Windows (x86, Visual Studio, Schannel)"
os: windows-2019
env:
ARCH: x86
CMAKE_GENERATOR: Visual Studio 16 2019
CMAKE_OPTIONS: -A Win32 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_HTTPS=Schannel -DUSE_BUNDLED_ZLIB=ON
SKIP_SSH_TESTS: true SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true SKIP_NEGOTIATE_TESTS: true
- name: "Windows (amd64, mingw, WinHTTP)" - name: "Windows (amd64, mingw, WinHTTP)"
id: windows-amd64-mingw
os: windows-2019 os: windows-2019
setup-script: mingw setup-script: mingw
env: env:
@ -206,6 +111,7 @@ jobs:
SKIP_SSH_TESTS: true SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true SKIP_NEGOTIATE_TESTS: true
- name: "Windows (x86, mingw, Schannel)" - name: "Windows (x86, mingw, Schannel)"
id: windows-x86-mingw
os: windows-2019 os: windows-2019
setup-script: mingw setup-script: mingw
env: env:
@ -216,16 +122,108 @@ jobs:
BUILD_PATH: D:\Temp\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin BUILD_PATH: D:\Temp\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
SKIP_SSH_TESTS: true SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true SKIP_NEGOTIATE_TESTS: true
- name: "Windows (no mmap)"
os: windows-2019 # All builds: sanitizers
- name: "Sanitizer (Memory)"
id: memorysanitizer
os: ubuntu-latest
setup-script: sanitizer
container:
name: noble
env: env:
ARCH: amd64 CC: clang-17
CMAKE_GENERATOR: Visual Studio 16 2019 CFLAGS: -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer
CFLAGS: -DNO_MMAP CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local/msan -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON
CMAKE_OPTIONS: -A x64 -DDEPRECATE_HARD=ON CMAKE_GENERATOR: Ninja
SKIP_SSH_TESTS: true SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true SKIP_NEGOTIATE_TESTS: true
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
UBSAN_OPTIONS: print_stacktrace=1
- name: "Sanitizer (UndefinedBehavior)"
id: ubsanitizer
os: ubuntu-latest
setup-script: sanitizer
container:
name: noble
env:
CC: clang-17
CFLAGS: -fsanitize=undefined,nullability -fno-sanitize-recover=undefined,nullability -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local -DUSE_HTTPS=OpenSSL -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON
CMAKE_GENERATOR: Ninja
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
UBSAN_OPTIONS: print_stacktrace=1
- name: "Sanitizer (Thread)"
id: threadsanitizer
os: ubuntu-latest
setup-script: sanitizer
container:
name: noble
env:
CC: clang-17
CFLAGS: -fsanitize=thread -fno-optimize-sibling-calls -fno-omit-frame-pointer
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local -DUSE_HTTPS=OpenSSL -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON
CMAKE_GENERATOR: Ninja
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
UBSAN_OPTIONS: print_stacktrace=1
TSAN_OPTIONS: suppressions=/home/libgit2/source/script/thread-sanitizer.supp second_deadlock_stack=1
# Nightly builds: extended platforms
- name: "Linux (CentOS 7, OpenSSL)"
id: centos7-openssl
os: ubuntu-latest
container:
name: centos7
env:
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
SKIP_NEGOTIATE_TESTS: true
SKIP_PUSHOPTIONS_TESTS: true
- name: "Linux (CentOS 7, dynamically-loaded OpenSSL)"
id: centos7-dynamicopenssl
os: ubuntu-latest
container:
name: centos7
env:
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
SKIP_NEGOTIATE_TESTS: true
SKIP_PUSHOPTIONS_TESTS: true
- name: "Linux (CentOS 8, OpenSSL)"
id: centos8-openssl
os: ubuntu-latest
container:
name: centos8
env:
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
SKIP_NEGOTIATE_TESTS: true
SKIP_SSH_TESTS: true
- name: "Linux (CentOS 8, dynamically-loaded OpenSSL)"
id: centos8-dynamicopenssl
os: ubuntu-latest
container:
name: centos8
env:
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
SKIP_NEGOTIATE_TESTS: true
SKIP_SSH_TESTS: true
ARCH: x86
- name: "Linux (Fedora, llhttp)"
id: fedora
os: ubuntu-latest
container:
name: fedora
env:
CC: gcc
CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=pcre2 -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=libssh2 -DUSE_HTTP_PARSER=llhttp
- name: "Linux (Bionic, GCC, dynamically-loaded OpenSSL)" - name: "Linux (Bionic, GCC, dynamically-loaded OpenSSL)"
id: bionic-gcc-dynamicopenssl
container: container:
name: bionic name: bionic
dockerfile: bionic dockerfile: bionic
@ -234,8 +232,10 @@ jobs:
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
RUN_INVASIVE_TESTS: true RUN_INVASIVE_TESTS: true
SKIP_PUSHOPTIONS_TESTS: true
os: ubuntu-latest os: ubuntu-latest
- name: "Linux (x86, Bionic, Clang, OpenSSL)" - name: "Linux (x86, Bionic, Clang, OpenSSL)"
id: bionic-x86-clang-openssl
container: container:
name: bionic-x86 name: bionic-x86
dockerfile: bionic dockerfile: bionic
@ -245,8 +245,10 @@ jobs:
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
RUN_INVASIVE_TESTS: true RUN_INVASIVE_TESTS: true
SKIP_PUSHOPTIONS_TESTS: true
os: ubuntu-latest os: ubuntu-latest
- name: "Linux (x86, Bionic, GCC, OpenSSL)" - name: "Linux (x86, Bionic, GCC, OpenSSL)"
id: bionic-x86-gcc-openssl
container: container:
name: bionic-x86 name: bionic-x86
dockerfile: bionic dockerfile: bionic
@ -255,8 +257,10 @@ jobs:
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
RUN_INVASIVE_TESTS: true RUN_INVASIVE_TESTS: true
SKIP_PUSHOPTIONS_TESTS: true
os: ubuntu-latest os: ubuntu-latest
- name: "Linux (arm32, Bionic, GCC, OpenSSL)" - name: "Linux (arm32, Bionic, GCC, OpenSSL)"
id: bionic-arm32-gcc-openssl
container: container:
name: bionic-arm32 name: bionic-arm32
dockerfile: bionic dockerfile: bionic
@ -267,9 +271,11 @@ jobs:
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON -DUSE_SSH=ON CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON -DUSE_SSH=ON
RUN_INVASIVE_TESTS: true RUN_INVASIVE_TESTS: true
SKIP_PROXY_TESTS: true SKIP_PROXY_TESTS: true
SKIP_PUSHOPTIONS_TESTS: true
GITTEST_FLAKY_STAT: true GITTEST_FLAKY_STAT: true
os: ubuntu-latest os: ubuntu-latest
- name: "Linux (arm64, Bionic, GCC, OpenSSL)" - name: "Linux (arm64, Bionic, GCC, OpenSSL)"
id: bionic-arm64-gcc-openssl
container: container:
name: bionic-arm64 name: bionic-arm64
dockerfile: bionic dockerfile: bionic
@ -280,11 +286,57 @@ jobs:
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON -DUSE_SSH=ON CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON -DUSE_SSH=ON
RUN_INVASIVE_TESTS: true RUN_INVASIVE_TESTS: true
SKIP_PROXY_TESTS: true SKIP_PROXY_TESTS: true
SKIP_PUSHOPTIONS_TESTS: true
os: ubuntu-latest os: ubuntu-latest
# Experimental: SHA256 support # Nightly builds: ensure we fallback when missing core functionality
- name: "Linux (no threads)"
id: xenial-nothreads
os: ubuntu-latest
container:
name: xenial
env:
CC: gcc
CMAKE_OPTIONS: -DTHREADSAFE=OFF -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
CMAKE_GENERATOR: Ninja
SKIP_PUSHOPTIONS_TESTS: true
- name: "Linux (no mmap)"
id: noble-nommap
os: ubuntu-latest
container:
name: noble
env:
CC: gcc
CFLAGS: -DNO_MMAP
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local
CMAKE_GENERATOR: Ninja
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
- name: "Windows (no mmap)"
id: windows-nommap
os: windows-2019
env:
ARCH: amd64
CMAKE_GENERATOR: Visual Studio 16 2019
CFLAGS: -DNO_MMAP
CMAKE_OPTIONS: -A x64 -DDEPRECATE_HARD=ON
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
# Nightly builds: extended SSL support
- name: "Linux (dynamically-loaded OpenSSL)"
id: xenial-dynamicopenssl
os: ubuntu-latest
container:
name: xenial
env:
CC: clang
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
CMAKE_GENERATOR: Ninja
# All builds: experimental SHA256 support
- name: "Linux (SHA256, Xenial, Clang, OpenSSL)" - name: "Linux (SHA256, Xenial, Clang, OpenSSL)"
id: xenial-clang-openssl id: linux-sha256
container: container:
name: xenial name: xenial
env: env:
@ -293,17 +345,17 @@ jobs:
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
os: ubuntu-latest os: ubuntu-latest
- name: "macOS (SHA256)" - name: "macOS (SHA256)"
id: macos id: macos-sha256
os: macos-10.15 os: macos-12
setup-script: osx
env: env:
CC: clang CC: clang
CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON -DEXPERIMENTAL_SHA256=ON CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON -DEXPERIMENTAL_SHA256=ON
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
SKIP_SSH_TESTS: true SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true SKIP_NEGOTIATE_TESTS: true
setup-script: osx
- name: "Windows (SHA256, amd64, Visual Studio)" - name: "Windows (SHA256, amd64, Visual Studio)"
id: windows-amd64-vs id: windows-sha256
os: windows-2019 os: windows-2019
env: env:
ARCH: amd64 ARCH: amd64
@ -317,7 +369,7 @@ jobs:
name: "Build ${{ matrix.platform.name }}" name: "Build ${{ matrix.platform.name }}"
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
path: source path: source
fetch-depth: 0 fetch-depth: 0
@ -328,32 +380,50 @@ jobs:
- name: Setup QEMU - name: Setup QEMU
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
if: matrix.platform.container.qemu == true if: matrix.platform.container.qemu == true
- name: Download container - name: Set up container
run: | uses: ./source/.github/actions/download-or-build-container
"${{ github.workspace }}/source/ci/getcontainer.sh" "${{ matrix.platform.container.name }}" "${{ matrix.platform.container.dockerfile }}" with:
env: registry: ${{ env.docker-registry }}
DOCKER_REGISTRY: ${{ env.docker-registry }} config-path: ${{ env.docker-config-path }}
GITHUB_TOKEN: ${{ secrets.github_token }} container: ${{ matrix.platform.container.name }}
working-directory: ${{ env.docker-config-path }} github_token: ${{ secrets.github_token }}
dockerfile: ${{ matrix.platform.container.dockerfile }}
if: matrix.platform.container.name != '' if: matrix.platform.container.name != ''
- name: Create container
run: docker build -t ${{ env.docker-registry-container-sha }} -f ${{ env.dockerfile }} .
working-directory: ${{ env.docker-config-path }}
if: matrix.platform.container.name != '' && env.docker-container-exists != 'true'
- name: Prepare build - name: Prepare build
run: mkdir build run: mkdir build
- name: Build - name: Build
uses: ./source/.github/actions/run-build uses: ./source/.github/actions/run-build
with: with:
command: cd build && ../source/ci/build.sh command: cd ${BUILD_WORKSPACE:-.}/build && ../source/ci/build.sh
container: ${{ matrix.platform.container.name }} container: ${{ matrix.platform.container.name }}
container-version: ${{ env.docker-registry-container-sha }} container-version: ${{ env.docker-registry-container-sha }}
shell: ${{ matrix.platform.shell }}
- name: Test - name: Test
uses: ./source/.github/actions/run-build uses: ./source/.github/actions/run-build
with: with:
command: cd build && ../source/ci/test.sh command: cd ${BUILD_WORKSPACE:-.}/build && ../source/ci/test.sh
container: ${{ matrix.platform.container.name }} container: ${{ matrix.platform.container.name }}
container-version: ${{ env.docker-registry-container-sha }} container-version: ${{ env.docker-registry-container-sha }}
shell: ${{ matrix.platform.shell }}
- name: Upload test results
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results-${{ matrix.platform.id }}
path: build/results_*.xml
test_results:
name: Test results
needs: [ build ]
if: ${{ always() && github.repository == 'libgit2/libgit2' }}
runs-on: ubuntu-latest
steps:
- name: Download test results
uses: actions/download-artifact@v3
- name: Generate test summary
uses: test-summary/action@v2
with:
paths: 'test-results-*/*.xml'
coverity: coverity:
# Only run scheduled workflows on the main repository; prevents people # Only run scheduled workflows on the main repository; prevents people
@ -364,17 +434,18 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
path: source path: source
fetch-depth: 0 fetch-depth: 0
- name: Download container - name: Set up container
run: | uses: ./source/.github/actions/download-or-build-container
"${{ github.workspace }}/source/ci/getcontainer.sh" xenial with:
env: registry: ${{ env.docker-registry }}
DOCKER_REGISTRY: ${{ env.docker-registry }} config-path: ${{ env.docker-config-path }}
GITHUB_TOKEN: ${{ secrets.github_token }} container: xenial
working-directory: ${{ env.docker-config-path }} github_token: ${{ secrets.github_token }}
if: matrix.platform.container.name != ''
- name: Run Coverity - name: Run Coverity
run: source/ci/coverity.sh run: source/ci/coverity.sh
env: env:
@ -385,11 +456,16 @@ jobs:
# from using build minutes on their forks. # from using build minutes on their forks.
if: github.repository == 'libgit2/libgit2' if: github.repository == 'libgit2/libgit2'
permissions:
actions: read
contents: read
security-events: write
name: CodeQL name: CodeQL
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0

View File

@ -6,7 +6,7 @@
cmake_minimum_required(VERSION 3.5.1) cmake_minimum_required(VERSION 3.5.1)
project(libgit2 VERSION "1.7.2" LANGUAGES C) project(libgit2 VERSION "1.8.2" LANGUAGES C)
# Add find modules to the path # Add find modules to the path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
@ -30,7 +30,7 @@ option(USE_THREADS "Use threads for parallel processing when possibl
option(USE_NSEC "Support nanosecond precision file mtimes and ctimes" ON) option(USE_NSEC "Support nanosecond precision file mtimes and ctimes" ON)
# Backend selection # Backend selection
option(USE_SSH "Link with libssh2 to enable SSH support" OFF) option(USE_SSH "Enable SSH support. Can be set to a specific backend" OFF)
option(USE_HTTPS "Enable HTTPS support. Can be set to a specific backend" ON) option(USE_HTTPS "Enable HTTPS support. Can be set to a specific backend" ON)
option(USE_SHA1 "Enable SHA1. Can be set to CollisionDetection(ON)/HTTPS" ON) option(USE_SHA1 "Enable SHA1. Can be set to CollisionDetection(ON)/HTTPS" ON)
option(USE_SHA256 "Enable SHA256. Can be set to HTTPS/Builtin" ON) option(USE_SHA256 "Enable SHA256. Can be set to HTTPS/Builtin" ON)

196
COPYING
View File

@ -365,7 +365,7 @@ Public License instead of this License.
The bundled ZLib code is licensed under the ZLib license: The bundled ZLib code is licensed under the ZLib license:
Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler (C) 1995-2022 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -1214,3 +1214,197 @@ AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
----------------------------------------------------------------------
The bundled ntlmclient code is licensed under the MIT license:
Copyright (c) Edward Thomson. All rights reserved.
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.
----------------------------------------------------------------------
Portions of this software derived from Team Explorer Everywhere:
Copyright (c) Microsoft Corporation
All rights reserved.
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.
---------------------------------------------------------------------------
Portions of this software derived from the LLVM Compiler Infrastructure:
Copyright (c) 2003-2016 University of Illinois at Urbana-Champaign.
All rights reserved.
Developed by:
LLVM Team
University of Illinois at Urbana-Champaign
http://llvm.org
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal with
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:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
* Neither the names of the LLVM Team, University of Illinois at
Urbana-Champaign, nor the names of its contributors may be used to
endorse or promote products derived from this Software without specific
prior written permission.
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
CONTRIBUTORS 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 WITH THE
SOFTWARE.
---------------------------------------------------------------------------
Portions of this software derived from Unicode, Inc:
Copyright 2001-2004 Unicode, Inc.
Disclaimer
This source code is provided as is by Unicode, Inc. No claims are
made as to fitness for any particular purpose. No warranties of any
kind are expressed or implied. The recipient agrees to determine
applicability of information provided. If this file has been
purchased on magnetic or optical media from Unicode, Inc., the
sole remedy for any claim will be exchange of defective media
within 90 days of receipt.
Limitations on Rights to Redistribute This Code
Unicode, Inc. hereby grants the right to freely use the information
supplied in this file in the creation of products supporting the
Unicode Standard, and to make copies of this file in any form
for internal or external distribution as long as this notice
remains attached.
---------------------------------------------------------------------------
Portions of this software derived from sheredom/utf8.h:
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
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 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.
For more information, please refer to <http://unlicense.org/>
---------------------------------------------------------------------------
Portions of this software derived from RFC 1320:
Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD4 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD4 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
----------------------------------------------------------------------
The bundled llhttp dependency is licensed under the MIT license:
Copyright Fedor Indutny, 2018.
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.

View File

@ -3,10 +3,10 @@ libgit2 - the Git linkable library
| Build Status | | | Build Status | |
| ------------ | - | | ------------ | - |
| **main** branch CI builds | [![CI Build](https://github.com/libgit2/libgit2/workflows/CI%20Build/badge.svg?event=push)](https://github.com/libgit2/libgit2/actions?query=workflow%3A%22CI+Build%22+event%3Apush) | | **main** branch builds | [![CI Build](https://github.com/libgit2/libgit2/actions/workflows/main.yml/badge.svg?branch=main&event=push)](https://github.com/libgit2/libgit2/actions/workflows/main.yml?query=event%3Apush+branch%3Amain) [![Experimental Features](https://github.com/libgit2/libgit2/actions/workflows/experimental.yml/badge.svg?branch=main)](https://github.com/libgit2/libgit2/actions/workflows/experimental.yml?query=event%3Apush+branch%3Amain) |
| **v1.7 branch** CI builds | [![CI Build](https://github.com/libgit2/libgit2/workflows/CI%20Build/badge.svg?branch=maint%2Fv1.7&event=push)](https://github.com/libgit2/libgit2/actions?query=workflow%3A%22CI+Build%22+event%3Apush+branch%3Amaint%2Fv1.7) | | **v1.8 branch** builds | [![CI Build](https://github.com/libgit2/libgit2/actions/workflows/main.yml/badge.svg?branch=maint%2Fv1.8&event=push)](https://github.com/libgit2/libgit2/actions/workflows/main.yml?query=event%3Apush+branch%3Amaint%2Fv1.8) [![Experimental Features](https://github.com/libgit2/libgit2/actions/workflows/experimental.yml/badge.svg?branch=maint%2Fv1.8)](https://github.com/libgit2/libgit2/actions/workflows/experimental.yml?query=event%3Apush+branch%3Amaint%2Fv1.8) |
| **v1.6 branch** CI builds | [![CI Build](https://github.com/libgit2/libgit2/workflows/CI%20Build/badge.svg?branch=maint%2Fv1.6&event=push)](https://github.com/libgit2/libgit2/actions?query=workflow%3A%22CI+Build%22+event%3Apush+branch%3Amaint%2Fv1.6) | | **v1.7 branch** builds | [![CI Build](https://github.com/libgit2/libgit2/actions/workflows/main.yml/badge.svg?branch=maint%2Fv1.8&event=push)](https://github.com/libgit2/libgit2/actions/workflows/main.yml?query=event%3Apush+branch%3Amaint%2Fv1.7) |
| **Nightly** builds | [![Nightly Build](https://github.com/libgit2/libgit2/workflows/Nightly%20Build/badge.svg)](https://github.com/libgit2/libgit2/actions?query=workflow%3A%22Nightly+Build%22) [![Coverity Scan Status](https://scan.coverity.com/projects/639/badge.svg)](https://scan.coverity.com/projects/639) | | **Nightly** builds | [![Nightly Build](https://github.com/libgit2/libgit2/actions/workflows/nightly.yml/badge.svg?branch=main&event=schedule)](https://github.com/libgit2/libgit2/actions/workflows/nightly.yml) [![Coverity Scan Status](https://scan.coverity.com/projects/639/badge.svg)](https://scan.coverity.com/projects/639) |
`libgit2` is a portable, pure C implementation of the Git core methods `libgit2` is a portable, pure C implementation of the Git core methods
provided as a linkable library with a solid API, allowing to build Git provided as a linkable library with a solid API, allowing to build Git
@ -18,7 +18,7 @@ functionality into your application. Language bindings like
in your favorite language. in your favorite language.
`libgit2` is used to power Git GUI clients like `libgit2` is used to power Git GUI clients like
[GitKraken](https://gitkraken.com/) and [gmaster](https://gmaster.io/) [GitKraken](https://gitkraken.com/) and [GitButler](https://gitbutler.com/)
and on Git hosting providers like [GitHub](https://github.com/), and on Git hosting providers like [GitHub](https://github.com/),
[GitLab](https://gitlab.com/) and [GitLab](https://gitlab.com/) and
[Azure DevOps](https://azure.com/devops). [Azure DevOps](https://azure.com/devops).
@ -68,7 +68,7 @@ But if you _do_ want to use libgit2 directly - because you're building
an application in C - then you may be able use an existing binary. an application in C - then you may be able use an existing binary.
There are packages for the There are packages for the
[vcpkg](https://github.com/Microsoft/vcpkg) and [vcpkg](https://github.com/Microsoft/vcpkg) and
[conan](https://conan.io/center/libgit2) [conan](https://conan.io/center/recipes/libgit2)
package managers. And libgit2 is available in package managers. And libgit2 is available in
[Homebrew](https://formulae.brew.sh/formula/libgit2) and most Linux [Homebrew](https://formulae.brew.sh/formula/libgit2) and most Linux
distributions. distributions.
@ -113,7 +113,7 @@ Getting Help
**Getting Help** **Getting Help**
If you have questions about the library, please be sure to check out the If you have questions about the library, please be sure to check out the
[API documentation](http://libgit2.github.com/libgit2/). If you still have [API documentation](https://libgit2.org/libgit2/). If you still have
questions, reach out to us on Slack or post a question on questions, reach out to us on Slack or post a question on
[StackOverflow](http://stackoverflow.com/questions/tagged/libgit2) (with the `libgit2` tag). [StackOverflow](http://stackoverflow.com/questions/tagged/libgit2) (with the `libgit2` tag).

View File

@ -61,6 +61,8 @@ if test -n "${CC}"; then
"${CC}" --version 2>&1 | indent "${CC}" --version 2>&1 | indent
fi fi
echo "Environment:" echo "Environment:"
echo "PATH=${BUILD_PATH}" | indent
if test -n "${CC}"; then if test -n "${CC}"; then
echo "CC=${CC}" | indent echo "CC=${CC}" | indent
fi fi

View File

@ -12,7 +12,6 @@ RUN apt-get update && \
libcurl4-openssl-dev \ libcurl4-openssl-dev \
libkrb5-dev \ libkrb5-dev \
libpcre3-dev \ libpcre3-dev \
libssh2-1-dev \
libssl-dev \ libssl-dev \
libz-dev \ libz-dev \
ninja-build \ ninja-build \
@ -37,7 +36,16 @@ RUN cd /tmp && \
cd .. && \ cd .. && \
rm -rf mbedtls-mbedtls-2.16.2 rm -rf mbedtls-mbedtls-2.16.2
FROM mbedtls AS adduser FROM mbedtls AS libssh2
RUN cd /tmp && \
curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.11.0.tar.gz | tar -xz && \
cd libssh2-1.11.0 && \
CFLAGS=-fPIC cmake -G Ninja -DBUILD_SHARED_LIBS=ON . && \
ninja install && \
cd .. && \
rm -rf libssh2-1.11.0
FROM libssh2 AS adduser
ARG UID="" ARG UID=""
ARG GID="" ARG GID=""
RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \ RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \

View File

@ -18,13 +18,13 @@ RUN yum install -y \
FROM yum AS libssh2 FROM yum AS libssh2
RUN cd /tmp && \ RUN cd /tmp && \
curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.8.0.tar.gz | tar -xz && \ curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.11.0.tar.gz | tar -xz && \
cd libssh2-1.8.0 && \ cd libssh2-1.11.0 && \
./configure && \ ./configure && \
make && \ make && \
make install && \ make install && \
cd .. && \ cd .. && \
rm -rf libssh-1.8.0 rm -rf libssh-1.11.0
FROM libssh2 AS valgrind FROM libssh2 AS valgrind
RUN cd /tmp && \ RUN cd /tmp && \

View File

@ -24,13 +24,13 @@ RUN yum install -y \
FROM yum AS libssh2 FROM yum AS libssh2
RUN cd /tmp && \ RUN cd /tmp && \
curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.8.0.tar.gz | tar -xz && \ curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.11.0.tar.gz | tar -xz && \
cd libssh2-1.8.0 && \ cd libssh2-1.11.0 && \
./configure && \ ./configure && \
make && \ make && \
make install && \ make install && \
cd .. && \ cd .. && \
rm -rf libssh2-1.8.0 rm -rf libssh2-1.11.0
FROM libssh2 AS valgrind FROM libssh2 AS valgrind
RUN cd /tmp && \ RUN cd /tmp && \

52
ci/docker/fedora Normal file
View File

@ -0,0 +1,52 @@
ARG BASE=fedora:rawhide
FROM ${BASE} AS stream
RUN dnf -y distro-sync
FROM stream AS yum
RUN yum install -y \
which \
bzip2 \
git \
libarchive \
cmake \
gcc \
make \
openssl-devel \
openssh-server \
git-daemon \
java-1.8.0-openjdk-headless \
sudo \
python3 \
valgrind \
krb5-workstation \
krb5-libs \
krb5-devel \
pcre2-devel \
zlib-devel \
ninja-build \
llhttp-devel
FROM yum AS libssh2
RUN cd /tmp && \
curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.11.0.tar.gz | tar -xz && \
cd libssh2-1.11.0 && \
./configure && \
make && \
make install && \
cd .. && \
rm -rf libssh2-1.11.0
FROM libssh2 AS adduser
ARG UID=""
ARG GID=""
RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \
if [ "${GID}" != "" ]; then GROUP_ARG="--gid ${GID}"; fi && \
groupadd ${GROUP_ARG} libgit2 && \
useradd ${USER_ARG} --gid libgit2 --shell /bin/bash --create-home libgit2
FROM adduser AS configure
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
RUN mkdir /var/run/sshd
RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/local && \
ldconfig

View File

@ -53,7 +53,7 @@ RUN cd /tmp && \
cd libssh2-1.9.0 && \ cd libssh2-1.9.0 && \
mkdir build build-msan && \ mkdir build build-msan && \
cd build && \ cd build && \
CC=clang-10 CFLAGS="-fPIC" cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCRYPTO_BACKEND=Libgcrypt -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_INSTALL_PREFIX=/usr/local .. && \ CC=clang-10 CFLAGS="-fPIC" cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_INSTALL_PREFIX=/usr/local .. && \
ninja install && \ ninja install && \
cd ../build-msan && \ cd ../build-msan && \
CC=clang-10 CFLAGS="-fPIC -fsanitize=memory -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer" LDFLAGS="-fsanitize=memory" cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCRYPTO_BACKEND=mbedTLS -DCMAKE_PREFIX_PATH=/usr/local/msan -DCMAKE_INSTALL_PREFIX=/usr/local/msan .. && \ CC=clang-10 CFLAGS="-fPIC -fsanitize=memory -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer" LDFLAGS="-fsanitize=memory" cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCRYPTO_BACKEND=mbedTLS -DCMAKE_PREFIX_PATH=/usr/local/msan -DCMAKE_INSTALL_PREFIX=/usr/local/msan .. && \

88
ci/docker/noble Normal file
View File

@ -0,0 +1,88 @@
ARG BASE=ubuntu:noble
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 \
libclang-rt-17-dev \
libcurl4-gnutls-dev \
libgcrypt20-dev \
libkrb5-dev \
libpcre3-dev \
libssl-dev \
libz-dev \
llvm-17 \
make \
ninja-build \
openjdk-8-jre-headless \
openssh-server \
openssl \
pkgconf \
python3 \
sudo \
valgrind \
&& \
rm -rf /var/lib/apt/lists/* && \
mkdir /usr/local/msan
FROM apt AS mbedtls
RUN cd /tmp && \
curl --location --silent --show-error https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/mbedtls-2.28.6.tar.gz | \
tar -xz && \
cd mbedtls-mbedtls-2.28.6 && \
scripts/config.pl unset MBEDTLS_AESNI_C && \
scripts/config.pl set MBEDTLS_MD4_C 1 && \
mkdir build build-msan && \
cd build && \
CC=clang-17 CFLAGS="-fPIC" cmake -G Ninja -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=ON -DUSE_STATIC_MBEDTLS_LIBRARY=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_INSTALL_PREFIX=/usr/local .. && \
ninja install && \
cd ../build-msan && \
CC=clang-17 CFLAGS="-fPIC" cmake -G Ninja -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=ON -DUSE_STATIC_MBEDTLS_LIBRARY=OFF -DCMAKE_BUILD_TYPE=MemSanDbg -DCMAKE_INSTALL_PREFIX=/usr/local/msan .. && \
ninja install && \
cd .. && \
rm -rf mbedtls-mbedtls-2.28.6
FROM mbedtls AS libssh2
RUN cd /tmp && \
curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.11.0.tar.gz | tar -xz && \
cd libssh2-1.11.0 && \
mkdir build build-msan && \
cd build && \
CC=clang-17 CFLAGS="-fPIC" cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_INSTALL_PREFIX=/usr/local .. && \
ninja install && \
cd ../build-msan && \
CC=clang-17 CFLAGS="-fPIC -fsanitize=memory -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer" LDFLAGS="-fsanitize=memory" cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCRYPTO_BACKEND=mbedTLS -DCMAKE_PREFIX_PATH=/usr/local/msan -DCMAKE_INSTALL_PREFIX=/usr/local/msan .. && \
ninja install && \
cd .. && \
rm -rf libssh2-1.11.0
FROM libssh2 AS valgrind
RUN cd /tmp && \
curl --insecure --location --silent --show-error https://sourceware.org/pub/valgrind/valgrind-3.22.0.tar.bz2 | \
tar -xj && \
cd valgrind-3.22.0 && \
CC=clang-17 ./configure && \
make MAKEFLAGS="-j -l$(grep -c ^processor /proc/cpuinfo)" && \
make install && \
cd .. && \
rm -rf valgrind-3.22.0
FROM valgrind AS adduser
ARG UID=""
ARG GID=""
RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \
if [ "${GID}" != "" ]; then GROUP_ARG="--gid ${GID}"; fi && \
groupadd ${GROUP_ARG} libgit2 && \
useradd ${USER_ARG} --gid libgit2 --shell /bin/bash --create-home libgit2
FROM adduser AS ldconfig
RUN ldconfig
FROM ldconfig AS configure
RUN mkdir /var/run/sshd

View File

@ -53,12 +53,12 @@ RUN cd /tmp && \
FROM mbedtls AS libssh2 FROM mbedtls AS libssh2
RUN cd /tmp && \ RUN cd /tmp && \
curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.8.2.tar.gz | tar -xz && \ curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.11.0.tar.gz | tar -xz && \
cd libssh2-1.8.2 && \ cd libssh2-1.11.0 && \
CFLAGS=-fPIC cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCRYPTO_BACKEND=Libgcrypt . && \ CFLAGS=-fPIC cmake -G Ninja -DBUILD_SHARED_LIBS=ON . && \
ninja install && \ ninja install && \
cd .. && \ cd .. && \
rm -rf libssh2-1.8.2 rm -rf libssh2-1.11.0
FROM libssh2 AS valgrind FROM libssh2 AS valgrind
RUN cd /tmp && \ RUN cd /tmp && \

View File

@ -1,55 +0,0 @@
#!/bin/bash
set -e
IMAGE_NAME=$1
DOCKERFILE_PATH=$2
if [ "${IMAGE_NAME}" = "" ]; then
echo "usage: $0 image_name [dockerfile]"
exit 1
fi
if [ "${DOCKERFILE_PATH}" = "" ]; then
DOCKERFILE_PATH="${IMAGE_NAME}"
fi
if [ "${DOCKER_REGISTRY}" = "" ]; then
echo "DOCKER_REGISTRY environment variable is unset."
echo "Not running inside GitHub Actions or misconfigured?"
exit 1
fi
DOCKER_CONTAINER="${GITHUB_REPOSITORY}/${IMAGE_NAME}"
DOCKER_REGISTRY_CONTAINER="${DOCKER_REGISTRY}/${DOCKER_CONTAINER}"
echo "dockerfile=${DOCKERFILE_PATH}" >> $GITHUB_ENV
echo "docker-container=${DOCKER_CONTAINER}" >> $GITHUB_ENV
echo "docker-registry-container=${DOCKER_REGISTRY_CONTAINER}" >> $GITHUB_ENV
# Identify the last git commit that touched the Dockerfiles
# Use this as a hash to identify the resulting docker containers
DOCKER_SHA=$(git log -1 --pretty=format:"%h" -- "${DOCKERFILE_PATH}")
echo "docker-sha=${DOCKER_SHA}" >> $GITHUB_ENV
DOCKER_REGISTRY_CONTAINER_SHA="${DOCKER_REGISTRY_CONTAINER}:${DOCKER_SHA}"
echo "docker-registry-container-sha=${DOCKER_REGISTRY_CONTAINER_SHA}" >> $GITHUB_ENV
echo "docker-registry-container-latest=${DOCKER_REGISTRY_CONTAINER}:latest" >> $GITHUB_ENV
echo "::: logging in to ${DOCKER_REGISTRY} as ${GITHUB_ACTOR}"
exists="true"
docker login https://${DOCKER_REGISTRY} -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN} || exists="false"
echo "::: pulling ${DOCKER_REGISTRY_CONTAINER_SHA}"
if [ "${exists}" != "false" ]; then
docker pull ${DOCKER_REGISTRY_CONTAINER_SHA} || exists="false"
fi
if [ "${exists}" = "true" ]; then
echo "docker-container-exists=true" >> $GITHUB_ENV
else
echo "docker-container-exists=false" >> $GITHUB_ENV
fi

View File

@ -3,6 +3,6 @@
set -ex set -ex
brew update brew update
brew install pkgconfig zlib curl openssl libssh2 ninja brew install pkgconfig libssh2 ninja
ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libLeaksAtExit.dylib /usr/local/lib ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libLeaksAtExit.dylib /usr/local/lib

7
ci/setup-sanitizer-build.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
set -ex
# Linux updated its ASLR randomization in a way that is incompatible with
# TSAN. See https://github.com/google/sanitizers/issues/1716
sudo sysctl vm.mmap_rnd_bits=28

View File

@ -3,7 +3,14 @@
set -e set -e
if [ -n "$SKIP_TESTS" ]; then if [ -n "$SKIP_TESTS" ]; then
exit 0 if [ -z "$SKIP_OFFLINE_TESTS" ]; then SKIP_OFFLINE_TESTS=1; fi
if [ -z "$SKIP_ONLINE_TESTS" ]; then SKIP_ONLINE_TESTS=1; fi
if [ -z "$SKIP_GITDAEMON_TESTS" ]; then SKIP_GITDAEMON_TESTS=1; fi
if [ -z "$SKIP_PROXY_TESTS" ]; then SKIP_PROXY_TESTS=1; fi
if [ -z "$SKIP_NTLM_TESTS" ]; then SKIP_NTLM_TESTS=1; fi
if [ -z "$SKIP_NEGOTIATE_TESTS" ]; then SKIP_NEGOTIATE_TESTS=1; fi
if [ -z "$SKIP_SSH_TESTS" ]; then SKIP_SSH_TESTS=1; fi
if [ -z "$SKIP_FUZZERS" ]; then SKIP_FUZZERS=1; fi
fi fi
# Windows doesn't run the NTLM tests properly (yet) # Windows doesn't run the NTLM tests properly (yet)
@ -11,6 +18,11 @@ if [[ "$(uname -s)" == MINGW* ]]; then
SKIP_NTLM_TESTS=1 SKIP_NTLM_TESTS=1
fi fi
# older versions of git don't support push options
if [ -z "$SKIP_PUSHOPTIONS_TESTS" ]; then
export GITTEST_PUSH_OPTIONS=true
fi
SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )} SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )}
BUILD_DIR=$(pwd) BUILD_DIR=$(pwd)
BUILD_PATH=${BUILD_PATH:=$PATH} BUILD_PATH=${BUILD_PATH:=$PATH}
@ -18,12 +30,24 @@ CTEST=$(which ctest)
TMPDIR=${TMPDIR:-/tmp} TMPDIR=${TMPDIR:-/tmp}
USER=${USER:-$(whoami)} USER=${USER:-$(whoami)}
GITTEST_SSH_KEYTYPE=${GITTEST_SSH_KEYTYPE:="ecdsa"}
HOME=`mktemp -d ${TMPDIR}/home.XXXXXXXX` HOME=`mktemp -d ${TMPDIR}/home.XXXXXXXX`
export CLAR_HOMEDIR=${HOME} export CLAR_HOMEDIR=${HOME}
SUCCESS=1 SUCCESS=1
CONTINUE_ON_FAILURE=0 CONTINUE_ON_FAILURE=0
should_run() {
eval "skip=\${SKIP_${1}}"
[ -z "$skip" \
-o "$skip" == "no" -o "$skip" == "NO" \
-o "$skip" == "n" -o "$skip" == "N" \
-o "$skip" == "false" -o "$skip" == "FALSE" \
-o "$skip" == "f" -o "$skip" == "F" \
-o "$skip" == "0" ]
}
cleanup() { cleanup() {
echo "Cleaning up..." echo "Cleaning up..."
@ -78,6 +102,8 @@ run_test() {
echo "" echo ""
echo "Re-running flaky ${1} tests..." echo "Re-running flaky ${1} tests..."
echo "" echo ""
sleep 2
fi fi
RETURN_CODE=0 RETURN_CODE=0
@ -138,11 +164,12 @@ echo "##########################################################################
echo "" echo ""
if [ -z "$SKIP_GITDAEMON_TESTS" ]; then if should_run "GITDAEMON_TESTS"; then
echo "Starting git daemon (standard)..." echo "Starting git daemon (standard)..."
GIT_STANDARD_DIR=`mktemp -d ${TMPDIR}/git_standard.XXXXXXXX` GIT_STANDARD_DIR=`mktemp -d ${TMPDIR}/git_standard.XXXXXXXX`
git init --bare "${GIT_STANDARD_DIR}/test.git" >/dev/null cp -R "${SOURCE_DIR}/tests/resources/pushoptions.git" "${GIT_STANDARD_DIR}/test.git"
git daemon --listen=localhost --export-all --enable=receive-pack --base-path="${GIT_STANDARD_DIR}" "${GIT_STANDARD_DIR}" 2>/dev/null & git daemon --listen=localhost --export-all --enable=receive-pack --base-path="${GIT_STANDARD_DIR}" "${GIT_STANDARD_DIR}" 2>/dev/null &
GIT_STANDARD_PID=$! GIT_STANDARD_PID=$!
echo "Starting git daemon (namespace)..." echo "Starting git daemon (namespace)..."
@ -158,7 +185,7 @@ if [ -z "$SKIP_GITDAEMON_TESTS" ]; then
GIT_SHA256_PID=$! GIT_SHA256_PID=$!
fi fi
if [ -z "$SKIP_PROXY_TESTS" ]; then if should_run "PROXY_TESTS"; then
curl --location --silent --show-error https://github.com/ethomson/poxyproxy/releases/download/v0.7.0/poxyproxy-0.7.0.jar >poxyproxy.jar curl --location --silent --show-error https://github.com/ethomson/poxyproxy/releases/download/v0.7.0/poxyproxy-0.7.0.jar >poxyproxy.jar
echo "Starting HTTP proxy (Basic)..." echo "Starting HTTP proxy (Basic)..."
@ -170,25 +197,27 @@ if [ -z "$SKIP_PROXY_TESTS" ]; then
PROXY_NTLM_PID=$! PROXY_NTLM_PID=$!
fi fi
if [ -z "$SKIP_NTLM_TESTS" -o -z "$SKIP_ONLINE_TESTS" ]; then if should_run "NTLM_TESTS" || should_run "ONLINE_TESTS"; then
curl --location --silent --show-error https://github.com/ethomson/poxygit/releases/download/v0.6.0/poxygit-0.6.0.jar >poxygit.jar curl --location --silent --show-error https://github.com/ethomson/poxygit/releases/download/v0.6.0/poxygit-0.6.0.jar >poxygit.jar
echo "Starting HTTP server..." echo "Starting HTTP server..."
HTTP_DIR=`mktemp -d ${TMPDIR}/http.XXXXXXXX` HTTP_DIR=`mktemp -d ${TMPDIR}/http.XXXXXXXX`
git init --bare "${HTTP_DIR}/test.git" cp -R "${SOURCE_DIR}/tests/resources/pushoptions.git" "${HTTP_DIR}/test.git"
java -jar poxygit.jar --address 127.0.0.1 --port 9000 --credentials foo:baz --quiet "${HTTP_DIR}" & java -jar poxygit.jar --address 127.0.0.1 --port 9000 --credentials foo:baz --quiet "${HTTP_DIR}" &
HTTP_PID=$! HTTP_PID=$!
fi fi
if [ -z "$SKIP_SSH_TESTS" ]; then if should_run "SSH_TESTS"; then
echo "Starting SSH server..." echo "Starting SSH server..."
SSHD_DIR=`mktemp -d ${TMPDIR}/sshd.XXXXXXXX` SSHD_DIR=`mktemp -d ${TMPDIR}/sshd.XXXXXXXX`
git init --bare "${SSHD_DIR}/test.git" >/dev/null cp -R "${SOURCE_DIR}/tests/resources/pushoptions.git" "${SSHD_DIR}/test.git"
cat >"${SSHD_DIR}/sshd_config" <<-EOF cat >"${SSHD_DIR}/sshd_config" <<-EOF
Port 2222 Port 2222
ListenAddress 0.0.0.0 ListenAddress 0.0.0.0
Protocol 2 Protocol 2
HostKey ${SSHD_DIR}/id_rsa HostKey ${SSHD_DIR}/id_${GITTEST_SSH_KEYTYPE}
PidFile ${SSHD_DIR}/pid PidFile ${SSHD_DIR}/pid
AuthorizedKeysFile ${HOME}/.ssh/authorized_keys AuthorizedKeysFile ${HOME}/.ssh/authorized_keys
LogLevel DEBUG LogLevel DEBUG
@ -197,19 +226,21 @@ if [ -z "$SKIP_SSH_TESTS" ]; then
PubkeyAuthentication yes PubkeyAuthentication yes
ChallengeResponseAuthentication no ChallengeResponseAuthentication no
StrictModes no StrictModes no
HostCertificate ${SSHD_DIR}/id_${GITTEST_SSH_KEYTYPE}.pub
HostKey ${SSHD_DIR}/id_${GITTEST_SSH_KEYTYPE}
# Required here as sshd will simply close connection otherwise # Required here as sshd will simply close connection otherwise
UsePAM no UsePAM no
EOF EOF
ssh-keygen -t rsa -f "${SSHD_DIR}/id_rsa" -N "" -q ssh-keygen -t "${GITTEST_SSH_KEYTYPE}" -f "${SSHD_DIR}/id_${GITTEST_SSH_KEYTYPE}" -N "" -q
/usr/sbin/sshd -f "${SSHD_DIR}/sshd_config" -E "${SSHD_DIR}/log" /usr/sbin/sshd -f "${SSHD_DIR}/sshd_config" -E "${SSHD_DIR}/log"
# Set up keys # Set up keys
mkdir "${HOME}/.ssh" mkdir "${HOME}/.ssh"
ssh-keygen -t rsa -f "${HOME}/.ssh/id_rsa" -N "" -q ssh-keygen -t "${GITTEST_SSH_KEYTYPE}" -f "${HOME}/.ssh/id_${GITTEST_SSH_KEYTYPE}" -N "" -q
cat "${HOME}/.ssh/id_rsa.pub" >>"${HOME}/.ssh/authorized_keys" cat "${HOME}/.ssh/id_${GITTEST_SSH_KEYTYPE}.pub" >>"${HOME}/.ssh/authorized_keys"
while read algorithm key comment; do while read algorithm key comment; do
echo "[localhost]:2222 $algorithm $key" >>"${HOME}/.ssh/known_hosts" echo "[localhost]:2222 $algorithm $key" >>"${HOME}/.ssh/known_hosts"
done <"${SSHD_DIR}/id_rsa.pub" done <"${SSHD_DIR}/id_${GITTEST_SSH_KEYTYPE}.pub"
# Append the github.com keys for the tests that don't override checks. # Append the github.com keys for the tests that don't override checks.
# We ask for ssh-rsa to test that the selection based off of known_hosts # We ask for ssh-rsa to test that the selection based off of known_hosts
@ -228,7 +259,7 @@ fi
# Run the tests that do not require network connectivity. # Run the tests that do not require network connectivity.
if [ -z "$SKIP_OFFLINE_TESTS" ]; then if should_run "OFFLINE_TESTS"; then
echo "" echo ""
echo "##############################################################################" echo "##############################################################################"
echo "## Running core tests" echo "## Running core tests"
@ -259,7 +290,11 @@ if [ -n "$RUN_INVASIVE_TESTS" ]; then
unset GITTEST_INVASIVE_SPEED unset GITTEST_INVASIVE_SPEED
fi fi
if [ -z "$SKIP_ONLINE_TESTS" ]; then # the various network tests can fail due to network connectivity problems;
# allow them to retry up to 5 times
export GITTEST_FLAKY_RETRY=5
if should_run "ONLINE_TESTS"; then
# Run the online tests. The "online" test suite only includes the # Run the online tests. The "online" test suite only includes the
# default online tests that do not require additional configuration. # default online tests that do not require additional configuration.
# The "proxy" and "ssh" test suites require further setup. # The "proxy" and "ssh" test suites require further setup.
@ -288,7 +323,7 @@ if [ -z "$SKIP_ONLINE_TESTS" ]; then
run_test online_customcert run_test online_customcert
fi fi
if [ -z "$SKIP_GITDAEMON_TESTS" ]; then if should_run "GITDAEMON_TESTS"; then
echo "" echo ""
echo "Running gitdaemon (standard) tests" echo "Running gitdaemon (standard) tests"
echo "" echo ""
@ -316,7 +351,7 @@ if [ -z "$SKIP_GITDAEMON_TESTS" ]; then
unset GITTEST_REMOTE_URL unset GITTEST_REMOTE_URL
fi fi
if [ -z "$SKIP_PROXY_TESTS" ]; then if should_run "PROXY_TESTS"; then
echo "" echo ""
echo "Running proxy tests (Basic authentication)" echo "Running proxy tests (Basic authentication)"
echo "" echo ""
@ -342,7 +377,7 @@ if [ -z "$SKIP_PROXY_TESTS" ]; then
unset GITTEST_REMOTE_PROXY_PASS unset GITTEST_REMOTE_PROXY_PASS
fi fi
if [ -z "$SKIP_NTLM_TESTS" ]; then if should_run "NTLM_TESTS"; then
echo "" echo ""
echo "Running NTLM tests (IIS emulation)" echo "Running NTLM tests (IIS emulation)"
echo "" echo ""
@ -368,7 +403,7 @@ if [ -z "$SKIP_NTLM_TESTS" ]; then
unset GITTEST_REMOTE_PASS unset GITTEST_REMOTE_PASS
fi fi
if [ -z "$SKIP_NEGOTIATE_TESTS" -a -n "$GITTEST_NEGOTIATE_PASSWORD" ]; then if should_run "NEGOTIATE_TESTS" && -n "$GITTEST_NEGOTIATE_PASSWORD" ; then
echo "" echo ""
echo "Running SPNEGO tests" echo "Running SPNEGO tests"
echo "" echo ""
@ -401,13 +436,15 @@ if [ -z "$SKIP_NEGOTIATE_TESTS" -a -n "$GITTEST_NEGOTIATE_PASSWORD" ]; then
kdestroy -A kdestroy -A
fi fi
if [ -z "$SKIP_SSH_TESTS" ]; then if should_run "SSH_TESTS"; then
export GITTEST_REMOTE_USER=$USER export GITTEST_REMOTE_USER=$USER
export GITTEST_REMOTE_SSH_KEY="${HOME}/.ssh/id_rsa" export GITTEST_REMOTE_SSH_KEY="${HOME}/.ssh/id_${GITTEST_SSH_KEYTYPE}"
export GITTEST_REMOTE_SSH_PUBKEY="${HOME}/.ssh/id_rsa.pub" export GITTEST_REMOTE_SSH_PUBKEY="${HOME}/.ssh/id_${GITTEST_SSH_KEYTYPE}.pub"
export GITTEST_REMOTE_SSH_PASSPHRASE="" export GITTEST_REMOTE_SSH_PASSPHRASE=""
export GITTEST_REMOTE_SSH_FINGERPRINT="${SSH_FINGERPRINT}" export GITTEST_REMOTE_SSH_FINGERPRINT="${SSH_FINGERPRINT}"
export GITTEST_SSH_CMD="ssh -i ${HOME}/.ssh/id_${GITTEST_SSH_KEYTYPE} -o UserKnownHostsFile=${HOME}/.ssh/known_hosts"
echo "" echo ""
echo "Running ssh tests" echo "Running ssh tests"
echo "" echo ""
@ -424,6 +461,8 @@ if [ -z "$SKIP_SSH_TESTS" ]; then
run_test ssh run_test ssh
unset GITTEST_REMOTE_URL unset GITTEST_REMOTE_URL
unset GITTEST_SSH_CMD
unset GITTEST_REMOTE_USER unset GITTEST_REMOTE_USER
unset GITTEST_REMOTE_SSH_KEY unset GITTEST_REMOTE_SSH_KEY
unset GITTEST_REMOTE_SSH_PUBKEY unset GITTEST_REMOTE_SSH_PUBKEY
@ -431,7 +470,9 @@ if [ -z "$SKIP_SSH_TESTS" ]; then
unset GITTEST_REMOTE_SSH_FINGERPRINT unset GITTEST_REMOTE_SSH_FINGERPRINT
fi fi
if [ -z "$SKIP_FUZZERS" ]; then unset GITTEST_FLAKY_RETRY
if should_run "FUZZERS"; then
echo "" echo ""
echo "##############################################################################" echo "##############################################################################"
echo "## Running fuzzers" echo "## Running fuzzers"

39
cmake/FindLLHTTP.cmake Normal file
View File

@ -0,0 +1,39 @@
# - Try to find llhttp
#
# Defines the following variables:
#
# LLHTTP_FOUND - system has llhttp
# LLHTTP_INCLUDE_DIR - the llhttp include directory
# LLHTTP_LIBRARIES - Link these to use llhttp
# LLHTTP_VERSION_MAJOR - major version
# LLHTTP_VERSION_MINOR - minor version
# LLHTTP_VERSION_STRING - the version of llhttp found
# Find the header and library
find_path(LLHTTP_INCLUDE_DIR NAMES llhttp.h)
find_library(LLHTTP_LIBRARY NAMES llhttp libllhttp)
# Found the header, read version
if(LLHTTP_INCLUDE_DIR AND EXISTS "${LLHTTP_INCLUDE_DIR}/llhttp.h")
file(READ "${LLHTTP_INCLUDE_DIR}/llhttp.h" LLHTTP_H)
if(LLHTTP_H)
string(REGEX REPLACE ".*#define[\t ]+LLHTTP_VERSION_MAJOR[\t ]+([0-9]+).*" "\\1" LLHTTP_VERSION_MAJOR "${LLHTTP_H}")
string(REGEX REPLACE ".*#define[\t ]+LLHTTP_VERSION_MINOR[\t ]+([0-9]+).*" "\\1" LLHTTP_VERSION_MINOR "${LLHTTP_H}")
set(LLHTTP_VERSION_STRING "${LLHTTP_VERSION_MAJOR}.${LLHTTP_VERSION_MINOR}")
endif()
unset(LLHTTP_H)
endif()
# Handle the QUIETLY and REQUIRED arguments and set LLHTTP_FOUND
# to TRUE if all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LLHTTP REQUIRED_VARS LLHTTP_INCLUDE_DIR LLHTTP_LIBRARY)
# Hide advanced variables
mark_as_advanced(LLHTTP_INCLUDE_DIR LLHTTP_LIBRARY)
# Set standard variables
if(LLHTTP_FOUND)
set(LLHTTP_LIBRARIES ${LLHTTP_LIBRARY})
set(LLHTTP_INCLUDE_DIRS ${LLHTTP_INCLUDE_DIR})
endif()

View File

@ -1,19 +1,32 @@
# Optional external dependency: http-parser # Optional external dependency: http-parser
if(USE_HTTP_PARSER STREQUAL "system") if(USE_HTTP_PARSER STREQUAL "http-parser")
find_package(HTTPParser) find_package(HTTPParser)
if(HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2) if(HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
list(APPEND LIBGIT2_SYSTEM_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS}) list(APPEND LIBGIT2_SYSTEM_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS})
list(APPEND LIBGIT2_SYSTEM_LIBS ${HTTP_PARSER_LIBRARIES}) list(APPEND LIBGIT2_SYSTEM_LIBS ${HTTP_PARSER_LIBRARIES})
list(APPEND LIBGIT2_PC_LIBS "-lhttp_parser") list(APPEND LIBGIT2_PC_LIBS "-lhttp_parser")
add_feature_info(http-parser ON "http-parser support (system)") set(GIT_HTTPPARSER_HTTPPARSER 1)
add_feature_info(http-parser ON "using http-parser (system)")
else() else()
message(FATAL_ERROR "http-parser support was requested but not found") message(FATAL_ERROR "http-parser support was requested but not found")
endif() endif()
elseif(USE_HTTP_PARSER STREQUAL "llhttp")
find_package(LLHTTP)
if(LLHTTP_FOUND AND LLHTTP_VERSION_MAJOR EQUAL 9)
list(APPEND LIBGIT2_SYSTEM_INCLUDES ${LLHTTP_INCLUDE_DIRS})
list(APPEND LIBGIT2_SYSTEM_LIBS ${LLHTTP_LIBRARIES})
list(APPEND LIBGIT2_PC_LIBS "-lllhttp")
set(GIT_HTTPPARSER_LLHTTP 1)
add_feature_info(http-parser ON "using llhttp (system)")
else()
message(FATAL_ERROR "llhttp support was requested but not found")
endif()
else() else()
message(STATUS "http-parser version 2 was not found or disabled; using bundled 3rd-party sources.") add_subdirectory("${PROJECT_SOURCE_DIR}/deps/llhttp" "${PROJECT_BINARY_DIR}/deps/llhttp")
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/http-parser" "${PROJECT_BINARY_DIR}/deps/http-parser") list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/llhttp")
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/http-parser") list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$<TARGET_OBJECTS:llhttp>")
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$<TARGET_OBJECTS:http-parser>") set(GIT_HTTPPARSER_BUILTIN 1)
add_feature_info(http-parser ON "http-parser support (bundled)") add_feature_info(http-parser ON "using bundled parser")
endif() endif()

View File

@ -55,6 +55,10 @@ if(USE_HTTPS)
set(GIT_OPENSSL 1) set(GIT_OPENSSL 1)
list(APPEND LIBGIT2_SYSTEM_INCLUDES ${OPENSSL_INCLUDE_DIR}) list(APPEND LIBGIT2_SYSTEM_INCLUDES ${OPENSSL_INCLUDE_DIR})
list(APPEND LIBGIT2_SYSTEM_LIBS ${OPENSSL_LIBRARIES}) list(APPEND LIBGIT2_SYSTEM_LIBS ${OPENSSL_LIBRARIES})
# Static OpenSSL (lib crypto.a) requires libdl, include it explicitly
if(LINK_WITH_STATIC_LIBRARIES STREQUAL ON)
list(APPEND LIBGIT2_SYSTEM_LIBS ${CMAKE_DL_LIBS})
endif()
list(APPEND LIBGIT2_PC_LIBS ${OPENSSL_LDFLAGS}) list(APPEND LIBGIT2_PC_LIBS ${OPENSSL_LDFLAGS})
list(APPEND LIBGIT2_PC_REQUIRES "openssl") list(APPEND LIBGIT2_PC_REQUIRES "openssl")
elseif(USE_HTTPS STREQUAL "mbedTLS") elseif(USE_HTTPS STREQUAL "mbedTLS")
@ -109,8 +113,8 @@ if(USE_HTTPS)
elseif(USE_HTTPS STREQUAL "Schannel") elseif(USE_HTTPS STREQUAL "Schannel")
set(GIT_SCHANNEL 1) set(GIT_SCHANNEL 1)
list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32" "secur32") list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32")
list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32" "-lsecur32") list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32")
elseif(USE_HTTPS STREQUAL "WinHTTP") elseif(USE_HTTPS STREQUAL "WinHTTP")
set(GIT_WINHTTP 1) set(GIT_WINHTTP 1)
@ -125,8 +129,8 @@ if(USE_HTTPS)
list(APPEND LIBGIT2_PC_LIBS "-lwinhttp") list(APPEND LIBGIT2_PC_LIBS "-lwinhttp")
endif() endif()
list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32" "secur32") list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32")
list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32" "-lsecur32") list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32")
elseif(USE_HTTPS STREQUAL "OpenSSL-Dynamic") elseif(USE_HTTPS STREQUAL "OpenSSL-Dynamic")
set(GIT_OPENSSL 1) set(GIT_OPENSSL 1)
set(GIT_OPENSSL_DYNAMIC 1) set(GIT_OPENSSL_DYNAMIC 1)

View File

@ -1,6 +1,11 @@
# Optional external dependency: libssh2 if(USE_SSH STREQUAL "exec")
if(USE_SSH) set(GIT_SSH 1)
set(GIT_SSH_EXEC 1)
add_feature_info(SSH ON "using OpenSSH exec support")
elseif(USE_SSH STREQUAL ON OR USE_SSH STREQUAL "libssh2")
find_pkglibraries(LIBSSH2 libssh2) find_pkglibraries(LIBSSH2 libssh2)
if(NOT LIBSSH2_FOUND) if(NOT LIBSSH2_FOUND)
find_package(LibSSH2) find_package(LibSSH2)
set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR}) set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR})
@ -12,30 +17,28 @@ if(USE_SSH)
if(NOT LIBSSH2_FOUND) if(NOT LIBSSH2_FOUND)
message(FATAL_ERROR "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") message(FATAL_ERROR "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.")
endif() endif()
endif()
if(LIBSSH2_FOUND)
set(GIT_SSH 1)
list(APPEND LIBGIT2_SYSTEM_INCLUDES ${LIBSSH2_INCLUDE_DIRS}) list(APPEND LIBGIT2_SYSTEM_INCLUDES ${LIBSSH2_INCLUDE_DIRS})
list(APPEND LIBGIT2_SYSTEM_LIBS ${LIBSSH2_LIBRARIES}) list(APPEND LIBGIT2_SYSTEM_LIBS ${LIBSSH2_LIBRARIES})
list(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) list(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS})
check_library_exists("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) check_library_exists("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS)
if(HAVE_LIBSSH2_MEMORY_CREDENTIALS) if(HAVE_LIBSSH2_MEMORY_CREDENTIALS)
set(GIT_SSH_MEMORY_CREDENTIALS 1) set(GIT_SSH_LIBSSH2_MEMORY_CREDENTIALS 1)
endif() endif()
else()
message(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.")
endif()
if(WIN32 AND EMBED_SSH_PATH) if(WIN32 AND EMBED_SSH_PATH)
file(GLOB SSH_SRC "${EMBED_SSH_PATH}/src/*.c") file(GLOB SSH_SRC "${EMBED_SSH_PATH}/src/*.c")
list(SORT SSH_SRC) list(SORT SSH_SRC)
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS ${SSH_SRC}) list(APPEND LIBGIT2_DEPENDENCY_OBJECTS ${SSH_SRC})
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${EMBED_SSH_PATH}/include")
file(WRITE "${EMBED_SSH_PATH}/src/libssh2_config.h" "#define HAVE_WINCNG\n#define LIBSSH2_WINCNG\n#include \"../win32/libssh2_config.h\"")
endif()
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${EMBED_SSH_PATH}/include")
file(WRITE "${EMBED_SSH_PATH}/src/libssh2_config.h" "#define HAVE_WINCNG\n#define LIBSSH2_WINCNG\n#include \"../win32/libssh2_config.h\"")
set(GIT_SSH 1) set(GIT_SSH 1)
set(GIT_SSH_LIBSSH2 1)
add_feature_info(SSH ON "using libssh2")
else()
add_feature_info(SSH OFF "SSH transport support")
endif() endif()
add_feature_info(SSH GIT_SSH "SSH transport support")

43
debian/changelog vendored
View File

@ -1,3 +1,46 @@
libgit2 (1.8.2~rc1+ds2-1) unstable; urgency=medium
* Keep vendored llhttp for ports architectures
* New upstream version 1.8.2~rc1+ds2
* Update d/copyright
* Use vendored llhttp on architectures without nodejs (Closes: #1084223)
-- Timo Röhling <roehling@debian.org> Tue, 08 Oct 2024 22:45:48 +0200
libgit2 (1.8.2~rc1+ds-2) unstable; urgency=medium
* Upload to unstable.
-- Timo Röhling <roehling@debian.org> Sat, 05 Oct 2024 01:02:23 +0200
libgit2 (1.8.2~rc1+ds-1) experimental; urgency=medium
* New upstream version 1.8.2~rc1+ds
- Revert premature const correctness change to
git_commit_create() and git_commit_create_buffer()
-- Timo Röhling <roehling@debian.org> Sun, 15 Sep 2024 09:52:48 +0200
libgit2 (1.8.1+ds-2) experimental; urgency=medium
* Fix version ordering for -rc releases in d/watch
* Wrap and sort Debian package files
* Bump Standards-Version to 4.7.0
* Move back to http-parser from llhttp (Closes: #1081534)
-- Timo Röhling <roehling@debian.org> Thu, 12 Sep 2024 16:04:48 +0200
libgit2 (1.8.1+ds-1) experimental; urgency=medium
* Update Files-Excluded for newly vendored HTTP parser
* New upstream version 1.8.1+ds
* Update patches
- Drop handle-bashim.patch (merged upstream)
* Bump SONAME to 1.8
* Migrate from http-parser to llhttp
-- Timo Röhling <roehling@debian.org> Mon, 20 May 2024 11:21:07 +0200
libgit2 (1.7.2+ds-1~bpo12+pve1) proxmox-rust; urgency=medium libgit2 (1.7.2+ds-1~bpo12+pve1) proxmox-rust; urgency=medium
* Rebuild for Debian Bookworm / Proxmox * Rebuild for Debian Bookworm / Proxmox

64
debian/control vendored
View File

@ -2,22 +2,23 @@ Source: libgit2
Section: libs Section: libs
Priority: optional Priority: optional
Maintainer: Utkarsh Gupta <utkarsh@debian.org> Maintainer: Utkarsh Gupta <utkarsh@debian.org>
Uploaders: Pirate Praveen <praveen@debian.org>, Uploaders:
Mohammed Bilal <mdbilal@disroot.org>, Pirate Praveen <praveen@debian.org>,
Timo Röhling <roehling@debian.org>, Mohammed Bilal <mdbilal@disroot.org>,
Build-Depends: debhelper-compat (= 13), Timo Röhling <roehling@debian.org>,
python3-minimal:any, Build-Depends:
pkgconf, ca-certificates,
ca-certificates, cmake,
cmake, debhelper-compat (= 13),
zlib1g-dev, libkrb5-dev,
libmbedtls-dev, libllhttp-dev [amd64 arm64 armel armhf i386 mips64el ppc64el riscv64 s390x loong64 ppc64],
libssh2-1-dev, libmbedtls-dev,
libhttp-parser-dev, libpcre2-dev,
libpcre2-dev, libssh2-1-dev,
libkrb5-dev, pkgconf,
ca-certificates python3-minimal:any,
Standards-Version: 4.6.2 zlib1g-dev,
Standards-Version: 4.7.0
Homepage: https://libgit2.github.com/ Homepage: https://libgit2.github.com/
Vcs-Git: https://salsa.debian.org/debian/libgit2.git Vcs-Git: https://salsa.debian.org/debian/libgit2.git
Vcs-Browser: https://salsa.debian.org/debian/libgit2 Vcs-Browser: https://salsa.debian.org/debian/libgit2
@ -27,13 +28,14 @@ Package: libgit2-dev
Architecture: any Architecture: any
Section: libdevel Section: libdevel
Multi-Arch: same Multi-Arch: same
Depends: libgit2-1.7 (= ${binary:Version}), Depends:
zlib1g-dev, libgit2-1.8 (= ${binary:Version}),
libmbedtls-dev, libllhttp-dev [amd64 arm64 armel armhf i386 mips64el ppc64el riscv64 s390x loong64 ppc64],
libssh2-1-dev, libmbedtls-dev,
libhttp-parser-dev, libpcre2-dev,
libpcre2-dev, libssh2-1-dev,
${misc:Depends}, zlib1g-dev,
${misc:Depends},
Description: low-level Git library (development files) Description: low-level Git library (development files)
libgit2 is a portable, pure C implementation of the Git libgit2 is a portable, pure C implementation of the Git
distributed version control system core methods provided as a distributed version control system core methods provided as a
@ -41,12 +43,14 @@ Description: low-level Git library (development files)
. .
This package contains the development files for libgit2. This package contains the development files for libgit2.
Package: libgit2-1.7 Package: libgit2-1.8
Architecture: any Architecture: any
Multi-Arch: same Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends} Pre-Depends:
Depends: ${shlibs:Depends}, ${misc:Pre-Depends},
${misc:Depends}, Depends:
${misc:Depends},
${shlibs:Depends},
Description: low-level Git library Description: low-level Git library
libgit2 is a portable, pure C implementation of the Git libgit2 is a portable, pure C implementation of the Git
distributed version control system core methods provided as a distributed version control system core methods provided as a
@ -55,8 +59,10 @@ Description: low-level Git library
Package: libgit2-fixtures Package: libgit2-fixtures
Architecture: all Architecture: all
Multi-Arch: foreign Multi-Arch: foreign
Pre-Depends: ${misc:Pre-Depends} Pre-Depends:
Depends: ${misc:Depends}, ${misc:Pre-Depends},
Depends:
${misc:Depends},
Description: low-level Git library - test suite examples Description: low-level Git library - test suite examples
libgit2 is a portable, pure C implementation of the Git libgit2 is a portable, pure C implementation of the Git
distributed version control system core methods provided as a distributed version control system core methods provided as a

5
debian/copyright vendored
View File

@ -2,7 +2,6 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: libgit2 Upstream-Name: libgit2
Source: https://libgit2.github.com/ Source: https://libgit2.github.com/
Files-Excluded: deps/chromium-zlib Files-Excluded: deps/chromium-zlib
deps/http-parser
deps/ntlmclient deps/ntlmclient
deps/pcre deps/pcre
deps/winhttp deps/winhttp
@ -25,6 +24,10 @@ Files: tests/clar/*
Copyright: 2011, Vicent Marti Copyright: 2011, Vicent Marti
License: MIT License: MIT
Files: deps/llhttp/*
Copyright: 2018, Fedor Indutny
License: MIT
Files: deps/xdiff/* Files: deps/xdiff/*
Copyright: 2003, Davide Libenzi Copyright: 2003, Davide Libenzi
2003-2016, Davide Libenzi, Johannes E. Schindelin 2003-2016, Davide Libenzi, Johannes E. Schindelin

View File

@ -1,942 +0,0 @@
libgit2.so.1.7 libgit2-1.7 #MINVER#
* Build-Depends-Package: libgit2-dev
git_annotated_commit_free@Base 1.7.0
git_annotated_commit_from_fetchhead@Base 1.7.0
git_annotated_commit_from_ref@Base 1.7.0
git_annotated_commit_from_revspec@Base 1.7.0
git_annotated_commit_id@Base 1.7.0
git_annotated_commit_lookup@Base 1.7.0
git_annotated_commit_ref@Base 1.7.0
git_apply@Base 1.7.0
git_apply_options_init@Base 1.7.0
git_apply_to_tree@Base 1.7.0
git_attr_add_macro@Base 1.7.0
git_attr_cache_flush@Base 1.7.0
git_attr_foreach@Base 1.7.0
git_attr_foreach_ext@Base 1.7.0
git_attr_get@Base 1.7.0
git_attr_get_ext@Base 1.7.0
git_attr_get_many@Base 1.7.0
git_attr_get_many_ext@Base 1.7.0
git_attr_value@Base 1.7.0
git_blame_buffer@Base 1.7.0
git_blame_file@Base 1.7.0
git_blame_free@Base 1.7.0
git_blame_get_hunk_byindex@Base 1.7.0
git_blame_get_hunk_byline@Base 1.7.0
git_blame_get_hunk_count@Base 1.7.0
git_blame_init_options@Base 1.7.0
git_blame_options_init@Base 1.7.0
git_blob_create_from_buffer@Base 1.7.0
git_blob_create_from_disk@Base 1.7.0
git_blob_create_from_stream@Base 1.7.0
git_blob_create_from_stream_commit@Base 1.7.0
git_blob_create_from_workdir@Base 1.7.0
git_blob_create_frombuffer@Base 1.7.0
git_blob_create_fromdisk@Base 1.7.0
git_blob_create_fromstream@Base 1.7.0
git_blob_create_fromstream_commit@Base 1.7.0
git_blob_create_fromworkdir@Base 1.7.0
git_blob_data_is_binary@Base 1.7.0
git_blob_dup@Base 1.7.0
git_blob_filter@Base 1.7.0
git_blob_filter_options_init@Base 1.7.0
git_blob_filtered_content@Base 1.7.0
git_blob_free@Base 1.7.0
git_blob_id@Base 1.7.0
git_blob_is_binary@Base 1.7.0
git_blob_lookup@Base 1.7.0
git_blob_lookup_prefix@Base 1.7.0
git_blob_owner@Base 1.7.0
git_blob_rawcontent@Base 1.7.0
git_blob_rawsize@Base 1.7.0
git_branch_create@Base 1.7.0
git_branch_create_from_annotated@Base 1.7.0
git_branch_delete@Base 1.7.0
git_branch_is_checked_out@Base 1.7.0
git_branch_is_head@Base 1.7.0
git_branch_iterator_free@Base 1.7.0
git_branch_iterator_new@Base 1.7.0
git_branch_lookup@Base 1.7.0
git_branch_move@Base 1.7.0
git_branch_name@Base 1.7.0
git_branch_name_is_valid@Base 1.7.0
git_branch_next@Base 1.7.0
git_branch_remote_name@Base 1.7.0
git_branch_set_upstream@Base 1.7.0
git_branch_upstream@Base 1.7.0
git_branch_upstream_merge@Base 1.7.0
git_branch_upstream_name@Base 1.7.0
git_branch_upstream_remote@Base 1.7.0
git_buf_contains_nul@Base 1.7.0
git_buf_dispose@Base 1.7.0
git_buf_free@Base 1.7.0
git_buf_grow@Base 1.7.0
git_buf_is_binary@Base 1.7.0
git_buf_set@Base 1.7.0
git_checkout_head@Base 1.7.0
git_checkout_index@Base 1.7.0
git_checkout_init_options@Base 1.7.0
git_checkout_options_init@Base 1.7.0
git_checkout_tree@Base 1.7.0
git_cherrypick@Base 1.7.0
git_cherrypick_commit@Base 1.7.0
git_cherrypick_init_options@Base 1.7.0
git_cherrypick_options_init@Base 1.7.0
git_clone@Base 1.7.0
git_clone_init_options@Base 1.7.0
git_clone_options_init@Base 1.7.0
git_commit_amend@Base 1.7.0
git_commit_author@Base 1.7.0
git_commit_author_with_mailmap@Base 1.7.0
git_commit_body@Base 1.7.0
git_commit_committer@Base 1.7.0
git_commit_committer_with_mailmap@Base 1.7.0
git_commit_create@Base 1.7.0
git_commit_create_buffer@Base 1.7.0
git_commit_create_from_callback@Base 1.7.0
git_commit_create_from_ids@Base 1.7.0
git_commit_create_v@Base 1.7.0
git_commit_create_with_signature@Base 1.7.0
git_commit_dup@Base 1.7.0
git_commit_extract_signature@Base 1.7.0
git_commit_free@Base 1.7.0
git_commit_graph_free@Base 1.7.0
git_commit_graph_open@Base 1.7.0
git_commit_graph_writer_add_index_file@Base 1.7.0
git_commit_graph_writer_add_revwalk@Base 1.7.0
git_commit_graph_writer_commit@Base 1.7.0
git_commit_graph_writer_dump@Base 1.7.0
git_commit_graph_writer_free@Base 1.7.0
git_commit_graph_writer_new@Base 1.7.0
git_commit_graph_writer_options_init@Base 1.7.0
git_commit_header_field@Base 1.7.0
git_commit_id@Base 1.7.0
git_commit_lookup@Base 1.7.0
git_commit_lookup_prefix@Base 1.7.0
git_commit_message@Base 1.7.0
git_commit_message_encoding@Base 1.7.0
git_commit_message_raw@Base 1.7.0
git_commit_nth_gen_ancestor@Base 1.7.0
git_commit_owner@Base 1.7.0
git_commit_parent@Base 1.7.0
git_commit_parent_id@Base 1.7.0
git_commit_parentcount@Base 1.7.0
git_commit_raw_header@Base 1.7.0
git_commit_summary@Base 1.7.0
git_commit_time@Base 1.7.0
git_commit_time_offset@Base 1.7.0
git_commit_tree@Base 1.7.0
git_commit_tree_id@Base 1.7.0
git_config_add_backend@Base 1.7.0
git_config_add_file_ondisk@Base 1.7.0
git_config_backend_foreach_match@Base 1.7.0
git_config_delete_entry@Base 1.7.0
git_config_delete_multivar@Base 1.7.0
git_config_entry_free@Base 1.7.0
git_config_find_global@Base 1.7.0
git_config_find_programdata@Base 1.7.0
git_config_find_system@Base 1.7.0
git_config_find_xdg@Base 1.7.0
git_config_foreach@Base 1.7.0
git_config_foreach_match@Base 1.7.0
git_config_free@Base 1.7.0
git_config_get_bool@Base 1.7.0
git_config_get_entry@Base 1.7.0
git_config_get_int32@Base 1.7.0
git_config_get_int64@Base 1.7.0
git_config_get_mapped@Base 1.7.0
git_config_get_multivar_foreach@Base 1.7.0
git_config_get_path@Base 1.7.0
git_config_get_string@Base 1.7.0
git_config_get_string_buf@Base 1.7.0
git_config_init_backend@Base 1.7.0
git_config_iterator_free@Base 1.7.0
git_config_iterator_glob_new@Base 1.7.0
git_config_iterator_new@Base 1.7.0
git_config_lock@Base 1.7.0
git_config_lookup_map_value@Base 1.7.0
git_config_multivar_iterator_new@Base 1.7.0
git_config_new@Base 1.7.0
git_config_next@Base 1.7.0
git_config_open_default@Base 1.7.0
git_config_open_global@Base 1.7.0
git_config_open_level@Base 1.7.0
git_config_open_ondisk@Base 1.7.0
git_config_parse_bool@Base 1.7.0
git_config_parse_int32@Base 1.7.0
git_config_parse_int64@Base 1.7.0
git_config_parse_path@Base 1.7.0
git_config_set_bool@Base 1.7.0
git_config_set_int32@Base 1.7.0
git_config_set_int64@Base 1.7.0
git_config_set_multivar@Base 1.7.0
git_config_set_string@Base 1.7.0
git_config_snapshot@Base 1.7.0
git_config_unlock@Base 1.7.0
git_cred_default_new@Base 1.7.0
git_cred_free@Base 1.7.0
git_cred_get_username@Base 1.7.0
git_cred_has_username@Base 1.7.0
git_cred_ssh_custom_new@Base 1.7.0
git_cred_ssh_interactive_new@Base 1.7.0
git_cred_ssh_key_from_agent@Base 1.7.0
git_cred_ssh_key_memory_new@Base 1.7.0
git_cred_ssh_key_new@Base 1.7.0
git_cred_username_new@Base 1.7.0
git_cred_userpass@Base 1.7.0
git_cred_userpass_plaintext_new@Base 1.7.0
git_credential_default_new@Base 1.7.0
git_credential_free@Base 1.7.0
git_credential_get_username@Base 1.7.0
git_credential_has_username@Base 1.7.0
git_credential_ssh_custom_new@Base 1.7.0
git_credential_ssh_interactive_new@Base 1.7.0
git_credential_ssh_key_from_agent@Base 1.7.0
git_credential_ssh_key_memory_new@Base 1.7.0
git_credential_ssh_key_new@Base 1.7.0
git_credential_username_new@Base 1.7.0
git_credential_userpass@Base 1.7.0
git_credential_userpass_plaintext_new@Base 1.7.0
git_describe_commit@Base 1.7.0
git_describe_format@Base 1.7.0
git_describe_format_options_init@Base 1.7.0
git_describe_init_format_options@Base 1.7.0
git_describe_init_options@Base 1.7.0
git_describe_options_init@Base 1.7.0
git_describe_result_free@Base 1.7.0
git_describe_workdir@Base 1.7.0
git_diff_blob_to_buffer@Base 1.7.0
git_diff_blobs@Base 1.7.0
git_diff_buffers@Base 1.7.0
git_diff_commit_as_email@Base 1.7.0
git_diff_find_init_options@Base 1.7.0
git_diff_find_options_init@Base 1.7.0
git_diff_find_similar@Base 1.7.0
git_diff_foreach@Base 1.7.0
git_diff_format_email@Base 1.7.0
git_diff_format_email_init_options@Base 1.7.0
git_diff_format_email_options_init@Base 1.7.0
git_diff_free@Base 1.7.0
git_diff_from_buffer@Base 1.7.0
git_diff_get_delta@Base 1.7.0
git_diff_get_perfdata@Base 1.7.0
git_diff_get_stats@Base 1.7.0
git_diff_index_to_index@Base 1.7.0
git_diff_index_to_workdir@Base 1.7.0
git_diff_init_options@Base 1.7.0
git_diff_is_sorted_icase@Base 1.7.0
git_diff_merge@Base 1.7.0
git_diff_num_deltas@Base 1.7.0
git_diff_num_deltas_of_type@Base 1.7.0
git_diff_options_init@Base 1.7.0
git_diff_patchid@Base 1.7.0
git_diff_patchid_options_init@Base 1.7.0
git_diff_print@Base 1.7.0
git_diff_print_callback__to_buf@Base 1.7.0
git_diff_print_callback__to_file_handle@Base 1.7.0
git_diff_stats_deletions@Base 1.7.0
git_diff_stats_files_changed@Base 1.7.0
git_diff_stats_free@Base 1.7.0
git_diff_stats_insertions@Base 1.7.0
git_diff_stats_to_buf@Base 1.7.0
git_diff_status_char@Base 1.7.0
git_diff_to_buf@Base 1.7.0
git_diff_tree_to_index@Base 1.7.0
git_diff_tree_to_tree@Base 1.7.0
git_diff_tree_to_workdir@Base 1.7.0
git_diff_tree_to_workdir_with_index@Base 1.7.0
git_email_create_from_commit@Base 1.7.0
git_email_create_from_diff@Base 1.7.0
git_error_clear@Base 1.7.0
git_error_last@Base 1.7.0
git_error_set@Base 1.7.0
git_error_set_oom@Base 1.7.0
git_error_set_str@Base 1.7.0
git_fetch_init_options@Base 1.7.0
git_fetch_options_init@Base 1.7.0
git_filter_init@Base 1.7.0
git_filter_list_apply_to_blob@Base 1.7.0
git_filter_list_apply_to_buffer@Base 1.7.0
git_filter_list_apply_to_data@Base 1.7.0
git_filter_list_apply_to_file@Base 1.7.0
git_filter_list_contains@Base 1.7.0
git_filter_list_free@Base 1.7.0
git_filter_list_length@Base 1.7.0
git_filter_list_load@Base 1.7.0
git_filter_list_load_ext@Base 1.7.0
git_filter_list_new@Base 1.7.0
git_filter_list_push@Base 1.7.0
git_filter_list_stream_blob@Base 1.7.0
git_filter_list_stream_buffer@Base 1.7.0
git_filter_list_stream_data@Base 1.7.0
git_filter_list_stream_file@Base 1.7.0
git_filter_lookup@Base 1.7.0
git_filter_register@Base 1.7.0
git_filter_source_filemode@Base 1.7.0
git_filter_source_flags@Base 1.7.0
git_filter_source_id@Base 1.7.0
git_filter_source_mode@Base 1.7.0
git_filter_source_path@Base 1.7.0
git_filter_source_repo@Base 1.7.0
git_filter_unregister@Base 1.7.0
git_graph_ahead_behind@Base 1.7.0
git_graph_descendant_of@Base 1.7.0
git_graph_reachable_from_any@Base 1.7.0
git_hashsig_compare@Base 1.7.0
git_hashsig_create@Base 1.7.0
git_hashsig_create_fromfile@Base 1.7.0
git_hashsig_free@Base 1.7.0
git_ignore_add_rule@Base 1.7.0
git_ignore_clear_internal_rules@Base 1.7.0
git_ignore_path_is_ignored@Base 1.7.0
git_index_add@Base 1.7.0
git_index_add_all@Base 1.7.0
git_index_add_bypath@Base 1.7.0
git_index_add_from_buffer@Base 1.7.0
git_index_add_frombuffer@Base 1.7.0
git_index_caps@Base 1.7.0
git_index_checksum@Base 1.7.0
git_index_clear@Base 1.7.0
git_index_conflict_add@Base 1.7.0
git_index_conflict_cleanup@Base 1.7.0
git_index_conflict_get@Base 1.7.0
git_index_conflict_iterator_free@Base 1.7.0
git_index_conflict_iterator_new@Base 1.7.0
git_index_conflict_next@Base 1.7.0
git_index_conflict_remove@Base 1.7.0
git_index_entry_is_conflict@Base 1.7.0
git_index_entry_stage@Base 1.7.0
git_index_entrycount@Base 1.7.0
git_index_find@Base 1.7.0
git_index_find_prefix@Base 1.7.0
git_index_free@Base 1.7.0
git_index_get_byindex@Base 1.7.0
git_index_get_bypath@Base 1.7.0
git_index_has_conflicts@Base 1.7.0
git_index_iterator_free@Base 1.7.0
git_index_iterator_new@Base 1.7.0
git_index_iterator_next@Base 1.7.0
git_index_name_add@Base 1.7.0
git_index_name_clear@Base 1.7.0
git_index_name_entrycount@Base 1.7.0
git_index_name_get_byindex@Base 1.7.0
git_index_new@Base 1.7.0
git_index_open@Base 1.7.0
git_index_owner@Base 1.7.0
git_index_path@Base 1.7.0
git_index_read@Base 1.7.0
git_index_read_tree@Base 1.7.0
git_index_remove@Base 1.7.0
git_index_remove_all@Base 1.7.0
git_index_remove_bypath@Base 1.7.0
git_index_remove_directory@Base 1.7.0
git_index_reuc_add@Base 1.7.0
git_index_reuc_clear@Base 1.7.0
git_index_reuc_entrycount@Base 1.7.0
git_index_reuc_find@Base 1.7.0
git_index_reuc_get_byindex@Base 1.7.0
git_index_reuc_get_bypath@Base 1.7.0
git_index_reuc_remove@Base 1.7.0
git_index_set_caps@Base 1.7.0
git_index_set_version@Base 1.7.0
git_index_update_all@Base 1.7.0
git_index_version@Base 1.7.0
git_index_write@Base 1.7.0
git_index_write_tree@Base 1.7.0
git_index_write_tree_to@Base 1.7.0
git_indexer_append@Base 1.7.0
git_indexer_commit@Base 1.7.0
git_indexer_free@Base 1.7.0
git_indexer_hash@Base 1.7.0
git_indexer_init_options@Base 1.7.0
git_indexer_name@Base 1.7.0
git_indexer_new@Base 1.7.0
git_indexer_options_init@Base 1.7.0
git_libgit2_features@Base 1.7.0
git_libgit2_init@Base 1.7.0
git_libgit2_opts@Base 1.7.0
git_libgit2_prerelease@Base 1.7.0
git_libgit2_shutdown@Base 1.7.0
git_libgit2_version@Base 1.7.0
git_mailmap_add_entry@Base 1.7.0
git_mailmap_free@Base 1.7.0
git_mailmap_from_buffer@Base 1.7.0
git_mailmap_from_repository@Base 1.7.0
git_mailmap_new@Base 1.7.0
git_mailmap_resolve@Base 1.7.0
git_mailmap_resolve_signature@Base 1.7.0
git_mempack_dump@Base 1.7.0
git_mempack_new@Base 1.7.0
git_mempack_reset@Base 1.7.0
git_merge@Base 1.7.0
git_merge_analysis@Base 1.7.0
git_merge_analysis_for_ref@Base 1.7.0
git_merge_base@Base 1.7.0
git_merge_base_many@Base 1.7.0
git_merge_base_octopus@Base 1.7.0
git_merge_bases@Base 1.7.0
git_merge_bases_many@Base 1.7.0
git_merge_commits@Base 1.7.0
git_merge_driver_lookup@Base 1.7.0
git_merge_driver_register@Base 1.7.0
git_merge_driver_source_ancestor@Base 1.7.0
git_merge_driver_source_file_options@Base 1.7.0
git_merge_driver_source_ours@Base 1.7.0
git_merge_driver_source_repo@Base 1.7.0
git_merge_driver_source_theirs@Base 1.7.0
git_merge_driver_unregister@Base 1.7.0
git_merge_file@Base 1.7.0
git_merge_file_from_index@Base 1.7.0
git_merge_file_init_input@Base 1.7.0
git_merge_file_init_options@Base 1.7.0
git_merge_file_input_init@Base 1.7.0
git_merge_file_options_init@Base 1.7.0
git_merge_file_result_free@Base 1.7.0
git_merge_init_options@Base 1.7.0
git_merge_options_init@Base 1.7.0
git_merge_trees@Base 1.7.0
git_message_prettify@Base 1.7.0
git_message_trailer_array_free@Base 1.7.0
git_message_trailers@Base 1.7.0
git_midx_writer_add@Base 1.7.0
git_midx_writer_commit@Base 1.7.0
git_midx_writer_dump@Base 1.7.0
git_midx_writer_free@Base 1.7.0
git_midx_writer_new@Base 1.7.0
git_note_author@Base 1.7.0
git_note_commit_create@Base 1.7.0
git_note_commit_iterator_new@Base 1.7.0
git_note_commit_read@Base 1.7.0
git_note_commit_remove@Base 1.7.0
git_note_committer@Base 1.7.0
git_note_create@Base 1.7.0
git_note_default_ref@Base 1.7.0
git_note_foreach@Base 1.7.0
git_note_free@Base 1.7.0
git_note_id@Base 1.7.0
git_note_iterator_free@Base 1.7.0
git_note_iterator_new@Base 1.7.0
git_note_message@Base 1.7.0
git_note_next@Base 1.7.0
git_note_read@Base 1.7.0
git_note_remove@Base 1.7.0
git_object__size@Base 1.7.0
git_object_dup@Base 1.7.0
git_object_free@Base 1.7.0
git_object_id@Base 1.7.0
git_object_lookup@Base 1.7.0
git_object_lookup_bypath@Base 1.7.0
git_object_lookup_prefix@Base 1.7.0
git_object_owner@Base 1.7.0
git_object_peel@Base 1.7.0
git_object_rawcontent_is_valid@Base 1.7.0
git_object_short_id@Base 1.7.0
git_object_string2type@Base 1.7.0
git_object_type2string@Base 1.7.0
git_object_type@Base 1.7.0
git_object_typeisloose@Base 1.7.0
git_odb__backend_loose@Base 1.7.0
git_odb_add_alternate@Base 1.7.0
git_odb_add_backend@Base 1.7.0
git_odb_add_disk_alternate@Base 1.7.0
git_odb_backend_data_alloc@Base 1.7.0
git_odb_backend_data_free@Base 1.7.0
git_odb_backend_loose@Base 1.7.0
git_odb_backend_malloc@Base 1.7.0
git_odb_backend_one_pack@Base 1.7.0
git_odb_backend_pack@Base 1.7.0
git_odb_exists@Base 1.7.0
git_odb_exists_ext@Base 1.7.0
git_odb_exists_prefix@Base 1.7.0
git_odb_expand_ids@Base 1.7.0
git_odb_foreach@Base 1.7.0
git_odb_free@Base 1.7.0
git_odb_get_backend@Base 1.7.0
git_odb_hash@Base 1.7.0
git_odb_hashfile@Base 1.7.0
git_odb_init_backend@Base 1.7.0
git_odb_new@Base 1.7.0
git_odb_num_backends@Base 1.7.0
git_odb_object_data@Base 1.7.0
git_odb_object_dup@Base 1.7.0
git_odb_object_free@Base 1.7.0
git_odb_object_id@Base 1.7.0
git_odb_object_size@Base 1.7.0
git_odb_object_type@Base 1.7.0
git_odb_open@Base 1.7.0
git_odb_open_rstream@Base 1.7.0
git_odb_open_wstream@Base 1.7.0
git_odb_read@Base 1.7.0
git_odb_read_header@Base 1.7.0
git_odb_read_prefix@Base 1.7.0
git_odb_refresh@Base 1.7.0
git_odb_set_commit_graph@Base 1.7.0
git_odb_stream_finalize_write@Base 1.7.0
git_odb_stream_free@Base 1.7.0
git_odb_stream_read@Base 1.7.0
git_odb_stream_write@Base 1.7.0
git_odb_write@Base 1.7.0
git_odb_write_multi_pack_index@Base 1.7.0
git_odb_write_pack@Base 1.7.0
git_oid_cmp@Base 1.7.0
git_oid_cpy@Base 1.7.0
git_oid_equal@Base 1.7.0
git_oid_fmt@Base 1.7.0
git_oid_fromraw@Base 1.7.0
git_oid_fromstr@Base 1.7.0
git_oid_fromstrn@Base 1.7.0
git_oid_fromstrp@Base 1.7.0
git_oid_is_zero@Base 1.7.0
git_oid_iszero@Base 1.7.0
git_oid_ncmp@Base 1.7.0
git_oid_nfmt@Base 1.7.0
git_oid_pathfmt@Base 1.7.0
git_oid_shorten_add@Base 1.7.0
git_oid_shorten_free@Base 1.7.0
git_oid_shorten_new@Base 1.7.0
git_oid_strcmp@Base 1.7.0
git_oid_streq@Base 1.7.0
git_oid_tostr@Base 1.7.0
git_oid_tostr_s@Base 1.7.0
git_oidarray_dispose@Base 1.7.0
git_oidarray_free@Base 1.7.0
git_openssl_set_locking@Base 1.7.0
git_packbuilder_foreach@Base 1.7.0
git_packbuilder_free@Base 1.7.0
git_packbuilder_hash@Base 1.7.0
git_packbuilder_insert@Base 1.7.0
git_packbuilder_insert_commit@Base 1.7.0
git_packbuilder_insert_recur@Base 1.7.0
git_packbuilder_insert_tree@Base 1.7.0
git_packbuilder_insert_walk@Base 1.7.0
git_packbuilder_name@Base 1.7.0
git_packbuilder_new@Base 1.7.0
git_packbuilder_object_count@Base 1.7.0
git_packbuilder_set_callbacks@Base 1.7.0
git_packbuilder_set_threads@Base 1.7.0
git_packbuilder_write@Base 1.7.0
git_packbuilder_write_buf@Base 1.7.0
git_packbuilder_written@Base 1.7.0
git_patch_free@Base 1.7.0
git_patch_from_blob_and_buffer@Base 1.7.0
git_patch_from_blobs@Base 1.7.0
git_patch_from_buffers@Base 1.7.0
git_patch_from_diff@Base 1.7.0
git_patch_get_delta@Base 1.7.0
git_patch_get_hunk@Base 1.7.0
git_patch_get_line_in_hunk@Base 1.7.0
git_patch_line_stats@Base 1.7.0
git_patch_num_hunks@Base 1.7.0
git_patch_num_lines_in_hunk@Base 1.7.0
git_patch_owner@Base 1.7.0
git_patch_print@Base 1.7.0
git_patch_size@Base 1.7.0
git_patch_to_buf@Base 1.7.0
git_path_is_gitfile@Base 1.7.0
git_pathspec_free@Base 1.7.0
git_pathspec_match_diff@Base 1.7.0
git_pathspec_match_index@Base 1.7.0
git_pathspec_match_list_diff_entry@Base 1.7.0
git_pathspec_match_list_entry@Base 1.7.0
git_pathspec_match_list_entrycount@Base 1.7.0
git_pathspec_match_list_failed_entry@Base 1.7.0
git_pathspec_match_list_failed_entrycount@Base 1.7.0
git_pathspec_match_list_free@Base 1.7.0
git_pathspec_match_tree@Base 1.7.0
git_pathspec_match_workdir@Base 1.7.0
git_pathspec_matches_path@Base 1.7.0
git_pathspec_new@Base 1.7.0
git_proxy_init_options@Base 1.7.0
git_proxy_options_init@Base 1.7.0
git_push_init_options@Base 1.7.0
git_push_options_init@Base 1.7.0
git_rebase_abort@Base 1.7.0
git_rebase_commit@Base 1.7.0
git_rebase_finish@Base 1.7.0
git_rebase_free@Base 1.7.0
git_rebase_init@Base 1.7.0
git_rebase_init_options@Base 1.7.0
git_rebase_inmemory_index@Base 1.7.0
git_rebase_next@Base 1.7.0
git_rebase_onto_id@Base 1.7.0
git_rebase_onto_name@Base 1.7.0
git_rebase_open@Base 1.7.0
git_rebase_operation_byindex@Base 1.7.0
git_rebase_operation_current@Base 1.7.0
git_rebase_operation_entrycount@Base 1.7.0
git_rebase_options_init@Base 1.7.0
git_rebase_orig_head_id@Base 1.7.0
git_rebase_orig_head_name@Base 1.7.0
git_refdb_backend_fs@Base 1.7.0
git_refdb_compress@Base 1.7.0
git_refdb_free@Base 1.7.0
git_refdb_init_backend@Base 1.7.0
git_refdb_new@Base 1.7.0
git_refdb_open@Base 1.7.0
git_refdb_set_backend@Base 1.7.0
git_reference__alloc@Base 1.7.0
git_reference__alloc_symbolic@Base 1.7.0
git_reference_cmp@Base 1.7.0
git_reference_create@Base 1.7.0
git_reference_create_matching@Base 1.7.0
git_reference_delete@Base 1.7.0
git_reference_dup@Base 1.7.0
git_reference_dwim@Base 1.7.0
git_reference_ensure_log@Base 1.7.0
git_reference_foreach@Base 1.7.0
git_reference_foreach_glob@Base 1.7.0
git_reference_foreach_name@Base 1.7.0
git_reference_free@Base 1.7.0
git_reference_has_log@Base 1.7.0
git_reference_is_branch@Base 1.7.0
git_reference_is_note@Base 1.7.0
git_reference_is_remote@Base 1.7.0
git_reference_is_tag@Base 1.7.0
git_reference_is_valid_name@Base 1.7.0
git_reference_iterator_free@Base 1.7.0
git_reference_iterator_glob_new@Base 1.7.0
git_reference_iterator_new@Base 1.7.0
git_reference_list@Base 1.7.0
git_reference_lookup@Base 1.7.0
git_reference_name@Base 1.7.0
git_reference_name_is_valid@Base 1.7.0
git_reference_name_to_id@Base 1.7.0
git_reference_next@Base 1.7.0
git_reference_next_name@Base 1.7.0
git_reference_normalize_name@Base 1.7.0
git_reference_owner@Base 1.7.0
git_reference_peel@Base 1.7.0
git_reference_remove@Base 1.7.0
git_reference_rename@Base 1.7.0
git_reference_resolve@Base 1.7.0
git_reference_set_target@Base 1.7.0
git_reference_shorthand@Base 1.7.0
git_reference_symbolic_create@Base 1.7.0
git_reference_symbolic_create_matching@Base 1.7.0
git_reference_symbolic_set_target@Base 1.7.0
git_reference_symbolic_target@Base 1.7.0
git_reference_target@Base 1.7.0
git_reference_target_peel@Base 1.7.0
git_reference_type@Base 1.7.0
git_reflog_append@Base 1.7.0
git_reflog_delete@Base 1.7.0
git_reflog_drop@Base 1.7.0
git_reflog_entry__free@Base 1.7.0
git_reflog_entry_byindex@Base 1.7.0
git_reflog_entry_committer@Base 1.7.0
git_reflog_entry_id_new@Base 1.7.0
git_reflog_entry_id_old@Base 1.7.0
git_reflog_entry_message@Base 1.7.0
git_reflog_entrycount@Base 1.7.0
git_reflog_free@Base 1.7.0
git_reflog_read@Base 1.7.0
git_reflog_rename@Base 1.7.0
git_reflog_write@Base 1.7.0
git_refspec_direction@Base 1.7.0
git_refspec_dst@Base 1.7.0
git_refspec_dst_matches@Base 1.7.0
git_refspec_force@Base 1.7.0
git_refspec_free@Base 1.7.0
git_refspec_parse@Base 1.7.0
git_refspec_rtransform@Base 1.7.0
git_refspec_src@Base 1.7.0
git_refspec_src_matches@Base 1.7.0
git_refspec_string@Base 1.7.0
git_refspec_transform@Base 1.7.0
git_remote_add_fetch@Base 1.7.0
git_remote_add_push@Base 1.7.0
git_remote_autotag@Base 1.7.0
git_remote_connect@Base 1.7.0
git_remote_connect_ext@Base 1.7.0
git_remote_connect_options_dispose@Base 1.7.0
git_remote_connect_options_init@Base 1.7.0
git_remote_connected@Base 1.7.0
git_remote_create@Base 1.7.0
git_remote_create_anonymous@Base 1.7.0
git_remote_create_detached@Base 1.7.0
git_remote_create_init_options@Base 1.7.0
git_remote_create_options_init@Base 1.7.0
git_remote_create_with_fetchspec@Base 1.7.0
git_remote_create_with_opts@Base 1.7.0
git_remote_default_branch@Base 1.7.0
git_remote_delete@Base 1.7.0
git_remote_disconnect@Base 1.7.0
git_remote_download@Base 1.7.0
git_remote_dup@Base 1.7.0
git_remote_fetch@Base 1.7.0
git_remote_free@Base 1.7.0
git_remote_get_fetch_refspecs@Base 1.7.0
git_remote_get_push_refspecs@Base 1.7.0
git_remote_get_refspec@Base 1.7.0
git_remote_init_callbacks@Base 1.7.0
git_remote_is_valid_name@Base 1.7.0
git_remote_list@Base 1.7.0
git_remote_lookup@Base 1.7.0
git_remote_ls@Base 1.7.0
git_remote_name@Base 1.7.0
git_remote_name_is_valid@Base 1.7.0
git_remote_owner@Base 1.7.0
git_remote_prune@Base 1.7.0
git_remote_prune_refs@Base 1.7.0
git_remote_push@Base 1.7.0
git_remote_pushurl@Base 1.7.0
git_remote_refspec_count@Base 1.7.0
git_remote_rename@Base 1.7.0
git_remote_set_autotag@Base 1.7.0
git_remote_set_instance_pushurl@Base 1.7.0
git_remote_set_instance_url@Base 1.7.0
git_remote_set_pushurl@Base 1.7.0
git_remote_set_url@Base 1.7.0
git_remote_stats@Base 1.7.0
git_remote_stop@Base 1.7.0
git_remote_update_tips@Base 1.7.0
git_remote_upload@Base 1.7.0
git_remote_url@Base 1.7.0
git_repository__cleanup@Base 1.7.0
git_repository_commondir@Base 1.7.0
git_repository_config@Base 1.7.0
git_repository_config_snapshot@Base 1.7.0
git_repository_detach_head@Base 1.7.0
git_repository_discover@Base 1.7.0
git_repository_fetchhead_foreach@Base 1.7.0
git_repository_free@Base 1.7.0
git_repository_get_namespace@Base 1.7.0
git_repository_hashfile@Base 1.7.0
git_repository_head@Base 1.7.0
git_repository_head_detached@Base 1.7.0
git_repository_head_detached_for_worktree@Base 1.7.0
git_repository_head_for_worktree@Base 1.7.0
git_repository_head_unborn@Base 1.7.0
git_repository_ident@Base 1.7.0
git_repository_index@Base 1.7.0
git_repository_init@Base 1.7.0
git_repository_init_ext@Base 1.7.0
git_repository_init_init_options@Base 1.7.0
git_repository_init_options_init@Base 1.7.0
git_repository_is_bare@Base 1.7.0
git_repository_is_empty@Base 1.7.0
git_repository_is_shallow@Base 1.7.0
git_repository_is_worktree@Base 1.7.0
git_repository_item_path@Base 1.7.0
git_repository_mergehead_foreach@Base 1.7.0
git_repository_message@Base 1.7.0
git_repository_message_remove@Base 1.7.0
git_repository_new@Base 1.7.0
git_repository_odb@Base 1.7.0
git_repository_oid_type@Base 1.7.0
git_repository_open@Base 1.7.0
git_repository_open_bare@Base 1.7.0
git_repository_open_ext@Base 1.7.0
git_repository_open_from_worktree@Base 1.7.0
git_repository_path@Base 1.7.0
git_repository_refdb@Base 1.7.0
git_repository_reinit_filesystem@Base 1.7.0
git_repository_set_bare@Base 1.7.0
git_repository_set_config@Base 1.7.0
git_repository_set_head@Base 1.7.0
git_repository_set_head_detached@Base 1.7.0
git_repository_set_head_detached_from_annotated@Base 1.7.0
git_repository_set_ident@Base 1.7.0
git_repository_set_index@Base 1.7.0
git_repository_set_namespace@Base 1.7.0
git_repository_set_odb@Base 1.7.0
git_repository_set_refdb@Base 1.7.0
git_repository_set_workdir@Base 1.7.0
git_repository_state@Base 1.7.0
git_repository_state_cleanup@Base 1.7.0
git_repository_submodule_cache_all@Base 1.7.0
git_repository_submodule_cache_clear@Base 1.7.0
git_repository_workdir@Base 1.7.0
git_repository_wrap_odb@Base 1.7.0
git_reset@Base 1.7.0
git_reset_default@Base 1.7.0
git_reset_from_annotated@Base 1.7.0
git_revert@Base 1.7.0
git_revert_commit@Base 1.7.0
git_revert_init_options@Base 1.7.0
git_revert_options_init@Base 1.7.0
git_revparse@Base 1.7.0
git_revparse_ext@Base 1.7.0
git_revparse_single@Base 1.7.0
git_revwalk_add_hide_cb@Base 1.7.0
git_revwalk_free@Base 1.7.0
git_revwalk_hide@Base 1.7.0
git_revwalk_hide_glob@Base 1.7.0
git_revwalk_hide_head@Base 1.7.0
git_revwalk_hide_ref@Base 1.7.0
git_revwalk_new@Base 1.7.0
git_revwalk_next@Base 1.7.0
git_revwalk_push@Base 1.7.0
git_revwalk_push_glob@Base 1.7.0
git_revwalk_push_head@Base 1.7.0
git_revwalk_push_range@Base 1.7.0
git_revwalk_push_ref@Base 1.7.0
git_revwalk_repository@Base 1.7.0
git_revwalk_reset@Base 1.7.0
git_revwalk_simplify_first_parent@Base 1.7.0
git_revwalk_sorting@Base 1.7.0
git_signature_default@Base 1.7.0
git_signature_dup@Base 1.7.0
git_signature_free@Base 1.7.0
git_signature_from_buffer@Base 1.7.0
git_signature_new@Base 1.7.0
git_signature_now@Base 1.7.0
git_smart_subtransport_git@Base 1.7.0
git_smart_subtransport_http@Base 1.7.0
git_smart_subtransport_ssh@Base 1.7.0
git_stash_apply@Base 1.7.0
git_stash_apply_init_options@Base 1.7.0
git_stash_apply_options_init@Base 1.7.0
git_stash_drop@Base 1.7.0
git_stash_foreach@Base 1.7.0
git_stash_pop@Base 1.7.0
git_stash_save@Base 1.7.0
git_stash_save_options_init@Base 1.7.0
git_stash_save_with_opts@Base 1.7.0
git_status_byindex@Base 1.7.0
git_status_file@Base 1.7.0
git_status_foreach@Base 1.7.0
git_status_foreach_ext@Base 1.7.0
git_status_init_options@Base 1.7.0
git_status_list_entrycount@Base 1.7.0
git_status_list_free@Base 1.7.0
git_status_list_get_perfdata@Base 1.7.0
git_status_list_new@Base 1.7.0
git_status_options_init@Base 1.7.0
git_status_should_ignore@Base 1.7.0
git_strarray_copy@Base 1.7.0
git_strarray_dispose@Base 1.7.0
git_strarray_free@Base 1.7.0
git_stream_register@Base 1.7.0
git_stream_register_tls@Base 1.7.0
git_submodule_add_finalize@Base 1.7.0
git_submodule_add_setup@Base 1.7.0
git_submodule_add_to_index@Base 1.7.0
git_submodule_branch@Base 1.7.0
git_submodule_clone@Base 1.7.0
git_submodule_dup@Base 1.7.0
git_submodule_fetch_recurse_submodules@Base 1.7.0
git_submodule_foreach@Base 1.7.0
git_submodule_free@Base 1.7.0
git_submodule_head_id@Base 1.7.0
git_submodule_ignore@Base 1.7.0
git_submodule_index_id@Base 1.7.0
git_submodule_init@Base 1.7.0
git_submodule_location@Base 1.7.0
git_submodule_lookup@Base 1.7.0
git_submodule_name@Base 1.7.0
git_submodule_open@Base 1.7.0
git_submodule_owner@Base 1.7.0
git_submodule_path@Base 1.7.0
git_submodule_reload@Base 1.7.0
git_submodule_repo_init@Base 1.7.0
git_submodule_resolve_url@Base 1.7.0
git_submodule_set_branch@Base 1.7.0
git_submodule_set_fetch_recurse_submodules@Base 1.7.0
git_submodule_set_ignore@Base 1.7.0
git_submodule_set_update@Base 1.7.0
git_submodule_set_url@Base 1.7.0
git_submodule_status@Base 1.7.0
git_submodule_sync@Base 1.7.0
git_submodule_update@Base 1.7.0
git_submodule_update_init_options@Base 1.7.0
git_submodule_update_options_init@Base 1.7.0
git_submodule_update_strategy@Base 1.7.0
git_submodule_url@Base 1.7.0
git_submodule_wd_id@Base 1.7.0
git_tag_annotation_create@Base 1.7.0
git_tag_create@Base 1.7.0
git_tag_create_from_buffer@Base 1.7.0
git_tag_create_frombuffer@Base 1.7.0
git_tag_create_lightweight@Base 1.7.0
git_tag_delete@Base 1.7.0
git_tag_dup@Base 1.7.0
git_tag_foreach@Base 1.7.0
git_tag_free@Base 1.7.0
git_tag_id@Base 1.7.0
git_tag_list@Base 1.7.0
git_tag_list_match@Base 1.7.0
git_tag_lookup@Base 1.7.0
git_tag_lookup_prefix@Base 1.7.0
git_tag_message@Base 1.7.0
git_tag_name@Base 1.7.0
git_tag_name_is_valid@Base 1.7.0
git_tag_owner@Base 1.7.0
git_tag_peel@Base 1.7.0
git_tag_tagger@Base 1.7.0
git_tag_target@Base 1.7.0
git_tag_target_id@Base 1.7.0
git_tag_target_type@Base 1.7.0
git_trace_set@Base 1.7.0
git_transaction_commit@Base 1.7.0
git_transaction_free@Base 1.7.0
git_transaction_lock_ref@Base 1.7.0
git_transaction_new@Base 1.7.0
git_transaction_remove@Base 1.7.0
git_transaction_set_reflog@Base 1.7.0
git_transaction_set_symbolic_target@Base 1.7.0
git_transaction_set_target@Base 1.7.0
git_transport_init@Base 1.7.0
git_transport_local@Base 1.7.0
git_transport_new@Base 1.7.0
git_transport_register@Base 1.7.0
git_transport_remote_connect_options@Base 1.7.0
git_transport_smart@Base 1.7.0
git_transport_smart_certificate_check@Base 1.7.0
git_transport_smart_credentials@Base 1.7.0
git_transport_ssh_with_paths@Base 1.7.0
git_transport_unregister@Base 1.7.0
git_tree_create_updated@Base 1.7.0
git_tree_dup@Base 1.7.0
git_tree_entry_byid@Base 1.7.0
git_tree_entry_byindex@Base 1.7.0
git_tree_entry_byname@Base 1.7.0
git_tree_entry_bypath@Base 1.7.0
git_tree_entry_cmp@Base 1.7.0
git_tree_entry_dup@Base 1.7.0
git_tree_entry_filemode@Base 1.7.0
git_tree_entry_filemode_raw@Base 1.7.0
git_tree_entry_free@Base 1.7.0
git_tree_entry_id@Base 1.7.0
git_tree_entry_name@Base 1.7.0
git_tree_entry_to_object@Base 1.7.0
git_tree_entry_type@Base 1.7.0
git_tree_entrycount@Base 1.7.0
git_tree_free@Base 1.7.0
git_tree_id@Base 1.7.0
git_tree_lookup@Base 1.7.0
git_tree_lookup_prefix@Base 1.7.0
git_tree_owner@Base 1.7.0
git_tree_walk@Base 1.7.0
git_treebuilder_clear@Base 1.7.0
git_treebuilder_entrycount@Base 1.7.0
git_treebuilder_filter@Base 1.7.0
git_treebuilder_free@Base 1.7.0
git_treebuilder_get@Base 1.7.0
git_treebuilder_insert@Base 1.7.0
git_treebuilder_new@Base 1.7.0
git_treebuilder_remove@Base 1.7.0
git_treebuilder_write@Base 1.7.0
git_treebuilder_write_with_buffer@Base 1.7.0
git_worktree_add@Base 1.7.0
git_worktree_add_init_options@Base 1.7.0
git_worktree_add_options_init@Base 1.7.0
git_worktree_free@Base 1.7.0
git_worktree_is_locked@Base 1.7.0
git_worktree_is_prunable@Base 1.7.0
git_worktree_list@Base 1.7.0
git_worktree_lock@Base 1.7.0
git_worktree_lookup@Base 1.7.0
git_worktree_name@Base 1.7.0
git_worktree_open_from_repository@Base 1.7.0
git_worktree_path@Base 1.7.0
git_worktree_prune@Base 1.7.0
git_worktree_prune_init_options@Base 1.7.0
git_worktree_prune_options_init@Base 1.7.0
git_worktree_unlock@Base 1.7.0
git_worktree_validate@Base 1.7.0
giterr_clear@Base 1.7.0
giterr_last@Base 1.7.0
giterr_set_oom@Base 1.7.0
giterr_set_str@Base 1.7.0

946
debian/libgit2-1.8.symbols vendored Normal file
View File

@ -0,0 +1,946 @@
libgit2.so.1.8 libgit2-1.8 #MINVER#
* Build-Depends-Package: libgit2-dev
git_annotated_commit_free@Base 1.8.0
git_annotated_commit_from_fetchhead@Base 1.8.0
git_annotated_commit_from_ref@Base 1.8.0
git_annotated_commit_from_revspec@Base 1.8.0
git_annotated_commit_id@Base 1.8.0
git_annotated_commit_lookup@Base 1.8.0
git_annotated_commit_ref@Base 1.8.0
git_apply@Base 1.8.0
git_apply_options_init@Base 1.8.0
git_apply_to_tree@Base 1.8.0
git_attr_add_macro@Base 1.8.0
git_attr_cache_flush@Base 1.8.0
git_attr_foreach@Base 1.8.0
git_attr_foreach_ext@Base 1.8.0
git_attr_get@Base 1.8.0
git_attr_get_ext@Base 1.8.0
git_attr_get_many@Base 1.8.0
git_attr_get_many_ext@Base 1.8.0
git_attr_value@Base 1.8.0
git_blame_buffer@Base 1.8.0
git_blame_file@Base 1.8.0
git_blame_free@Base 1.8.0
git_blame_get_hunk_byindex@Base 1.8.0
git_blame_get_hunk_byline@Base 1.8.0
git_blame_get_hunk_count@Base 1.8.0
git_blame_init_options@Base 1.8.0
git_blame_options_init@Base 1.8.0
git_blob_create_from_buffer@Base 1.8.0
git_blob_create_from_disk@Base 1.8.0
git_blob_create_from_stream@Base 1.8.0
git_blob_create_from_stream_commit@Base 1.8.0
git_blob_create_from_workdir@Base 1.8.0
git_blob_create_frombuffer@Base 1.8.0
git_blob_create_fromdisk@Base 1.8.0
git_blob_create_fromstream@Base 1.8.0
git_blob_create_fromstream_commit@Base 1.8.0
git_blob_create_fromworkdir@Base 1.8.0
git_blob_data_is_binary@Base 1.8.0
git_blob_dup@Base 1.8.0
git_blob_filter@Base 1.8.0
git_blob_filter_options_init@Base 1.8.0
git_blob_filtered_content@Base 1.8.0
git_blob_free@Base 1.8.0
git_blob_id@Base 1.8.0
git_blob_is_binary@Base 1.8.0
git_blob_lookup@Base 1.8.0
git_blob_lookup_prefix@Base 1.8.0
git_blob_owner@Base 1.8.0
git_blob_rawcontent@Base 1.8.0
git_blob_rawsize@Base 1.8.0
git_branch_create@Base 1.8.0
git_branch_create_from_annotated@Base 1.8.0
git_branch_delete@Base 1.8.0
git_branch_is_checked_out@Base 1.8.0
git_branch_is_head@Base 1.8.0
git_branch_iterator_free@Base 1.8.0
git_branch_iterator_new@Base 1.8.0
git_branch_lookup@Base 1.8.0
git_branch_move@Base 1.8.0
git_branch_name@Base 1.8.0
git_branch_name_is_valid@Base 1.8.0
git_branch_next@Base 1.8.0
git_branch_remote_name@Base 1.8.0
git_branch_set_upstream@Base 1.8.0
git_branch_upstream@Base 1.8.0
git_branch_upstream_merge@Base 1.8.0
git_branch_upstream_name@Base 1.8.0
git_branch_upstream_remote@Base 1.8.0
git_buf_contains_nul@Base 1.8.0
git_buf_dispose@Base 1.8.0
git_buf_free@Base 1.8.0
git_buf_grow@Base 1.8.0
git_buf_is_binary@Base 1.8.0
git_buf_set@Base 1.8.0
git_checkout_head@Base 1.8.0
git_checkout_index@Base 1.8.0
git_checkout_init_options@Base 1.8.0
git_checkout_options_init@Base 1.8.0
git_checkout_tree@Base 1.8.0
git_cherrypick@Base 1.8.0
git_cherrypick_commit@Base 1.8.0
git_cherrypick_init_options@Base 1.8.0
git_cherrypick_options_init@Base 1.8.0
git_clone@Base 1.8.0
git_clone_init_options@Base 1.8.0
git_clone_options_init@Base 1.8.0
git_commit_amend@Base 1.8.0
git_commit_author@Base 1.8.0
git_commit_author_with_mailmap@Base 1.8.0
git_commit_body@Base 1.8.0
git_commit_committer@Base 1.8.0
git_commit_committer_with_mailmap@Base 1.8.0
git_commit_create@Base 1.8.0
git_commit_create_buffer@Base 1.8.0
git_commit_create_from_callback@Base 1.8.0
git_commit_create_from_ids@Base 1.8.0
git_commit_create_from_stage@Base 1.8.0
git_commit_create_v@Base 1.8.0
git_commit_create_with_signature@Base 1.8.0
git_commit_dup@Base 1.8.0
git_commit_extract_signature@Base 1.8.0
git_commit_free@Base 1.8.0
git_commit_graph_free@Base 1.8.0
git_commit_graph_open@Base 1.8.0
git_commit_graph_writer_add_index_file@Base 1.8.0
git_commit_graph_writer_add_revwalk@Base 1.8.0
git_commit_graph_writer_commit@Base 1.8.0
git_commit_graph_writer_dump@Base 1.8.0
git_commit_graph_writer_free@Base 1.8.0
git_commit_graph_writer_new@Base 1.8.0
git_commit_graph_writer_options_init@Base 1.8.0
git_commit_header_field@Base 1.8.0
git_commit_id@Base 1.8.0
git_commit_lookup@Base 1.8.0
git_commit_lookup_prefix@Base 1.8.0
git_commit_message@Base 1.8.0
git_commit_message_encoding@Base 1.8.0
git_commit_message_raw@Base 1.8.0
git_commit_nth_gen_ancestor@Base 1.8.0
git_commit_owner@Base 1.8.0
git_commit_parent@Base 1.8.0
git_commit_parent_id@Base 1.8.0
git_commit_parentcount@Base 1.8.0
git_commit_raw_header@Base 1.8.0
git_commit_summary@Base 1.8.0
git_commit_time@Base 1.8.0
git_commit_time_offset@Base 1.8.0
git_commit_tree@Base 1.8.0
git_commit_tree_id@Base 1.8.0
git_commitarray_dispose@Base 1.8.0
git_config_add_backend@Base 1.8.0
git_config_add_file_ondisk@Base 1.8.0
git_config_backend_foreach_match@Base 1.8.0
git_config_delete_entry@Base 1.8.0
git_config_delete_multivar@Base 1.8.0
git_config_entry_free@Base 1.8.0
git_config_find_global@Base 1.8.0
git_config_find_programdata@Base 1.8.0
git_config_find_system@Base 1.8.0
git_config_find_xdg@Base 1.8.0
git_config_foreach@Base 1.8.0
git_config_foreach_match@Base 1.8.0
git_config_free@Base 1.8.0
git_config_get_bool@Base 1.8.0
git_config_get_entry@Base 1.8.0
git_config_get_int32@Base 1.8.0
git_config_get_int64@Base 1.8.0
git_config_get_mapped@Base 1.8.0
git_config_get_multivar_foreach@Base 1.8.0
git_config_get_path@Base 1.8.0
git_config_get_string@Base 1.8.0
git_config_get_string_buf@Base 1.8.0
git_config_init_backend@Base 1.8.0
git_config_iterator_free@Base 1.8.0
git_config_iterator_glob_new@Base 1.8.0
git_config_iterator_new@Base 1.8.0
git_config_lock@Base 1.8.0
git_config_lookup_map_value@Base 1.8.0
git_config_multivar_iterator_new@Base 1.8.0
git_config_new@Base 1.8.0
git_config_next@Base 1.8.0
git_config_open_default@Base 1.8.0
git_config_open_global@Base 1.8.0
git_config_open_level@Base 1.8.0
git_config_open_ondisk@Base 1.8.0
git_config_parse_bool@Base 1.8.0
git_config_parse_int32@Base 1.8.0
git_config_parse_int64@Base 1.8.0
git_config_parse_path@Base 1.8.0
git_config_set_bool@Base 1.8.0
git_config_set_int32@Base 1.8.0
git_config_set_int64@Base 1.8.0
git_config_set_multivar@Base 1.8.0
git_config_set_string@Base 1.8.0
git_config_set_writeorder@Base 1.8.0
git_config_snapshot@Base 1.8.0
git_config_unlock@Base 1.8.0
git_cred_default_new@Base 1.8.0
git_cred_free@Base 1.8.0
git_cred_get_username@Base 1.8.0
git_cred_has_username@Base 1.8.0
git_cred_ssh_custom_new@Base 1.8.0
git_cred_ssh_interactive_new@Base 1.8.0
git_cred_ssh_key_from_agent@Base 1.8.0
git_cred_ssh_key_memory_new@Base 1.8.0
git_cred_ssh_key_new@Base 1.8.0
git_cred_username_new@Base 1.8.0
git_cred_userpass@Base 1.8.0
git_cred_userpass_plaintext_new@Base 1.8.0
git_credential_default_new@Base 1.8.0
git_credential_free@Base 1.8.0
git_credential_get_username@Base 1.8.0
git_credential_has_username@Base 1.8.0
git_credential_ssh_custom_new@Base 1.8.0
git_credential_ssh_interactive_new@Base 1.8.0
git_credential_ssh_key_from_agent@Base 1.8.0
git_credential_ssh_key_memory_new@Base 1.8.0
git_credential_ssh_key_new@Base 1.8.0
git_credential_username_new@Base 1.8.0
git_credential_userpass@Base 1.8.0
git_credential_userpass_plaintext_new@Base 1.8.0
git_describe_commit@Base 1.8.0
git_describe_format@Base 1.8.0
git_describe_format_options_init@Base 1.8.0
git_describe_init_format_options@Base 1.8.0
git_describe_init_options@Base 1.8.0
git_describe_options_init@Base 1.8.0
git_describe_result_free@Base 1.8.0
git_describe_workdir@Base 1.8.0
git_diff_blob_to_buffer@Base 1.8.0
git_diff_blobs@Base 1.8.0
git_diff_buffers@Base 1.8.0
git_diff_commit_as_email@Base 1.8.0
git_diff_find_init_options@Base 1.8.0
git_diff_find_options_init@Base 1.8.0
git_diff_find_similar@Base 1.8.0
git_diff_foreach@Base 1.8.0
git_diff_format_email@Base 1.8.0
git_diff_format_email_init_options@Base 1.8.0
git_diff_format_email_options_init@Base 1.8.0
git_diff_free@Base 1.8.0
git_diff_from_buffer@Base 1.8.0
git_diff_get_delta@Base 1.8.0
git_diff_get_perfdata@Base 1.8.0
git_diff_get_stats@Base 1.8.0
git_diff_index_to_index@Base 1.8.0
git_diff_index_to_workdir@Base 1.8.0
git_diff_init_options@Base 1.8.0
git_diff_is_sorted_icase@Base 1.8.0
git_diff_merge@Base 1.8.0
git_diff_num_deltas@Base 1.8.0
git_diff_num_deltas_of_type@Base 1.8.0
git_diff_options_init@Base 1.8.0
git_diff_patchid@Base 1.8.0
git_diff_patchid_options_init@Base 1.8.0
git_diff_print@Base 1.8.0
git_diff_print_callback__to_buf@Base 1.8.0
git_diff_print_callback__to_file_handle@Base 1.8.0
git_diff_stats_deletions@Base 1.8.0
git_diff_stats_files_changed@Base 1.8.0
git_diff_stats_free@Base 1.8.0
git_diff_stats_insertions@Base 1.8.0
git_diff_stats_to_buf@Base 1.8.0
git_diff_status_char@Base 1.8.0
git_diff_to_buf@Base 1.8.0
git_diff_tree_to_index@Base 1.8.0
git_diff_tree_to_tree@Base 1.8.0
git_diff_tree_to_workdir@Base 1.8.0
git_diff_tree_to_workdir_with_index@Base 1.8.0
git_email_create_from_commit@Base 1.8.0
git_email_create_from_diff@Base 1.8.0
git_error_clear@Base 1.8.0
git_error_last@Base 1.8.0
git_error_set@Base 1.8.0
git_error_set_oom@Base 1.8.0
git_error_set_str@Base 1.8.0
git_fetch_init_options@Base 1.8.0
git_fetch_options_init@Base 1.8.0
git_filter_init@Base 1.8.0
git_filter_list_apply_to_blob@Base 1.8.0
git_filter_list_apply_to_buffer@Base 1.8.0
git_filter_list_apply_to_data@Base 1.8.0
git_filter_list_apply_to_file@Base 1.8.0
git_filter_list_contains@Base 1.8.0
git_filter_list_free@Base 1.8.0
git_filter_list_length@Base 1.8.0
git_filter_list_load@Base 1.8.0
git_filter_list_load_ext@Base 1.8.0
git_filter_list_new@Base 1.8.0
git_filter_list_push@Base 1.8.0
git_filter_list_stream_blob@Base 1.8.0
git_filter_list_stream_buffer@Base 1.8.0
git_filter_list_stream_data@Base 1.8.0
git_filter_list_stream_file@Base 1.8.0
git_filter_lookup@Base 1.8.0
git_filter_register@Base 1.8.0
git_filter_source_filemode@Base 1.8.0
git_filter_source_flags@Base 1.8.0
git_filter_source_id@Base 1.8.0
git_filter_source_mode@Base 1.8.0
git_filter_source_path@Base 1.8.0
git_filter_source_repo@Base 1.8.0
git_filter_unregister@Base 1.8.0
git_graph_ahead_behind@Base 1.8.0
git_graph_descendant_of@Base 1.8.0
git_graph_reachable_from_any@Base 1.8.0
git_hashsig_compare@Base 1.8.0
git_hashsig_create@Base 1.8.0
git_hashsig_create_fromfile@Base 1.8.0
git_hashsig_free@Base 1.8.0
git_ignore_add_rule@Base 1.8.0
git_ignore_clear_internal_rules@Base 1.8.0
git_ignore_path_is_ignored@Base 1.8.0
git_index_add@Base 1.8.0
git_index_add_all@Base 1.8.0
git_index_add_bypath@Base 1.8.0
git_index_add_from_buffer@Base 1.8.0
git_index_add_frombuffer@Base 1.8.0
git_index_caps@Base 1.8.0
git_index_checksum@Base 1.8.0
git_index_clear@Base 1.8.0
git_index_conflict_add@Base 1.8.0
git_index_conflict_cleanup@Base 1.8.0
git_index_conflict_get@Base 1.8.0
git_index_conflict_iterator_free@Base 1.8.0
git_index_conflict_iterator_new@Base 1.8.0
git_index_conflict_next@Base 1.8.0
git_index_conflict_remove@Base 1.8.0
git_index_entry_is_conflict@Base 1.8.0
git_index_entry_stage@Base 1.8.0
git_index_entrycount@Base 1.8.0
git_index_find@Base 1.8.0
git_index_find_prefix@Base 1.8.0
git_index_free@Base 1.8.0
git_index_get_byindex@Base 1.8.0
git_index_get_bypath@Base 1.8.0
git_index_has_conflicts@Base 1.8.0
git_index_iterator_free@Base 1.8.0
git_index_iterator_new@Base 1.8.0
git_index_iterator_next@Base 1.8.0
git_index_name_add@Base 1.8.0
git_index_name_clear@Base 1.8.0
git_index_name_entrycount@Base 1.8.0
git_index_name_get_byindex@Base 1.8.0
git_index_new@Base 1.8.0
git_index_open@Base 1.8.0
git_index_owner@Base 1.8.0
git_index_path@Base 1.8.0
git_index_read@Base 1.8.0
git_index_read_tree@Base 1.8.0
git_index_remove@Base 1.8.0
git_index_remove_all@Base 1.8.0
git_index_remove_bypath@Base 1.8.0
git_index_remove_directory@Base 1.8.0
git_index_reuc_add@Base 1.8.0
git_index_reuc_clear@Base 1.8.0
git_index_reuc_entrycount@Base 1.8.0
git_index_reuc_find@Base 1.8.0
git_index_reuc_get_byindex@Base 1.8.0
git_index_reuc_get_bypath@Base 1.8.0
git_index_reuc_remove@Base 1.8.0
git_index_set_caps@Base 1.8.0
git_index_set_version@Base 1.8.0
git_index_update_all@Base 1.8.0
git_index_version@Base 1.8.0
git_index_write@Base 1.8.0
git_index_write_tree@Base 1.8.0
git_index_write_tree_to@Base 1.8.0
git_indexer_append@Base 1.8.0
git_indexer_commit@Base 1.8.0
git_indexer_free@Base 1.8.0
git_indexer_hash@Base 1.8.0
git_indexer_init_options@Base 1.8.0
git_indexer_name@Base 1.8.0
git_indexer_new@Base 1.8.0
git_indexer_options_init@Base 1.8.0
git_libgit2_features@Base 1.8.0
git_libgit2_init@Base 1.8.0
git_libgit2_opts@Base 1.8.0
git_libgit2_prerelease@Base 1.8.0
git_libgit2_shutdown@Base 1.8.0
git_libgit2_version@Base 1.8.0
git_mailmap_add_entry@Base 1.8.0
git_mailmap_free@Base 1.8.0
git_mailmap_from_buffer@Base 1.8.0
git_mailmap_from_repository@Base 1.8.0
git_mailmap_new@Base 1.8.0
git_mailmap_resolve@Base 1.8.0
git_mailmap_resolve_signature@Base 1.8.0
git_mempack_dump@Base 1.8.0
git_mempack_new@Base 1.8.0
git_mempack_reset@Base 1.8.0
git_merge@Base 1.8.0
git_merge_analysis@Base 1.8.0
git_merge_analysis_for_ref@Base 1.8.0
git_merge_base@Base 1.8.0
git_merge_base_many@Base 1.8.0
git_merge_base_octopus@Base 1.8.0
git_merge_bases@Base 1.8.0
git_merge_bases_many@Base 1.8.0
git_merge_commits@Base 1.8.0
git_merge_driver_lookup@Base 1.8.0
git_merge_driver_register@Base 1.8.0
git_merge_driver_source_ancestor@Base 1.8.0
git_merge_driver_source_file_options@Base 1.8.0
git_merge_driver_source_ours@Base 1.8.0
git_merge_driver_source_repo@Base 1.8.0
git_merge_driver_source_theirs@Base 1.8.0
git_merge_driver_unregister@Base 1.8.0
git_merge_file@Base 1.8.0
git_merge_file_from_index@Base 1.8.0
git_merge_file_init_input@Base 1.8.0
git_merge_file_init_options@Base 1.8.0
git_merge_file_input_init@Base 1.8.0
git_merge_file_options_init@Base 1.8.0
git_merge_file_result_free@Base 1.8.0
git_merge_init_options@Base 1.8.0
git_merge_options_init@Base 1.8.0
git_merge_trees@Base 1.8.0
git_message_prettify@Base 1.8.0
git_message_trailer_array_free@Base 1.8.0
git_message_trailers@Base 1.8.0
git_midx_writer_add@Base 1.8.0
git_midx_writer_commit@Base 1.8.0
git_midx_writer_dump@Base 1.8.0
git_midx_writer_free@Base 1.8.0
git_midx_writer_new@Base 1.8.0
git_note_author@Base 1.8.0
git_note_commit_create@Base 1.8.0
git_note_commit_iterator_new@Base 1.8.0
git_note_commit_read@Base 1.8.0
git_note_commit_remove@Base 1.8.0
git_note_committer@Base 1.8.0
git_note_create@Base 1.8.0
git_note_default_ref@Base 1.8.0
git_note_foreach@Base 1.8.0
git_note_free@Base 1.8.0
git_note_id@Base 1.8.0
git_note_iterator_free@Base 1.8.0
git_note_iterator_new@Base 1.8.0
git_note_message@Base 1.8.0
git_note_next@Base 1.8.0
git_note_read@Base 1.8.0
git_note_remove@Base 1.8.0
git_object__size@Base 1.8.0
git_object_dup@Base 1.8.0
git_object_free@Base 1.8.0
git_object_id@Base 1.8.0
git_object_lookup@Base 1.8.0
git_object_lookup_bypath@Base 1.8.0
git_object_lookup_prefix@Base 1.8.0
git_object_owner@Base 1.8.0
git_object_peel@Base 1.8.0
git_object_rawcontent_is_valid@Base 1.8.0
git_object_short_id@Base 1.8.0
git_object_string2type@Base 1.8.0
git_object_type2string@Base 1.8.0
git_object_type@Base 1.8.0
git_object_typeisloose@Base 1.8.0
git_odb__backend_loose@Base 1.8.0
git_odb_add_alternate@Base 1.8.0
git_odb_add_backend@Base 1.8.0
git_odb_add_disk_alternate@Base 1.8.0
git_odb_backend_data_alloc@Base 1.8.0
git_odb_backend_data_free@Base 1.8.0
git_odb_backend_loose@Base 1.8.0
git_odb_backend_malloc@Base 1.8.0
git_odb_backend_one_pack@Base 1.8.0
git_odb_backend_pack@Base 1.8.0
git_odb_exists@Base 1.8.0
git_odb_exists_ext@Base 1.8.0
git_odb_exists_prefix@Base 1.8.0
git_odb_expand_ids@Base 1.8.0
git_odb_foreach@Base 1.8.0
git_odb_free@Base 1.8.0
git_odb_get_backend@Base 1.8.0
git_odb_hash@Base 1.8.0
git_odb_hashfile@Base 1.8.0
git_odb_init_backend@Base 1.8.0
git_odb_new@Base 1.8.0
git_odb_num_backends@Base 1.8.0
git_odb_object_data@Base 1.8.0
git_odb_object_dup@Base 1.8.0
git_odb_object_free@Base 1.8.0
git_odb_object_id@Base 1.8.0
git_odb_object_size@Base 1.8.0
git_odb_object_type@Base 1.8.0
git_odb_open@Base 1.8.0
git_odb_open_rstream@Base 1.8.0
git_odb_open_wstream@Base 1.8.0
git_odb_read@Base 1.8.0
git_odb_read_header@Base 1.8.0
git_odb_read_prefix@Base 1.8.0
git_odb_refresh@Base 1.8.0
git_odb_set_commit_graph@Base 1.8.0
git_odb_stream_finalize_write@Base 1.8.0
git_odb_stream_free@Base 1.8.0
git_odb_stream_read@Base 1.8.0
git_odb_stream_write@Base 1.8.0
git_odb_write@Base 1.8.0
git_odb_write_multi_pack_index@Base 1.8.0
git_odb_write_pack@Base 1.8.0
git_oid_cmp@Base 1.8.0
git_oid_cpy@Base 1.8.0
git_oid_equal@Base 1.8.0
git_oid_fmt@Base 1.8.0
git_oid_fromraw@Base 1.8.0
git_oid_fromstr@Base 1.8.0
git_oid_fromstrn@Base 1.8.0
git_oid_fromstrp@Base 1.8.0
git_oid_is_zero@Base 1.8.0
git_oid_iszero@Base 1.8.0
git_oid_ncmp@Base 1.8.0
git_oid_nfmt@Base 1.8.0
git_oid_pathfmt@Base 1.8.0
git_oid_shorten_add@Base 1.8.0
git_oid_shorten_free@Base 1.8.0
git_oid_shorten_new@Base 1.8.0
git_oid_strcmp@Base 1.8.0
git_oid_streq@Base 1.8.0
git_oid_tostr@Base 1.8.0
git_oid_tostr_s@Base 1.8.0
git_oidarray_dispose@Base 1.8.0
git_oidarray_free@Base 1.8.0
git_openssl_set_locking@Base 1.8.0
git_packbuilder_foreach@Base 1.8.0
git_packbuilder_free@Base 1.8.0
git_packbuilder_hash@Base 1.8.0
git_packbuilder_insert@Base 1.8.0
git_packbuilder_insert_commit@Base 1.8.0
git_packbuilder_insert_recur@Base 1.8.0
git_packbuilder_insert_tree@Base 1.8.0
git_packbuilder_insert_walk@Base 1.8.0
git_packbuilder_name@Base 1.8.0
git_packbuilder_new@Base 1.8.0
git_packbuilder_object_count@Base 1.8.0
git_packbuilder_set_callbacks@Base 1.8.0
git_packbuilder_set_threads@Base 1.8.0
git_packbuilder_write@Base 1.8.0
git_packbuilder_write_buf@Base 1.8.0
git_packbuilder_written@Base 1.8.0
git_patch_free@Base 1.8.0
git_patch_from_blob_and_buffer@Base 1.8.0
git_patch_from_blobs@Base 1.8.0
git_patch_from_buffers@Base 1.8.0
git_patch_from_diff@Base 1.8.0
git_patch_get_delta@Base 1.8.0
git_patch_get_hunk@Base 1.8.0
git_patch_get_line_in_hunk@Base 1.8.0
git_patch_line_stats@Base 1.8.0
git_patch_num_hunks@Base 1.8.0
git_patch_num_lines_in_hunk@Base 1.8.0
git_patch_owner@Base 1.8.0
git_patch_print@Base 1.8.0
git_patch_size@Base 1.8.0
git_patch_to_buf@Base 1.8.0
git_path_is_gitfile@Base 1.8.0
git_pathspec_free@Base 1.8.0
git_pathspec_match_diff@Base 1.8.0
git_pathspec_match_index@Base 1.8.0
git_pathspec_match_list_diff_entry@Base 1.8.0
git_pathspec_match_list_entry@Base 1.8.0
git_pathspec_match_list_entrycount@Base 1.8.0
git_pathspec_match_list_failed_entry@Base 1.8.0
git_pathspec_match_list_failed_entrycount@Base 1.8.0
git_pathspec_match_list_free@Base 1.8.0
git_pathspec_match_tree@Base 1.8.0
git_pathspec_match_workdir@Base 1.8.0
git_pathspec_matches_path@Base 1.8.0
git_pathspec_new@Base 1.8.0
git_proxy_init_options@Base 1.8.0
git_proxy_options_init@Base 1.8.0
git_push_init_options@Base 1.8.0
git_push_options_init@Base 1.8.0
git_rebase_abort@Base 1.8.0
git_rebase_commit@Base 1.8.0
git_rebase_finish@Base 1.8.0
git_rebase_free@Base 1.8.0
git_rebase_init@Base 1.8.0
git_rebase_init_options@Base 1.8.0
git_rebase_inmemory_index@Base 1.8.0
git_rebase_next@Base 1.8.0
git_rebase_onto_id@Base 1.8.0
git_rebase_onto_name@Base 1.8.0
git_rebase_open@Base 1.8.0
git_rebase_operation_byindex@Base 1.8.0
git_rebase_operation_current@Base 1.8.0
git_rebase_operation_entrycount@Base 1.8.0
git_rebase_options_init@Base 1.8.0
git_rebase_orig_head_id@Base 1.8.0
git_rebase_orig_head_name@Base 1.8.0
git_refdb_backend_fs@Base 1.8.0
git_refdb_compress@Base 1.8.0
git_refdb_free@Base 1.8.0
git_refdb_init_backend@Base 1.8.0
git_refdb_new@Base 1.8.0
git_refdb_open@Base 1.8.0
git_refdb_set_backend@Base 1.8.0
git_reference__alloc@Base 1.8.0
git_reference__alloc_symbolic@Base 1.8.0
git_reference_cmp@Base 1.8.0
git_reference_create@Base 1.8.0
git_reference_create_matching@Base 1.8.0
git_reference_delete@Base 1.8.0
git_reference_dup@Base 1.8.0
git_reference_dwim@Base 1.8.0
git_reference_ensure_log@Base 1.8.0
git_reference_foreach@Base 1.8.0
git_reference_foreach_glob@Base 1.8.0
git_reference_foreach_name@Base 1.8.0
git_reference_free@Base 1.8.0
git_reference_has_log@Base 1.8.0
git_reference_is_branch@Base 1.8.0
git_reference_is_note@Base 1.8.0
git_reference_is_remote@Base 1.8.0
git_reference_is_tag@Base 1.8.0
git_reference_is_valid_name@Base 1.8.0
git_reference_iterator_free@Base 1.8.0
git_reference_iterator_glob_new@Base 1.8.0
git_reference_iterator_new@Base 1.8.0
git_reference_list@Base 1.8.0
git_reference_lookup@Base 1.8.0
git_reference_name@Base 1.8.0
git_reference_name_is_valid@Base 1.8.0
git_reference_name_to_id@Base 1.8.0
git_reference_next@Base 1.8.0
git_reference_next_name@Base 1.8.0
git_reference_normalize_name@Base 1.8.0
git_reference_owner@Base 1.8.0
git_reference_peel@Base 1.8.0
git_reference_remove@Base 1.8.0
git_reference_rename@Base 1.8.0
git_reference_resolve@Base 1.8.0
git_reference_set_target@Base 1.8.0
git_reference_shorthand@Base 1.8.0
git_reference_symbolic_create@Base 1.8.0
git_reference_symbolic_create_matching@Base 1.8.0
git_reference_symbolic_set_target@Base 1.8.0
git_reference_symbolic_target@Base 1.8.0
git_reference_target@Base 1.8.0
git_reference_target_peel@Base 1.8.0
git_reference_type@Base 1.8.0
git_reflog_append@Base 1.8.0
git_reflog_delete@Base 1.8.0
git_reflog_drop@Base 1.8.0
git_reflog_entry__free@Base 1.8.0
git_reflog_entry_byindex@Base 1.8.0
git_reflog_entry_committer@Base 1.8.0
git_reflog_entry_id_new@Base 1.8.0
git_reflog_entry_id_old@Base 1.8.0
git_reflog_entry_message@Base 1.8.0
git_reflog_entrycount@Base 1.8.0
git_reflog_free@Base 1.8.0
git_reflog_read@Base 1.8.0
git_reflog_rename@Base 1.8.0
git_reflog_write@Base 1.8.0
git_refspec_direction@Base 1.8.0
git_refspec_dst@Base 1.8.0
git_refspec_dst_matches@Base 1.8.0
git_refspec_force@Base 1.8.0
git_refspec_free@Base 1.8.0
git_refspec_parse@Base 1.8.0
git_refspec_rtransform@Base 1.8.0
git_refspec_src@Base 1.8.0
git_refspec_src_matches@Base 1.8.0
git_refspec_string@Base 1.8.0
git_refspec_transform@Base 1.8.0
git_remote_add_fetch@Base 1.8.0
git_remote_add_push@Base 1.8.0
git_remote_autotag@Base 1.8.0
git_remote_connect@Base 1.8.0
git_remote_connect_ext@Base 1.8.0
git_remote_connect_options_dispose@Base 1.8.0
git_remote_connect_options_init@Base 1.8.0
git_remote_connected@Base 1.8.0
git_remote_create@Base 1.8.0
git_remote_create_anonymous@Base 1.8.0
git_remote_create_detached@Base 1.8.0
git_remote_create_init_options@Base 1.8.0
git_remote_create_options_init@Base 1.8.0
git_remote_create_with_fetchspec@Base 1.8.0
git_remote_create_with_opts@Base 1.8.0
git_remote_default_branch@Base 1.8.0
git_remote_delete@Base 1.8.0
git_remote_disconnect@Base 1.8.0
git_remote_download@Base 1.8.0
git_remote_dup@Base 1.8.0
git_remote_fetch@Base 1.8.0
git_remote_free@Base 1.8.0
git_remote_get_fetch_refspecs@Base 1.8.0
git_remote_get_push_refspecs@Base 1.8.0
git_remote_get_refspec@Base 1.8.0
git_remote_init_callbacks@Base 1.8.0
git_remote_is_valid_name@Base 1.8.0
git_remote_list@Base 1.8.0
git_remote_lookup@Base 1.8.0
git_remote_ls@Base 1.8.0
git_remote_name@Base 1.8.0
git_remote_name_is_valid@Base 1.8.0
git_remote_owner@Base 1.8.0
git_remote_prune@Base 1.8.0
git_remote_prune_refs@Base 1.8.0
git_remote_push@Base 1.8.0
git_remote_pushurl@Base 1.8.0
git_remote_refspec_count@Base 1.8.0
git_remote_rename@Base 1.8.0
git_remote_set_autotag@Base 1.8.0
git_remote_set_instance_pushurl@Base 1.8.0
git_remote_set_instance_url@Base 1.8.0
git_remote_set_pushurl@Base 1.8.0
git_remote_set_url@Base 1.8.0
git_remote_stats@Base 1.8.0
git_remote_stop@Base 1.8.0
git_remote_update_tips@Base 1.8.0
git_remote_upload@Base 1.8.0
git_remote_url@Base 1.8.0
git_repository__cleanup@Base 1.8.0
git_repository_commit_parents@Base 1.8.0
git_repository_commondir@Base 1.8.0
git_repository_config@Base 1.8.0
git_repository_config_snapshot@Base 1.8.0
git_repository_detach_head@Base 1.8.0
git_repository_discover@Base 1.8.0
git_repository_fetchhead_foreach@Base 1.8.0
git_repository_free@Base 1.8.0
git_repository_get_namespace@Base 1.8.0
git_repository_hashfile@Base 1.8.0
git_repository_head@Base 1.8.0
git_repository_head_detached@Base 1.8.0
git_repository_head_detached_for_worktree@Base 1.8.0
git_repository_head_for_worktree@Base 1.8.0
git_repository_head_unborn@Base 1.8.0
git_repository_ident@Base 1.8.0
git_repository_index@Base 1.8.0
git_repository_init@Base 1.8.0
git_repository_init_ext@Base 1.8.0
git_repository_init_init_options@Base 1.8.0
git_repository_init_options_init@Base 1.8.0
git_repository_is_bare@Base 1.8.0
git_repository_is_empty@Base 1.8.0
git_repository_is_shallow@Base 1.8.0
git_repository_is_worktree@Base 1.8.0
git_repository_item_path@Base 1.8.0
git_repository_mergehead_foreach@Base 1.8.0
git_repository_message@Base 1.8.0
git_repository_message_remove@Base 1.8.0
git_repository_new@Base 1.8.0
git_repository_odb@Base 1.8.0
git_repository_oid_type@Base 1.8.0
git_repository_open@Base 1.8.0
git_repository_open_bare@Base 1.8.0
git_repository_open_ext@Base 1.8.0
git_repository_open_from_worktree@Base 1.8.0
git_repository_path@Base 1.8.0
git_repository_refdb@Base 1.8.0
git_repository_reinit_filesystem@Base 1.8.0
git_repository_set_bare@Base 1.8.0
git_repository_set_config@Base 1.8.0
git_repository_set_head@Base 1.8.0
git_repository_set_head_detached@Base 1.8.0
git_repository_set_head_detached_from_annotated@Base 1.8.0
git_repository_set_ident@Base 1.8.0
git_repository_set_index@Base 1.8.0
git_repository_set_namespace@Base 1.8.0
git_repository_set_odb@Base 1.8.0
git_repository_set_refdb@Base 1.8.0
git_repository_set_workdir@Base 1.8.0
git_repository_state@Base 1.8.0
git_repository_state_cleanup@Base 1.8.0
git_repository_submodule_cache_all@Base 1.8.0
git_repository_submodule_cache_clear@Base 1.8.0
git_repository_workdir@Base 1.8.0
git_repository_wrap_odb@Base 1.8.0
git_reset@Base 1.8.0
git_reset_default@Base 1.8.0
git_reset_from_annotated@Base 1.8.0
git_revert@Base 1.8.0
git_revert_commit@Base 1.8.0
git_revert_init_options@Base 1.8.0
git_revert_options_init@Base 1.8.0
git_revparse@Base 1.8.0
git_revparse_ext@Base 1.8.0
git_revparse_single@Base 1.8.0
git_revwalk_add_hide_cb@Base 1.8.0
git_revwalk_free@Base 1.8.0
git_revwalk_hide@Base 1.8.0
git_revwalk_hide_glob@Base 1.8.0
git_revwalk_hide_head@Base 1.8.0
git_revwalk_hide_ref@Base 1.8.0
git_revwalk_new@Base 1.8.0
git_revwalk_next@Base 1.8.0
git_revwalk_push@Base 1.8.0
git_revwalk_push_glob@Base 1.8.0
git_revwalk_push_head@Base 1.8.0
git_revwalk_push_range@Base 1.8.0
git_revwalk_push_ref@Base 1.8.0
git_revwalk_repository@Base 1.8.0
git_revwalk_reset@Base 1.8.0
git_revwalk_simplify_first_parent@Base 1.8.0
git_revwalk_sorting@Base 1.8.0
git_signature_default@Base 1.8.0
git_signature_dup@Base 1.8.0
git_signature_free@Base 1.8.0
git_signature_from_buffer@Base 1.8.0
git_signature_new@Base 1.8.0
git_signature_now@Base 1.8.0
git_smart_subtransport_git@Base 1.8.0
git_smart_subtransport_http@Base 1.8.0
git_smart_subtransport_ssh@Base 1.8.0
git_stash_apply@Base 1.8.0
git_stash_apply_init_options@Base 1.8.0
git_stash_apply_options_init@Base 1.8.0
git_stash_drop@Base 1.8.0
git_stash_foreach@Base 1.8.0
git_stash_pop@Base 1.8.0
git_stash_save@Base 1.8.0
git_stash_save_options_init@Base 1.8.0
git_stash_save_with_opts@Base 1.8.0
git_status_byindex@Base 1.8.0
git_status_file@Base 1.8.0
git_status_foreach@Base 1.8.0
git_status_foreach_ext@Base 1.8.0
git_status_init_options@Base 1.8.0
git_status_list_entrycount@Base 1.8.0
git_status_list_free@Base 1.8.0
git_status_list_get_perfdata@Base 1.8.0
git_status_list_new@Base 1.8.0
git_status_options_init@Base 1.8.0
git_status_should_ignore@Base 1.8.0
git_strarray_copy@Base 1.8.0
git_strarray_dispose@Base 1.8.0
git_strarray_free@Base 1.8.0
git_stream_register@Base 1.8.0
git_stream_register_tls@Base 1.8.0
git_submodule_add_finalize@Base 1.8.0
git_submodule_add_setup@Base 1.8.0
git_submodule_add_to_index@Base 1.8.0
git_submodule_branch@Base 1.8.0
git_submodule_clone@Base 1.8.0
git_submodule_dup@Base 1.8.0
git_submodule_fetch_recurse_submodules@Base 1.8.0
git_submodule_foreach@Base 1.8.0
git_submodule_free@Base 1.8.0
git_submodule_head_id@Base 1.8.0
git_submodule_ignore@Base 1.8.0
git_submodule_index_id@Base 1.8.0
git_submodule_init@Base 1.8.0
git_submodule_location@Base 1.8.0
git_submodule_lookup@Base 1.8.0
git_submodule_name@Base 1.8.0
git_submodule_open@Base 1.8.0
git_submodule_owner@Base 1.8.0
git_submodule_path@Base 1.8.0
git_submodule_reload@Base 1.8.0
git_submodule_repo_init@Base 1.8.0
git_submodule_resolve_url@Base 1.8.0
git_submodule_set_branch@Base 1.8.0
git_submodule_set_fetch_recurse_submodules@Base 1.8.0
git_submodule_set_ignore@Base 1.8.0
git_submodule_set_update@Base 1.8.0
git_submodule_set_url@Base 1.8.0
git_submodule_status@Base 1.8.0
git_submodule_sync@Base 1.8.0
git_submodule_update@Base 1.8.0
git_submodule_update_init_options@Base 1.8.0
git_submodule_update_options_init@Base 1.8.0
git_submodule_update_strategy@Base 1.8.0
git_submodule_url@Base 1.8.0
git_submodule_wd_id@Base 1.8.0
git_tag_annotation_create@Base 1.8.0
git_tag_create@Base 1.8.0
git_tag_create_from_buffer@Base 1.8.0
git_tag_create_frombuffer@Base 1.8.0
git_tag_create_lightweight@Base 1.8.0
git_tag_delete@Base 1.8.0
git_tag_dup@Base 1.8.0
git_tag_foreach@Base 1.8.0
git_tag_free@Base 1.8.0
git_tag_id@Base 1.8.0
git_tag_list@Base 1.8.0
git_tag_list_match@Base 1.8.0
git_tag_lookup@Base 1.8.0
git_tag_lookup_prefix@Base 1.8.0
git_tag_message@Base 1.8.0
git_tag_name@Base 1.8.0
git_tag_name_is_valid@Base 1.8.0
git_tag_owner@Base 1.8.0
git_tag_peel@Base 1.8.0
git_tag_tagger@Base 1.8.0
git_tag_target@Base 1.8.0
git_tag_target_id@Base 1.8.0
git_tag_target_type@Base 1.8.0
git_trace_set@Base 1.8.0
git_transaction_commit@Base 1.8.0
git_transaction_free@Base 1.8.0
git_transaction_lock_ref@Base 1.8.0
git_transaction_new@Base 1.8.0
git_transaction_remove@Base 1.8.0
git_transaction_set_reflog@Base 1.8.0
git_transaction_set_symbolic_target@Base 1.8.0
git_transaction_set_target@Base 1.8.0
git_transport_init@Base 1.8.0
git_transport_local@Base 1.8.0
git_transport_new@Base 1.8.0
git_transport_register@Base 1.8.0
git_transport_remote_connect_options@Base 1.8.0
git_transport_smart@Base 1.8.0
git_transport_smart_certificate_check@Base 1.8.0
git_transport_smart_credentials@Base 1.8.0
git_transport_ssh_with_paths@Base 1.8.0
git_transport_unregister@Base 1.8.0
git_tree_create_updated@Base 1.8.0
git_tree_dup@Base 1.8.0
git_tree_entry_byid@Base 1.8.0
git_tree_entry_byindex@Base 1.8.0
git_tree_entry_byname@Base 1.8.0
git_tree_entry_bypath@Base 1.8.0
git_tree_entry_cmp@Base 1.8.0
git_tree_entry_dup@Base 1.8.0
git_tree_entry_filemode@Base 1.8.0
git_tree_entry_filemode_raw@Base 1.8.0
git_tree_entry_free@Base 1.8.0
git_tree_entry_id@Base 1.8.0
git_tree_entry_name@Base 1.8.0
git_tree_entry_to_object@Base 1.8.0
git_tree_entry_type@Base 1.8.0
git_tree_entrycount@Base 1.8.0
git_tree_free@Base 1.8.0
git_tree_id@Base 1.8.0
git_tree_lookup@Base 1.8.0
git_tree_lookup_prefix@Base 1.8.0
git_tree_owner@Base 1.8.0
git_tree_walk@Base 1.8.0
git_treebuilder_clear@Base 1.8.0
git_treebuilder_entrycount@Base 1.8.0
git_treebuilder_filter@Base 1.8.0
git_treebuilder_free@Base 1.8.0
git_treebuilder_get@Base 1.8.0
git_treebuilder_insert@Base 1.8.0
git_treebuilder_new@Base 1.8.0
git_treebuilder_remove@Base 1.8.0
git_treebuilder_write@Base 1.8.0
git_treebuilder_write_with_buffer@Base 1.8.0
git_worktree_add@Base 1.8.0
git_worktree_add_init_options@Base 1.8.0
git_worktree_add_options_init@Base 1.8.0
git_worktree_free@Base 1.8.0
git_worktree_is_locked@Base 1.8.0
git_worktree_is_prunable@Base 1.8.0
git_worktree_list@Base 1.8.0
git_worktree_lock@Base 1.8.0
git_worktree_lookup@Base 1.8.0
git_worktree_name@Base 1.8.0
git_worktree_open_from_repository@Base 1.8.0
git_worktree_path@Base 1.8.0
git_worktree_prune@Base 1.8.0
git_worktree_prune_init_options@Base 1.8.0
git_worktree_prune_options_init@Base 1.8.0
git_worktree_unlock@Base 1.8.0
git_worktree_validate@Base 1.8.0
giterr_clear@Base 1.8.0
giterr_last@Base 1.8.0
giterr_set_oom@Base 1.8.0
giterr_set_str@Base 1.8.0

View File

@ -11,7 +11,7 @@ Forwarded: not-needed
4 files changed, 29 insertions(+), 18 deletions(-) 4 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/tests/libgit2/repo/init.c b/tests/libgit2/repo/init.c diff --git a/tests/libgit2/repo/init.c b/tests/libgit2/repo/init.c
index d78ec06..17a0ae2 100644 index 446ab73..8cf7320 100644
--- a/tests/libgit2/repo/init.c --- a/tests/libgit2/repo/init.c
+++ b/tests/libgit2/repo/init.c +++ b/tests/libgit2/repo/init.c
@@ -443,12 +443,14 @@ void test_repo_init__extended_1(void) @@ -443,12 +443,14 @@ void test_repo_init__extended_1(void)

View File

@ -1,19 +0,0 @@
From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
Date: Sun, 28 Aug 2022 17:42:55 +0200
Subject: Use bash for shell script with bashisms
Forwarded: https://github.com/libgit2/libgit2/pull/6581
---
tests/resources/push.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/resources/push.sh b/tests/resources/push.sh
index 3e77fb5..54ef3dd 100644
--- a/tests/resources/push.sh
+++ b/tests/resources/push.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#creates push_src repo for libgit2 push tests.
set -eu

View File

@ -1,3 +1,2 @@
disable-online-tests.patch disable-online-tests.patch
handle-bashism.patch
disable-flaky-stat-tests.patch disable-flaky-stat-tests.patch

13
debian/rules vendored
View File

@ -8,8 +8,13 @@
# Uncomment this to turn on verbose mode. # Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1 #export DH_VERBOSE=1
include /usr/share/dpkg/architecture.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_BUILD_MAINT_OPTIONS = hardening=+all
ARCH_WITH_LLHTTP = amd64 arm64 armel armhf i386 mips64el ppc64el riscv64 s390x loong64 ppc64
BUILD_TESTS = $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),OFF,ON) BUILD_TESTS = $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),OFF,ON)
COMMON_CMAKE_FLAGS = \ COMMON_CMAKE_FLAGS = \
-DBUILD_CLI=OFF \ -DBUILD_CLI=OFF \
@ -20,10 +25,13 @@ COMMON_CMAKE_FLAGS = \
-DREGEX_BACKEND=pcre2 \ -DREGEX_BACKEND=pcre2 \
-DUSE_GSSAPI=ON \ -DUSE_GSSAPI=ON \
-DUSE_HTTPS=mbedTLS \ -DUSE_HTTPS=mbedTLS \
-DUSE_HTTP_PARSER=system \
-DUSE_NTLMCLIENT=OFF \ -DUSE_NTLMCLIENT=OFF \
-DUSE_SSH=ON -DUSE_SSH=ON
ifneq (,$(filter $(ARCH_WITH_LLHTTP),$(DEB_HOST_ARCH)))
COMMON_CMAKE_FLAGS += \
-DUSE_HTTP_PARSER=llhttp
endif
# The stat() in the Git fs layer has some issues # The stat() in the Git fs layer has some issues
export GITTEST_FLAKY_STAT = true export GITTEST_FLAKY_STAT = true
@ -47,6 +55,9 @@ override_dh_auto_install:
dh_auto_install --builddirectory=build-debian-devel dh_auto_install --builddirectory=build-debian-devel
dh_auto_install --builddirectory=build-debian-release dh_auto_install --builddirectory=build-debian-release
execute_after_dh_auto_install:
override_dh_auto_test: override_dh_auto_test:
dh_auto_test --builddirectory=build-debian-devel dh_auto_test --builddirectory=build-debian-devel
dh_auto_test --builddirectory=build-debian-release dh_auto_test --builddirectory=build-debian-release

View File

@ -1,2 +1,6 @@
Test-Command: cmake debian/tests;make;./libgit2_test Test-Command: cmake debian/tests;make;./libgit2_test
Depends: @, cmake, gcc, g++ Depends:
cmake,
g++,
gcc,
@,

2
debian/watch vendored
View File

@ -1,5 +1,5 @@
version=4 version=4
opts=filenamemangle=s%(?:.*?)?v?(\d[\d.]*@ARCHIVE_EXT@)%@PACKAGE@-$1%,\ opts=filenamemangle=s%(?:.*?)?v?(\d[\d.]*@ARCHIVE_EXT@)%@PACKAGE@-$1%,\
repack,dversionmangle=auto,repacksuffix=+ds \ repack,dversionmangle=auto,uversionmangle=s%-?([abrc])%~$1%,repacksuffix=+ds \
https://github.com/libgit2/libgit2/tags (?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ https://github.com/libgit2/libgit2/tags (?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@

8
deps/llhttp/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,8 @@
file(GLOB SRC_LLHTTP "*.c" "*.h")
list(SORT SRC_LLHTTP)
add_library(llhttp OBJECT ${SRC_LLHTTP})
if(NOT MSVC)
set_source_files_properties(api.c http.c llhttp.c PROPERTIES COMPILE_FLAGS "-Wno-unused-parameter -Wno-missing-declarations")
endif()

22
deps/llhttp/LICENSE-MIT vendored Normal file
View File

@ -0,0 +1,22 @@
This software is licensed under the MIT License.
Copyright Fedor Indutny, 2018.
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.

510
deps/llhttp/api.c vendored Normal file
View File

@ -0,0 +1,510 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "llhttp.h"
#define CALLBACK_MAYBE(PARSER, NAME) \
do { \
const llhttp_settings_t* settings; \
settings = (const llhttp_settings_t*) (PARSER)->settings; \
if (settings == NULL || settings->NAME == NULL) { \
err = 0; \
break; \
} \
err = settings->NAME((PARSER)); \
} while (0)
#define SPAN_CALLBACK_MAYBE(PARSER, NAME, START, LEN) \
do { \
const llhttp_settings_t* settings; \
settings = (const llhttp_settings_t*) (PARSER)->settings; \
if (settings == NULL || settings->NAME == NULL) { \
err = 0; \
break; \
} \
err = settings->NAME((PARSER), (START), (LEN)); \
if (err == -1) { \
err = HPE_USER; \
llhttp_set_error_reason((PARSER), "Span callback error in " #NAME); \
} \
} while (0)
void llhttp_init(llhttp_t* parser, llhttp_type_t type,
const llhttp_settings_t* settings) {
llhttp__internal_init(parser);
parser->type = type;
parser->settings = (void*) settings;
}
#if defined(__wasm__)
extern int wasm_on_message_begin(llhttp_t * p);
extern int wasm_on_url(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_status(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_header_field(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_header_value(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_headers_complete(llhttp_t * p, int status_code,
uint8_t upgrade, int should_keep_alive);
extern int wasm_on_body(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_message_complete(llhttp_t * p);
static int wasm_on_headers_complete_wrap(llhttp_t* p) {
return wasm_on_headers_complete(p, p->status_code, p->upgrade,
llhttp_should_keep_alive(p));
}
const llhttp_settings_t wasm_settings = {
wasm_on_message_begin,
wasm_on_url,
wasm_on_status,
NULL,
NULL,
wasm_on_header_field,
wasm_on_header_value,
NULL,
NULL,
wasm_on_headers_complete_wrap,
wasm_on_body,
wasm_on_message_complete,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};
llhttp_t* llhttp_alloc(llhttp_type_t type) {
llhttp_t* parser = malloc(sizeof(llhttp_t));
llhttp_init(parser, type, &wasm_settings);
return parser;
}
void llhttp_free(llhttp_t* parser) {
free(parser);
}
#endif // defined(__wasm__)
/* Some getters required to get stuff from the parser */
uint8_t llhttp_get_type(llhttp_t* parser) {
return parser->type;
}
uint8_t llhttp_get_http_major(llhttp_t* parser) {
return parser->http_major;
}
uint8_t llhttp_get_http_minor(llhttp_t* parser) {
return parser->http_minor;
}
uint8_t llhttp_get_method(llhttp_t* parser) {
return parser->method;
}
int llhttp_get_status_code(llhttp_t* parser) {
return parser->status_code;
}
uint8_t llhttp_get_upgrade(llhttp_t* parser) {
return parser->upgrade;
}
void llhttp_reset(llhttp_t* parser) {
llhttp_type_t type = parser->type;
const llhttp_settings_t* settings = parser->settings;
void* data = parser->data;
uint16_t lenient_flags = parser->lenient_flags;
llhttp__internal_init(parser);
parser->type = type;
parser->settings = (void*) settings;
parser->data = data;
parser->lenient_flags = lenient_flags;
}
llhttp_errno_t llhttp_execute(llhttp_t* parser, const char* data, size_t len) {
return llhttp__internal_execute(parser, data, data + len);
}
void llhttp_settings_init(llhttp_settings_t* settings) {
memset(settings, 0, sizeof(*settings));
}
llhttp_errno_t llhttp_finish(llhttp_t* parser) {
int err;
/* We're in an error state. Don't bother doing anything. */
if (parser->error != 0) {
return 0;
}
switch (parser->finish) {
case HTTP_FINISH_SAFE_WITH_CB:
CALLBACK_MAYBE(parser, on_message_complete);
if (err != HPE_OK) return err;
/* FALLTHROUGH */
case HTTP_FINISH_SAFE:
return HPE_OK;
case HTTP_FINISH_UNSAFE:
parser->reason = "Invalid EOF state";
return HPE_INVALID_EOF_STATE;
default:
abort();
}
}
void llhttp_pause(llhttp_t* parser) {
if (parser->error != HPE_OK) {
return;
}
parser->error = HPE_PAUSED;
parser->reason = "Paused";
}
void llhttp_resume(llhttp_t* parser) {
if (parser->error != HPE_PAUSED) {
return;
}
parser->error = 0;
}
void llhttp_resume_after_upgrade(llhttp_t* parser) {
if (parser->error != HPE_PAUSED_UPGRADE) {
return;
}
parser->error = 0;
}
llhttp_errno_t llhttp_get_errno(const llhttp_t* parser) {
return parser->error;
}
const char* llhttp_get_error_reason(const llhttp_t* parser) {
return parser->reason;
}
void llhttp_set_error_reason(llhttp_t* parser, const char* reason) {
parser->reason = reason;
}
const char* llhttp_get_error_pos(const llhttp_t* parser) {
return parser->error_pos;
}
const char* llhttp_errno_name(llhttp_errno_t err) {
#define HTTP_ERRNO_GEN(CODE, NAME, _) case HPE_##NAME: return "HPE_" #NAME;
switch (err) {
HTTP_ERRNO_MAP(HTTP_ERRNO_GEN)
default: abort();
}
#undef HTTP_ERRNO_GEN
}
const char* llhttp_method_name(llhttp_method_t method) {
#define HTTP_METHOD_GEN(NUM, NAME, STRING) case HTTP_##NAME: return #STRING;
switch (method) {
HTTP_ALL_METHOD_MAP(HTTP_METHOD_GEN)
default: abort();
}
#undef HTTP_METHOD_GEN
}
const char* llhttp_status_name(llhttp_status_t status) {
#define HTTP_STATUS_GEN(NUM, NAME, STRING) case HTTP_STATUS_##NAME: return #STRING;
switch (status) {
HTTP_STATUS_MAP(HTTP_STATUS_GEN)
default: abort();
}
#undef HTTP_STATUS_GEN
}
void llhttp_set_lenient_headers(llhttp_t* parser, int enabled) {
if (enabled) {
parser->lenient_flags |= LENIENT_HEADERS;
} else {
parser->lenient_flags &= ~LENIENT_HEADERS;
}
}
void llhttp_set_lenient_chunked_length(llhttp_t* parser, int enabled) {
if (enabled) {
parser->lenient_flags |= LENIENT_CHUNKED_LENGTH;
} else {
parser->lenient_flags &= ~LENIENT_CHUNKED_LENGTH;
}
}
void llhttp_set_lenient_keep_alive(llhttp_t* parser, int enabled) {
if (enabled) {
parser->lenient_flags |= LENIENT_KEEP_ALIVE;
} else {
parser->lenient_flags &= ~LENIENT_KEEP_ALIVE;
}
}
void llhttp_set_lenient_transfer_encoding(llhttp_t* parser, int enabled) {
if (enabled) {
parser->lenient_flags |= LENIENT_TRANSFER_ENCODING;
} else {
parser->lenient_flags &= ~LENIENT_TRANSFER_ENCODING;
}
}
void llhttp_set_lenient_version(llhttp_t* parser, int enabled) {
if (enabled) {
parser->lenient_flags |= LENIENT_VERSION;
} else {
parser->lenient_flags &= ~LENIENT_VERSION;
}
}
void llhttp_set_lenient_data_after_close(llhttp_t* parser, int enabled) {
if (enabled) {
parser->lenient_flags |= LENIENT_DATA_AFTER_CLOSE;
} else {
parser->lenient_flags &= ~LENIENT_DATA_AFTER_CLOSE;
}
}
void llhttp_set_lenient_optional_lf_after_cr(llhttp_t* parser, int enabled) {
if (enabled) {
parser->lenient_flags |= LENIENT_OPTIONAL_LF_AFTER_CR;
} else {
parser->lenient_flags &= ~LENIENT_OPTIONAL_LF_AFTER_CR;
}
}
void llhttp_set_lenient_optional_crlf_after_chunk(llhttp_t* parser, int enabled) {
if (enabled) {
parser->lenient_flags |= LENIENT_OPTIONAL_CRLF_AFTER_CHUNK;
} else {
parser->lenient_flags &= ~LENIENT_OPTIONAL_CRLF_AFTER_CHUNK;
}
}
void llhttp_set_lenient_optional_cr_before_lf(llhttp_t* parser, int enabled) {
if (enabled) {
parser->lenient_flags |= LENIENT_OPTIONAL_CR_BEFORE_LF;
} else {
parser->lenient_flags &= ~LENIENT_OPTIONAL_CR_BEFORE_LF;
}
}
void llhttp_set_lenient_spaces_after_chunk_size(llhttp_t* parser, int enabled) {
if (enabled) {
parser->lenient_flags |= LENIENT_SPACES_AFTER_CHUNK_SIZE;
} else {
parser->lenient_flags &= ~LENIENT_SPACES_AFTER_CHUNK_SIZE;
}
}
/* Callbacks */
int llhttp__on_message_begin(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_message_begin);
return err;
}
int llhttp__on_url(llhttp_t* s, const char* p, const char* endp) {
int err;
SPAN_CALLBACK_MAYBE(s, on_url, p, endp - p);
return err;
}
int llhttp__on_url_complete(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_url_complete);
return err;
}
int llhttp__on_status(llhttp_t* s, const char* p, const char* endp) {
int err;
SPAN_CALLBACK_MAYBE(s, on_status, p, endp - p);
return err;
}
int llhttp__on_status_complete(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_status_complete);
return err;
}
int llhttp__on_method(llhttp_t* s, const char* p, const char* endp) {
int err;
SPAN_CALLBACK_MAYBE(s, on_method, p, endp - p);
return err;
}
int llhttp__on_method_complete(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_method_complete);
return err;
}
int llhttp__on_version(llhttp_t* s, const char* p, const char* endp) {
int err;
SPAN_CALLBACK_MAYBE(s, on_version, p, endp - p);
return err;
}
int llhttp__on_version_complete(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_version_complete);
return err;
}
int llhttp__on_header_field(llhttp_t* s, const char* p, const char* endp) {
int err;
SPAN_CALLBACK_MAYBE(s, on_header_field, p, endp - p);
return err;
}
int llhttp__on_header_field_complete(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_header_field_complete);
return err;
}
int llhttp__on_header_value(llhttp_t* s, const char* p, const char* endp) {
int err;
SPAN_CALLBACK_MAYBE(s, on_header_value, p, endp - p);
return err;
}
int llhttp__on_header_value_complete(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_header_value_complete);
return err;
}
int llhttp__on_headers_complete(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_headers_complete);
return err;
}
int llhttp__on_message_complete(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_message_complete);
return err;
}
int llhttp__on_body(llhttp_t* s, const char* p, const char* endp) {
int err;
SPAN_CALLBACK_MAYBE(s, on_body, p, endp - p);
return err;
}
int llhttp__on_chunk_header(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_chunk_header);
return err;
}
int llhttp__on_chunk_extension_name(llhttp_t* s, const char* p, const char* endp) {
int err;
SPAN_CALLBACK_MAYBE(s, on_chunk_extension_name, p, endp - p);
return err;
}
int llhttp__on_chunk_extension_name_complete(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_chunk_extension_name_complete);
return err;
}
int llhttp__on_chunk_extension_value(llhttp_t* s, const char* p, const char* endp) {
int err;
SPAN_CALLBACK_MAYBE(s, on_chunk_extension_value, p, endp - p);
return err;
}
int llhttp__on_chunk_extension_value_complete(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_chunk_extension_value_complete);
return err;
}
int llhttp__on_chunk_complete(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_chunk_complete);
return err;
}
int llhttp__on_reset(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_reset);
return err;
}
/* Private */
void llhttp__debug(llhttp_t* s, const char* p, const char* endp,
const char* msg) {
if (p == endp) {
fprintf(stderr, "p=%p type=%d flags=%02x next=null debug=%s\n", s, s->type,
s->flags, msg);
} else {
fprintf(stderr, "p=%p type=%d flags=%02x next=%02x debug=%s\n", s,
s->type, s->flags, *p, msg);
}
}

170
deps/llhttp/http.c vendored Normal file
View File

@ -0,0 +1,170 @@
#include <stdio.h>
#ifndef LLHTTP__TEST
# include "llhttp.h"
#else
# define llhttp_t llparse_t
#endif /* */
int llhttp_message_needs_eof(const llhttp_t* parser);
int llhttp_should_keep_alive(const llhttp_t* parser);
int llhttp__before_headers_complete(llhttp_t* parser, const char* p,
const char* endp) {
/* Set this here so that on_headers_complete() callbacks can see it */
if ((parser->flags & F_UPGRADE) &&
(parser->flags & F_CONNECTION_UPGRADE)) {
/* For responses, "Upgrade: foo" and "Connection: upgrade" are
* mandatory only when it is a 101 Switching Protocols response,
* otherwise it is purely informational, to announce support.
*/
parser->upgrade =
(parser->type == HTTP_REQUEST || parser->status_code == 101);
} else {
parser->upgrade = (parser->method == HTTP_CONNECT);
}
return 0;
}
/* Return values:
* 0 - No body, `restart`, message_complete
* 1 - CONNECT request, `restart`, message_complete, and pause
* 2 - chunk_size_start
* 3 - body_identity
* 4 - body_identity_eof
* 5 - invalid transfer-encoding for request
*/
int llhttp__after_headers_complete(llhttp_t* parser, const char* p,
const char* endp) {
int hasBody;
hasBody = parser->flags & F_CHUNKED || parser->content_length > 0;
if (
(parser->upgrade && (parser->method == HTTP_CONNECT ||
(parser->flags & F_SKIPBODY) || !hasBody)) ||
/* See RFC 2616 section 4.4 - 1xx e.g. Continue */
(parser->type == HTTP_RESPONSE && parser->status_code == 101)
) {
/* Exit, the rest of the message is in a different protocol. */
return 1;
}
if (parser->type == HTTP_RESPONSE && parser->status_code == 100) {
/* No body, restart as the message is complete */
return 0;
}
/* See RFC 2616 section 4.4 */
if (
parser->flags & F_SKIPBODY || /* response to a HEAD request */
(
parser->type == HTTP_RESPONSE && (
parser->status_code == 102 || /* Processing */
parser->status_code == 103 || /* Early Hints */
parser->status_code == 204 || /* No Content */
parser->status_code == 304 /* Not Modified */
)
)
) {
return 0;
} else if (parser->flags & F_CHUNKED) {
/* chunked encoding - ignore Content-Length header, prepare for a chunk */
return 2;
} else if (parser->flags & F_TRANSFER_ENCODING) {
if (parser->type == HTTP_REQUEST &&
(parser->lenient_flags & LENIENT_CHUNKED_LENGTH) == 0 &&
(parser->lenient_flags & LENIENT_TRANSFER_ENCODING) == 0) {
/* RFC 7230 3.3.3 */
/* If a Transfer-Encoding header field
* is present in a request and the chunked transfer coding is not
* the final encoding, the message body length cannot be determined
* reliably; the server MUST respond with the 400 (Bad Request)
* status code and then close the connection.
*/
return 5;
} else {
/* RFC 7230 3.3.3 */
/* If a Transfer-Encoding header field is present in a response and
* the chunked transfer coding is not the final encoding, the
* message body length is determined by reading the connection until
* it is closed by the server.
*/
return 4;
}
} else {
if (!(parser->flags & F_CONTENT_LENGTH)) {
if (!llhttp_message_needs_eof(parser)) {
/* Assume content-length 0 - read the next */
return 0;
} else {
/* Read body until EOF */
return 4;
}
} else if (parser->content_length == 0) {
/* Content-Length header given but zero: Content-Length: 0\r\n */
return 0;
} else {
/* Content-Length header given and non-zero */
return 3;
}
}
}
int llhttp__after_message_complete(llhttp_t* parser, const char* p,
const char* endp) {
int should_keep_alive;
should_keep_alive = llhttp_should_keep_alive(parser);
parser->finish = HTTP_FINISH_SAFE;
parser->flags = 0;
/* NOTE: this is ignored in loose parsing mode */
return should_keep_alive;
}
int llhttp_message_needs_eof(const llhttp_t* parser) {
if (parser->type == HTTP_REQUEST) {
return 0;
}
/* See RFC 2616 section 4.4 */
if (parser->status_code / 100 == 1 || /* 1xx e.g. Continue */
parser->status_code == 204 || /* No Content */
parser->status_code == 304 || /* Not Modified */
(parser->flags & F_SKIPBODY)) { /* response to a HEAD request */
return 0;
}
/* RFC 7230 3.3.3, see `llhttp__after_headers_complete` */
if ((parser->flags & F_TRANSFER_ENCODING) &&
(parser->flags & F_CHUNKED) == 0) {
return 1;
}
if (parser->flags & (F_CHUNKED | F_CONTENT_LENGTH)) {
return 0;
}
return 1;
}
int llhttp_should_keep_alive(const llhttp_t* parser) {
if (parser->http_major > 0 && parser->http_minor > 0) {
/* HTTP/1.1 */
if (parser->flags & F_CONNECTION_CLOSE) {
return 0;
}
} else {
/* HTTP/1.0 or earlier */
if (!(parser->flags & F_CONNECTION_KEEP_ALIVE)) {
return 0;
}
}
return !llhttp_message_needs_eof(parser);
}

10168
deps/llhttp/llhttp.c vendored Normal file

File diff suppressed because it is too large Load Diff

897
deps/llhttp/llhttp.h vendored Normal file
View File

@ -0,0 +1,897 @@
#ifndef INCLUDE_LLHTTP_H_
#define INCLUDE_LLHTTP_H_
#define LLHTTP_VERSION_MAJOR 9
#define LLHTTP_VERSION_MINOR 2
#define LLHTTP_VERSION_PATCH 1
#ifndef INCLUDE_LLHTTP_ITSELF_H_
#define INCLUDE_LLHTTP_ITSELF_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
typedef struct llhttp__internal_s llhttp__internal_t;
struct llhttp__internal_s {
int32_t _index;
void* _span_pos0;
void* _span_cb0;
int32_t error;
const char* reason;
const char* error_pos;
void* data;
void* _current;
uint64_t content_length;
uint8_t type;
uint8_t method;
uint8_t http_major;
uint8_t http_minor;
uint8_t header_state;
uint16_t lenient_flags;
uint8_t upgrade;
uint8_t finish;
uint16_t flags;
uint16_t status_code;
uint8_t initial_message_completed;
void* settings;
};
int llhttp__internal_init(llhttp__internal_t* s);
int llhttp__internal_execute(llhttp__internal_t* s, const char* p, const char* endp);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* INCLUDE_LLHTTP_ITSELF_H_ */
#ifndef LLLLHTTP_C_HEADERS_
#define LLLLHTTP_C_HEADERS_
#ifdef __cplusplus
extern "C" {
#endif
enum llhttp_errno {
HPE_OK = 0,
HPE_INTERNAL = 1,
HPE_STRICT = 2,
HPE_CR_EXPECTED = 25,
HPE_LF_EXPECTED = 3,
HPE_UNEXPECTED_CONTENT_LENGTH = 4,
HPE_UNEXPECTED_SPACE = 30,
HPE_CLOSED_CONNECTION = 5,
HPE_INVALID_METHOD = 6,
HPE_INVALID_URL = 7,
HPE_INVALID_CONSTANT = 8,
HPE_INVALID_VERSION = 9,
HPE_INVALID_HEADER_TOKEN = 10,
HPE_INVALID_CONTENT_LENGTH = 11,
HPE_INVALID_CHUNK_SIZE = 12,
HPE_INVALID_STATUS = 13,
HPE_INVALID_EOF_STATE = 14,
HPE_INVALID_TRANSFER_ENCODING = 15,
HPE_CB_MESSAGE_BEGIN = 16,
HPE_CB_HEADERS_COMPLETE = 17,
HPE_CB_MESSAGE_COMPLETE = 18,
HPE_CB_CHUNK_HEADER = 19,
HPE_CB_CHUNK_COMPLETE = 20,
HPE_PAUSED = 21,
HPE_PAUSED_UPGRADE = 22,
HPE_PAUSED_H2_UPGRADE = 23,
HPE_USER = 24,
HPE_CB_URL_COMPLETE = 26,
HPE_CB_STATUS_COMPLETE = 27,
HPE_CB_METHOD_COMPLETE = 32,
HPE_CB_VERSION_COMPLETE = 33,
HPE_CB_HEADER_FIELD_COMPLETE = 28,
HPE_CB_HEADER_VALUE_COMPLETE = 29,
HPE_CB_CHUNK_EXTENSION_NAME_COMPLETE = 34,
HPE_CB_CHUNK_EXTENSION_VALUE_COMPLETE = 35,
HPE_CB_RESET = 31
};
typedef enum llhttp_errno llhttp_errno_t;
enum llhttp_flags {
F_CONNECTION_KEEP_ALIVE = 0x1,
F_CONNECTION_CLOSE = 0x2,
F_CONNECTION_UPGRADE = 0x4,
F_CHUNKED = 0x8,
F_UPGRADE = 0x10,
F_CONTENT_LENGTH = 0x20,
F_SKIPBODY = 0x40,
F_TRAILING = 0x80,
F_TRANSFER_ENCODING = 0x200
};
typedef enum llhttp_flags llhttp_flags_t;
enum llhttp_lenient_flags {
LENIENT_HEADERS = 0x1,
LENIENT_CHUNKED_LENGTH = 0x2,
LENIENT_KEEP_ALIVE = 0x4,
LENIENT_TRANSFER_ENCODING = 0x8,
LENIENT_VERSION = 0x10,
LENIENT_DATA_AFTER_CLOSE = 0x20,
LENIENT_OPTIONAL_LF_AFTER_CR = 0x40,
LENIENT_OPTIONAL_CRLF_AFTER_CHUNK = 0x80,
LENIENT_OPTIONAL_CR_BEFORE_LF = 0x100,
LENIENT_SPACES_AFTER_CHUNK_SIZE = 0x200
};
typedef enum llhttp_lenient_flags llhttp_lenient_flags_t;
enum llhttp_type {
HTTP_BOTH = 0,
HTTP_REQUEST = 1,
HTTP_RESPONSE = 2
};
typedef enum llhttp_type llhttp_type_t;
enum llhttp_finish {
HTTP_FINISH_SAFE = 0,
HTTP_FINISH_SAFE_WITH_CB = 1,
HTTP_FINISH_UNSAFE = 2
};
typedef enum llhttp_finish llhttp_finish_t;
enum llhttp_method {
HTTP_DELETE = 0,
HTTP_GET = 1,
HTTP_HEAD = 2,
HTTP_POST = 3,
HTTP_PUT = 4,
HTTP_CONNECT = 5,
HTTP_OPTIONS = 6,
HTTP_TRACE = 7,
HTTP_COPY = 8,
HTTP_LOCK = 9,
HTTP_MKCOL = 10,
HTTP_MOVE = 11,
HTTP_PROPFIND = 12,
HTTP_PROPPATCH = 13,
HTTP_SEARCH = 14,
HTTP_UNLOCK = 15,
HTTP_BIND = 16,
HTTP_REBIND = 17,
HTTP_UNBIND = 18,
HTTP_ACL = 19,
HTTP_REPORT = 20,
HTTP_MKACTIVITY = 21,
HTTP_CHECKOUT = 22,
HTTP_MERGE = 23,
HTTP_MSEARCH = 24,
HTTP_NOTIFY = 25,
HTTP_SUBSCRIBE = 26,
HTTP_UNSUBSCRIBE = 27,
HTTP_PATCH = 28,
HTTP_PURGE = 29,
HTTP_MKCALENDAR = 30,
HTTP_LINK = 31,
HTTP_UNLINK = 32,
HTTP_SOURCE = 33,
HTTP_PRI = 34,
HTTP_DESCRIBE = 35,
HTTP_ANNOUNCE = 36,
HTTP_SETUP = 37,
HTTP_PLAY = 38,
HTTP_PAUSE = 39,
HTTP_TEARDOWN = 40,
HTTP_GET_PARAMETER = 41,
HTTP_SET_PARAMETER = 42,
HTTP_REDIRECT = 43,
HTTP_RECORD = 44,
HTTP_FLUSH = 45,
HTTP_QUERY = 46
};
typedef enum llhttp_method llhttp_method_t;
enum llhttp_status {
HTTP_STATUS_CONTINUE = 100,
HTTP_STATUS_SWITCHING_PROTOCOLS = 101,
HTTP_STATUS_PROCESSING = 102,
HTTP_STATUS_EARLY_HINTS = 103,
HTTP_STATUS_RESPONSE_IS_STALE = 110,
HTTP_STATUS_REVALIDATION_FAILED = 111,
HTTP_STATUS_DISCONNECTED_OPERATION = 112,
HTTP_STATUS_HEURISTIC_EXPIRATION = 113,
HTTP_STATUS_MISCELLANEOUS_WARNING = 199,
HTTP_STATUS_OK = 200,
HTTP_STATUS_CREATED = 201,
HTTP_STATUS_ACCEPTED = 202,
HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION = 203,
HTTP_STATUS_NO_CONTENT = 204,
HTTP_STATUS_RESET_CONTENT = 205,
HTTP_STATUS_PARTIAL_CONTENT = 206,
HTTP_STATUS_MULTI_STATUS = 207,
HTTP_STATUS_ALREADY_REPORTED = 208,
HTTP_STATUS_TRANSFORMATION_APPLIED = 214,
HTTP_STATUS_IM_USED = 226,
HTTP_STATUS_MISCELLANEOUS_PERSISTENT_WARNING = 299,
HTTP_STATUS_MULTIPLE_CHOICES = 300,
HTTP_STATUS_MOVED_PERMANENTLY = 301,
HTTP_STATUS_FOUND = 302,
HTTP_STATUS_SEE_OTHER = 303,
HTTP_STATUS_NOT_MODIFIED = 304,
HTTP_STATUS_USE_PROXY = 305,
HTTP_STATUS_SWITCH_PROXY = 306,
HTTP_STATUS_TEMPORARY_REDIRECT = 307,
HTTP_STATUS_PERMANENT_REDIRECT = 308,
HTTP_STATUS_BAD_REQUEST = 400,
HTTP_STATUS_UNAUTHORIZED = 401,
HTTP_STATUS_PAYMENT_REQUIRED = 402,
HTTP_STATUS_FORBIDDEN = 403,
HTTP_STATUS_NOT_FOUND = 404,
HTTP_STATUS_METHOD_NOT_ALLOWED = 405,
HTTP_STATUS_NOT_ACCEPTABLE = 406,
HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED = 407,
HTTP_STATUS_REQUEST_TIMEOUT = 408,
HTTP_STATUS_CONFLICT = 409,
HTTP_STATUS_GONE = 410,
HTTP_STATUS_LENGTH_REQUIRED = 411,
HTTP_STATUS_PRECONDITION_FAILED = 412,
HTTP_STATUS_PAYLOAD_TOO_LARGE = 413,
HTTP_STATUS_URI_TOO_LONG = 414,
HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE = 415,
HTTP_STATUS_RANGE_NOT_SATISFIABLE = 416,
HTTP_STATUS_EXPECTATION_FAILED = 417,
HTTP_STATUS_IM_A_TEAPOT = 418,
HTTP_STATUS_PAGE_EXPIRED = 419,
HTTP_STATUS_ENHANCE_YOUR_CALM = 420,
HTTP_STATUS_MISDIRECTED_REQUEST = 421,
HTTP_STATUS_UNPROCESSABLE_ENTITY = 422,
HTTP_STATUS_LOCKED = 423,
HTTP_STATUS_FAILED_DEPENDENCY = 424,
HTTP_STATUS_TOO_EARLY = 425,
HTTP_STATUS_UPGRADE_REQUIRED = 426,
HTTP_STATUS_PRECONDITION_REQUIRED = 428,
HTTP_STATUS_TOO_MANY_REQUESTS = 429,
HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL = 430,
HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
HTTP_STATUS_LOGIN_TIMEOUT = 440,
HTTP_STATUS_NO_RESPONSE = 444,
HTTP_STATUS_RETRY_WITH = 449,
HTTP_STATUS_BLOCKED_BY_PARENTAL_CONTROL = 450,
HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS = 451,
HTTP_STATUS_CLIENT_CLOSED_LOAD_BALANCED_REQUEST = 460,
HTTP_STATUS_INVALID_X_FORWARDED_FOR = 463,
HTTP_STATUS_REQUEST_HEADER_TOO_LARGE = 494,
HTTP_STATUS_SSL_CERTIFICATE_ERROR = 495,
HTTP_STATUS_SSL_CERTIFICATE_REQUIRED = 496,
HTTP_STATUS_HTTP_REQUEST_SENT_TO_HTTPS_PORT = 497,
HTTP_STATUS_INVALID_TOKEN = 498,
HTTP_STATUS_CLIENT_CLOSED_REQUEST = 499,
HTTP_STATUS_INTERNAL_SERVER_ERROR = 500,
HTTP_STATUS_NOT_IMPLEMENTED = 501,
HTTP_STATUS_BAD_GATEWAY = 502,
HTTP_STATUS_SERVICE_UNAVAILABLE = 503,
HTTP_STATUS_GATEWAY_TIMEOUT = 504,
HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED = 505,
HTTP_STATUS_VARIANT_ALSO_NEGOTIATES = 506,
HTTP_STATUS_INSUFFICIENT_STORAGE = 507,
HTTP_STATUS_LOOP_DETECTED = 508,
HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED = 509,
HTTP_STATUS_NOT_EXTENDED = 510,
HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED = 511,
HTTP_STATUS_WEB_SERVER_UNKNOWN_ERROR = 520,
HTTP_STATUS_WEB_SERVER_IS_DOWN = 521,
HTTP_STATUS_CONNECTION_TIMEOUT = 522,
HTTP_STATUS_ORIGIN_IS_UNREACHABLE = 523,
HTTP_STATUS_TIMEOUT_OCCURED = 524,
HTTP_STATUS_SSL_HANDSHAKE_FAILED = 525,
HTTP_STATUS_INVALID_SSL_CERTIFICATE = 526,
HTTP_STATUS_RAILGUN_ERROR = 527,
HTTP_STATUS_SITE_IS_OVERLOADED = 529,
HTTP_STATUS_SITE_IS_FROZEN = 530,
HTTP_STATUS_IDENTITY_PROVIDER_AUTHENTICATION_ERROR = 561,
HTTP_STATUS_NETWORK_READ_TIMEOUT = 598,
HTTP_STATUS_NETWORK_CONNECT_TIMEOUT = 599
};
typedef enum llhttp_status llhttp_status_t;
#define HTTP_ERRNO_MAP(XX) \
XX(0, OK, OK) \
XX(1, INTERNAL, INTERNAL) \
XX(2, STRICT, STRICT) \
XX(25, CR_EXPECTED, CR_EXPECTED) \
XX(3, LF_EXPECTED, LF_EXPECTED) \
XX(4, UNEXPECTED_CONTENT_LENGTH, UNEXPECTED_CONTENT_LENGTH) \
XX(30, UNEXPECTED_SPACE, UNEXPECTED_SPACE) \
XX(5, CLOSED_CONNECTION, CLOSED_CONNECTION) \
XX(6, INVALID_METHOD, INVALID_METHOD) \
XX(7, INVALID_URL, INVALID_URL) \
XX(8, INVALID_CONSTANT, INVALID_CONSTANT) \
XX(9, INVALID_VERSION, INVALID_VERSION) \
XX(10, INVALID_HEADER_TOKEN, INVALID_HEADER_TOKEN) \
XX(11, INVALID_CONTENT_LENGTH, INVALID_CONTENT_LENGTH) \
XX(12, INVALID_CHUNK_SIZE, INVALID_CHUNK_SIZE) \
XX(13, INVALID_STATUS, INVALID_STATUS) \
XX(14, INVALID_EOF_STATE, INVALID_EOF_STATE) \
XX(15, INVALID_TRANSFER_ENCODING, INVALID_TRANSFER_ENCODING) \
XX(16, CB_MESSAGE_BEGIN, CB_MESSAGE_BEGIN) \
XX(17, CB_HEADERS_COMPLETE, CB_HEADERS_COMPLETE) \
XX(18, CB_MESSAGE_COMPLETE, CB_MESSAGE_COMPLETE) \
XX(19, CB_CHUNK_HEADER, CB_CHUNK_HEADER) \
XX(20, CB_CHUNK_COMPLETE, CB_CHUNK_COMPLETE) \
XX(21, PAUSED, PAUSED) \
XX(22, PAUSED_UPGRADE, PAUSED_UPGRADE) \
XX(23, PAUSED_H2_UPGRADE, PAUSED_H2_UPGRADE) \
XX(24, USER, USER) \
XX(26, CB_URL_COMPLETE, CB_URL_COMPLETE) \
XX(27, CB_STATUS_COMPLETE, CB_STATUS_COMPLETE) \
XX(32, CB_METHOD_COMPLETE, CB_METHOD_COMPLETE) \
XX(33, CB_VERSION_COMPLETE, CB_VERSION_COMPLETE) \
XX(28, CB_HEADER_FIELD_COMPLETE, CB_HEADER_FIELD_COMPLETE) \
XX(29, CB_HEADER_VALUE_COMPLETE, CB_HEADER_VALUE_COMPLETE) \
XX(34, CB_CHUNK_EXTENSION_NAME_COMPLETE, CB_CHUNK_EXTENSION_NAME_COMPLETE) \
XX(35, CB_CHUNK_EXTENSION_VALUE_COMPLETE, CB_CHUNK_EXTENSION_VALUE_COMPLETE) \
XX(31, CB_RESET, CB_RESET) \
#define HTTP_METHOD_MAP(XX) \
XX(0, DELETE, DELETE) \
XX(1, GET, GET) \
XX(2, HEAD, HEAD) \
XX(3, POST, POST) \
XX(4, PUT, PUT) \
XX(5, CONNECT, CONNECT) \
XX(6, OPTIONS, OPTIONS) \
XX(7, TRACE, TRACE) \
XX(8, COPY, COPY) \
XX(9, LOCK, LOCK) \
XX(10, MKCOL, MKCOL) \
XX(11, MOVE, MOVE) \
XX(12, PROPFIND, PROPFIND) \
XX(13, PROPPATCH, PROPPATCH) \
XX(14, SEARCH, SEARCH) \
XX(15, UNLOCK, UNLOCK) \
XX(16, BIND, BIND) \
XX(17, REBIND, REBIND) \
XX(18, UNBIND, UNBIND) \
XX(19, ACL, ACL) \
XX(20, REPORT, REPORT) \
XX(21, MKACTIVITY, MKACTIVITY) \
XX(22, CHECKOUT, CHECKOUT) \
XX(23, MERGE, MERGE) \
XX(24, MSEARCH, M-SEARCH) \
XX(25, NOTIFY, NOTIFY) \
XX(26, SUBSCRIBE, SUBSCRIBE) \
XX(27, UNSUBSCRIBE, UNSUBSCRIBE) \
XX(28, PATCH, PATCH) \
XX(29, PURGE, PURGE) \
XX(30, MKCALENDAR, MKCALENDAR) \
XX(31, LINK, LINK) \
XX(32, UNLINK, UNLINK) \
XX(33, SOURCE, SOURCE) \
XX(46, QUERY, QUERY) \
#define RTSP_METHOD_MAP(XX) \
XX(1, GET, GET) \
XX(3, POST, POST) \
XX(6, OPTIONS, OPTIONS) \
XX(35, DESCRIBE, DESCRIBE) \
XX(36, ANNOUNCE, ANNOUNCE) \
XX(37, SETUP, SETUP) \
XX(38, PLAY, PLAY) \
XX(39, PAUSE, PAUSE) \
XX(40, TEARDOWN, TEARDOWN) \
XX(41, GET_PARAMETER, GET_PARAMETER) \
XX(42, SET_PARAMETER, SET_PARAMETER) \
XX(43, REDIRECT, REDIRECT) \
XX(44, RECORD, RECORD) \
XX(45, FLUSH, FLUSH) \
#define HTTP_ALL_METHOD_MAP(XX) \
XX(0, DELETE, DELETE) \
XX(1, GET, GET) \
XX(2, HEAD, HEAD) \
XX(3, POST, POST) \
XX(4, PUT, PUT) \
XX(5, CONNECT, CONNECT) \
XX(6, OPTIONS, OPTIONS) \
XX(7, TRACE, TRACE) \
XX(8, COPY, COPY) \
XX(9, LOCK, LOCK) \
XX(10, MKCOL, MKCOL) \
XX(11, MOVE, MOVE) \
XX(12, PROPFIND, PROPFIND) \
XX(13, PROPPATCH, PROPPATCH) \
XX(14, SEARCH, SEARCH) \
XX(15, UNLOCK, UNLOCK) \
XX(16, BIND, BIND) \
XX(17, REBIND, REBIND) \
XX(18, UNBIND, UNBIND) \
XX(19, ACL, ACL) \
XX(20, REPORT, REPORT) \
XX(21, MKACTIVITY, MKACTIVITY) \
XX(22, CHECKOUT, CHECKOUT) \
XX(23, MERGE, MERGE) \
XX(24, MSEARCH, M-SEARCH) \
XX(25, NOTIFY, NOTIFY) \
XX(26, SUBSCRIBE, SUBSCRIBE) \
XX(27, UNSUBSCRIBE, UNSUBSCRIBE) \
XX(28, PATCH, PATCH) \
XX(29, PURGE, PURGE) \
XX(30, MKCALENDAR, MKCALENDAR) \
XX(31, LINK, LINK) \
XX(32, UNLINK, UNLINK) \
XX(33, SOURCE, SOURCE) \
XX(34, PRI, PRI) \
XX(35, DESCRIBE, DESCRIBE) \
XX(36, ANNOUNCE, ANNOUNCE) \
XX(37, SETUP, SETUP) \
XX(38, PLAY, PLAY) \
XX(39, PAUSE, PAUSE) \
XX(40, TEARDOWN, TEARDOWN) \
XX(41, GET_PARAMETER, GET_PARAMETER) \
XX(42, SET_PARAMETER, SET_PARAMETER) \
XX(43, REDIRECT, REDIRECT) \
XX(44, RECORD, RECORD) \
XX(45, FLUSH, FLUSH) \
XX(46, QUERY, QUERY) \
#define HTTP_STATUS_MAP(XX) \
XX(100, CONTINUE, CONTINUE) \
XX(101, SWITCHING_PROTOCOLS, SWITCHING_PROTOCOLS) \
XX(102, PROCESSING, PROCESSING) \
XX(103, EARLY_HINTS, EARLY_HINTS) \
XX(110, RESPONSE_IS_STALE, RESPONSE_IS_STALE) \
XX(111, REVALIDATION_FAILED, REVALIDATION_FAILED) \
XX(112, DISCONNECTED_OPERATION, DISCONNECTED_OPERATION) \
XX(113, HEURISTIC_EXPIRATION, HEURISTIC_EXPIRATION) \
XX(199, MISCELLANEOUS_WARNING, MISCELLANEOUS_WARNING) \
XX(200, OK, OK) \
XX(201, CREATED, CREATED) \
XX(202, ACCEPTED, ACCEPTED) \
XX(203, NON_AUTHORITATIVE_INFORMATION, NON_AUTHORITATIVE_INFORMATION) \
XX(204, NO_CONTENT, NO_CONTENT) \
XX(205, RESET_CONTENT, RESET_CONTENT) \
XX(206, PARTIAL_CONTENT, PARTIAL_CONTENT) \
XX(207, MULTI_STATUS, MULTI_STATUS) \
XX(208, ALREADY_REPORTED, ALREADY_REPORTED) \
XX(214, TRANSFORMATION_APPLIED, TRANSFORMATION_APPLIED) \
XX(226, IM_USED, IM_USED) \
XX(299, MISCELLANEOUS_PERSISTENT_WARNING, MISCELLANEOUS_PERSISTENT_WARNING) \
XX(300, MULTIPLE_CHOICES, MULTIPLE_CHOICES) \
XX(301, MOVED_PERMANENTLY, MOVED_PERMANENTLY) \
XX(302, FOUND, FOUND) \
XX(303, SEE_OTHER, SEE_OTHER) \
XX(304, NOT_MODIFIED, NOT_MODIFIED) \
XX(305, USE_PROXY, USE_PROXY) \
XX(306, SWITCH_PROXY, SWITCH_PROXY) \
XX(307, TEMPORARY_REDIRECT, TEMPORARY_REDIRECT) \
XX(308, PERMANENT_REDIRECT, PERMANENT_REDIRECT) \
XX(400, BAD_REQUEST, BAD_REQUEST) \
XX(401, UNAUTHORIZED, UNAUTHORIZED) \
XX(402, PAYMENT_REQUIRED, PAYMENT_REQUIRED) \
XX(403, FORBIDDEN, FORBIDDEN) \
XX(404, NOT_FOUND, NOT_FOUND) \
XX(405, METHOD_NOT_ALLOWED, METHOD_NOT_ALLOWED) \
XX(406, NOT_ACCEPTABLE, NOT_ACCEPTABLE) \
XX(407, PROXY_AUTHENTICATION_REQUIRED, PROXY_AUTHENTICATION_REQUIRED) \
XX(408, REQUEST_TIMEOUT, REQUEST_TIMEOUT) \
XX(409, CONFLICT, CONFLICT) \
XX(410, GONE, GONE) \
XX(411, LENGTH_REQUIRED, LENGTH_REQUIRED) \
XX(412, PRECONDITION_FAILED, PRECONDITION_FAILED) \
XX(413, PAYLOAD_TOO_LARGE, PAYLOAD_TOO_LARGE) \
XX(414, URI_TOO_LONG, URI_TOO_LONG) \
XX(415, UNSUPPORTED_MEDIA_TYPE, UNSUPPORTED_MEDIA_TYPE) \
XX(416, RANGE_NOT_SATISFIABLE, RANGE_NOT_SATISFIABLE) \
XX(417, EXPECTATION_FAILED, EXPECTATION_FAILED) \
XX(418, IM_A_TEAPOT, IM_A_TEAPOT) \
XX(419, PAGE_EXPIRED, PAGE_EXPIRED) \
XX(420, ENHANCE_YOUR_CALM, ENHANCE_YOUR_CALM) \
XX(421, MISDIRECTED_REQUEST, MISDIRECTED_REQUEST) \
XX(422, UNPROCESSABLE_ENTITY, UNPROCESSABLE_ENTITY) \
XX(423, LOCKED, LOCKED) \
XX(424, FAILED_DEPENDENCY, FAILED_DEPENDENCY) \
XX(425, TOO_EARLY, TOO_EARLY) \
XX(426, UPGRADE_REQUIRED, UPGRADE_REQUIRED) \
XX(428, PRECONDITION_REQUIRED, PRECONDITION_REQUIRED) \
XX(429, TOO_MANY_REQUESTS, TOO_MANY_REQUESTS) \
XX(430, REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL, REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL) \
XX(431, REQUEST_HEADER_FIELDS_TOO_LARGE, REQUEST_HEADER_FIELDS_TOO_LARGE) \
XX(440, LOGIN_TIMEOUT, LOGIN_TIMEOUT) \
XX(444, NO_RESPONSE, NO_RESPONSE) \
XX(449, RETRY_WITH, RETRY_WITH) \
XX(450, BLOCKED_BY_PARENTAL_CONTROL, BLOCKED_BY_PARENTAL_CONTROL) \
XX(451, UNAVAILABLE_FOR_LEGAL_REASONS, UNAVAILABLE_FOR_LEGAL_REASONS) \
XX(460, CLIENT_CLOSED_LOAD_BALANCED_REQUEST, CLIENT_CLOSED_LOAD_BALANCED_REQUEST) \
XX(463, INVALID_X_FORWARDED_FOR, INVALID_X_FORWARDED_FOR) \
XX(494, REQUEST_HEADER_TOO_LARGE, REQUEST_HEADER_TOO_LARGE) \
XX(495, SSL_CERTIFICATE_ERROR, SSL_CERTIFICATE_ERROR) \
XX(496, SSL_CERTIFICATE_REQUIRED, SSL_CERTIFICATE_REQUIRED) \
XX(497, HTTP_REQUEST_SENT_TO_HTTPS_PORT, HTTP_REQUEST_SENT_TO_HTTPS_PORT) \
XX(498, INVALID_TOKEN, INVALID_TOKEN) \
XX(499, CLIENT_CLOSED_REQUEST, CLIENT_CLOSED_REQUEST) \
XX(500, INTERNAL_SERVER_ERROR, INTERNAL_SERVER_ERROR) \
XX(501, NOT_IMPLEMENTED, NOT_IMPLEMENTED) \
XX(502, BAD_GATEWAY, BAD_GATEWAY) \
XX(503, SERVICE_UNAVAILABLE, SERVICE_UNAVAILABLE) \
XX(504, GATEWAY_TIMEOUT, GATEWAY_TIMEOUT) \
XX(505, HTTP_VERSION_NOT_SUPPORTED, HTTP_VERSION_NOT_SUPPORTED) \
XX(506, VARIANT_ALSO_NEGOTIATES, VARIANT_ALSO_NEGOTIATES) \
XX(507, INSUFFICIENT_STORAGE, INSUFFICIENT_STORAGE) \
XX(508, LOOP_DETECTED, LOOP_DETECTED) \
XX(509, BANDWIDTH_LIMIT_EXCEEDED, BANDWIDTH_LIMIT_EXCEEDED) \
XX(510, NOT_EXTENDED, NOT_EXTENDED) \
XX(511, NETWORK_AUTHENTICATION_REQUIRED, NETWORK_AUTHENTICATION_REQUIRED) \
XX(520, WEB_SERVER_UNKNOWN_ERROR, WEB_SERVER_UNKNOWN_ERROR) \
XX(521, WEB_SERVER_IS_DOWN, WEB_SERVER_IS_DOWN) \
XX(522, CONNECTION_TIMEOUT, CONNECTION_TIMEOUT) \
XX(523, ORIGIN_IS_UNREACHABLE, ORIGIN_IS_UNREACHABLE) \
XX(524, TIMEOUT_OCCURED, TIMEOUT_OCCURED) \
XX(525, SSL_HANDSHAKE_FAILED, SSL_HANDSHAKE_FAILED) \
XX(526, INVALID_SSL_CERTIFICATE, INVALID_SSL_CERTIFICATE) \
XX(527, RAILGUN_ERROR, RAILGUN_ERROR) \
XX(529, SITE_IS_OVERLOADED, SITE_IS_OVERLOADED) \
XX(530, SITE_IS_FROZEN, SITE_IS_FROZEN) \
XX(561, IDENTITY_PROVIDER_AUTHENTICATION_ERROR, IDENTITY_PROVIDER_AUTHENTICATION_ERROR) \
XX(598, NETWORK_READ_TIMEOUT, NETWORK_READ_TIMEOUT) \
XX(599, NETWORK_CONNECT_TIMEOUT, NETWORK_CONNECT_TIMEOUT) \
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LLLLHTTP_C_HEADERS_ */
#ifndef INCLUDE_LLHTTP_API_H_
#define INCLUDE_LLHTTP_API_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#define LLHTTP_EXPORT
typedef llhttp__internal_t llhttp_t;
typedef struct llhttp_settings_s llhttp_settings_t;
typedef int (*llhttp_data_cb)(llhttp_t*, const char *at, size_t length);
typedef int (*llhttp_cb)(llhttp_t*);
struct llhttp_settings_s {
/* Possible return values 0, -1, `HPE_PAUSED` */
llhttp_cb on_message_begin;
/* Possible return values 0, -1, HPE_USER */
llhttp_data_cb on_url;
llhttp_data_cb on_status;
llhttp_data_cb on_method;
llhttp_data_cb on_version;
llhttp_data_cb on_header_field;
llhttp_data_cb on_header_value;
llhttp_data_cb on_chunk_extension_name;
llhttp_data_cb on_chunk_extension_value;
/* Possible return values:
* 0 - Proceed normally
* 1 - Assume that request/response has no body, and proceed to parsing the
* next message
* 2 - Assume absence of body (as above) and make `llhttp_execute()` return
* `HPE_PAUSED_UPGRADE`
* -1 - Error
* `HPE_PAUSED`
*/
llhttp_cb on_headers_complete;
/* Possible return values 0, -1, HPE_USER */
llhttp_data_cb on_body;
/* Possible return values 0, -1, `HPE_PAUSED` */
llhttp_cb on_message_complete;
llhttp_cb on_url_complete;
llhttp_cb on_status_complete;
llhttp_cb on_method_complete;
llhttp_cb on_version_complete;
llhttp_cb on_header_field_complete;
llhttp_cb on_header_value_complete;
llhttp_cb on_chunk_extension_name_complete;
llhttp_cb on_chunk_extension_value_complete;
/* When on_chunk_header is called, the current chunk length is stored
* in parser->content_length.
* Possible return values 0, -1, `HPE_PAUSED`
*/
llhttp_cb on_chunk_header;
llhttp_cb on_chunk_complete;
llhttp_cb on_reset;
};
/* Initialize the parser with specific type and user settings.
*
* NOTE: lifetime of `settings` has to be at least the same as the lifetime of
* the `parser` here. In practice, `settings` has to be either a static
* variable or be allocated with `malloc`, `new`, etc.
*/
LLHTTP_EXPORT
void llhttp_init(llhttp_t* parser, llhttp_type_t type,
const llhttp_settings_t* settings);
LLHTTP_EXPORT
llhttp_t* llhttp_alloc(llhttp_type_t type);
LLHTTP_EXPORT
void llhttp_free(llhttp_t* parser);
LLHTTP_EXPORT
uint8_t llhttp_get_type(llhttp_t* parser);
LLHTTP_EXPORT
uint8_t llhttp_get_http_major(llhttp_t* parser);
LLHTTP_EXPORT
uint8_t llhttp_get_http_minor(llhttp_t* parser);
LLHTTP_EXPORT
uint8_t llhttp_get_method(llhttp_t* parser);
LLHTTP_EXPORT
int llhttp_get_status_code(llhttp_t* parser);
LLHTTP_EXPORT
uint8_t llhttp_get_upgrade(llhttp_t* parser);
/* Reset an already initialized parser back to the start state, preserving the
* existing parser type, callback settings, user data, and lenient flags.
*/
LLHTTP_EXPORT
void llhttp_reset(llhttp_t* parser);
/* Initialize the settings object */
LLHTTP_EXPORT
void llhttp_settings_init(llhttp_settings_t* settings);
/* Parse full or partial request/response, invoking user callbacks along the
* way.
*
* If any of `llhttp_data_cb` returns errno not equal to `HPE_OK` - the parsing
* interrupts, and such errno is returned from `llhttp_execute()`. If
* `HPE_PAUSED` was used as a errno, the execution can be resumed with
* `llhttp_resume()` call.
*
* In a special case of CONNECT/Upgrade request/response `HPE_PAUSED_UPGRADE`
* is returned after fully parsing the request/response. If the user wishes to
* continue parsing, they need to invoke `llhttp_resume_after_upgrade()`.
*
* NOTE: if this function ever returns a non-pause type error, it will continue
* to return the same error upon each successive call up until `llhttp_init()`
* is called.
*/
LLHTTP_EXPORT
llhttp_errno_t llhttp_execute(llhttp_t* parser, const char* data, size_t len);
/* This method should be called when the other side has no further bytes to
* send (e.g. shutdown of readable side of the TCP connection.)
*
* Requests without `Content-Length` and other messages might require treating
* all incoming bytes as the part of the body, up to the last byte of the
* connection. This method will invoke `on_message_complete()` callback if the
* request was terminated safely. Otherwise a error code would be returned.
*/
LLHTTP_EXPORT
llhttp_errno_t llhttp_finish(llhttp_t* parser);
/* Returns `1` if the incoming message is parsed until the last byte, and has
* to be completed by calling `llhttp_finish()` on EOF
*/
LLHTTP_EXPORT
int llhttp_message_needs_eof(const llhttp_t* parser);
/* Returns `1` if there might be any other messages following the last that was
* successfully parsed.
*/
LLHTTP_EXPORT
int llhttp_should_keep_alive(const llhttp_t* parser);
/* Make further calls of `llhttp_execute()` return `HPE_PAUSED` and set
* appropriate error reason.
*
* Important: do not call this from user callbacks! User callbacks must return
* `HPE_PAUSED` if pausing is required.
*/
LLHTTP_EXPORT
void llhttp_pause(llhttp_t* parser);
/* Might be called to resume the execution after the pause in user's callback.
* See `llhttp_execute()` above for details.
*
* Call this only if `llhttp_execute()` returns `HPE_PAUSED`.
*/
LLHTTP_EXPORT
void llhttp_resume(llhttp_t* parser);
/* Might be called to resume the execution after the pause in user's callback.
* See `llhttp_execute()` above for details.
*
* Call this only if `llhttp_execute()` returns `HPE_PAUSED_UPGRADE`
*/
LLHTTP_EXPORT
void llhttp_resume_after_upgrade(llhttp_t* parser);
/* Returns the latest return error */
LLHTTP_EXPORT
llhttp_errno_t llhttp_get_errno(const llhttp_t* parser);
/* Returns the verbal explanation of the latest returned error.
*
* Note: User callback should set error reason when returning the error. See
* `llhttp_set_error_reason()` for details.
*/
LLHTTP_EXPORT
const char* llhttp_get_error_reason(const llhttp_t* parser);
/* Assign verbal description to the returned error. Must be called in user
* callbacks right before returning the errno.
*
* Note: `HPE_USER` error code might be useful in user callbacks.
*/
LLHTTP_EXPORT
void llhttp_set_error_reason(llhttp_t* parser, const char* reason);
/* Returns the pointer to the last parsed byte before the returned error. The
* pointer is relative to the `data` argument of `llhttp_execute()`.
*
* Note: this method might be useful for counting the number of parsed bytes.
*/
LLHTTP_EXPORT
const char* llhttp_get_error_pos(const llhttp_t* parser);
/* Returns textual name of error code */
LLHTTP_EXPORT
const char* llhttp_errno_name(llhttp_errno_t err);
/* Returns textual name of HTTP method */
LLHTTP_EXPORT
const char* llhttp_method_name(llhttp_method_t method);
/* Returns textual name of HTTP status */
LLHTTP_EXPORT
const char* llhttp_status_name(llhttp_status_t status);
/* Enables/disables lenient header value parsing (disabled by default).
*
* Lenient parsing disables header value token checks, extending llhttp's
* protocol support to highly non-compliant clients/server. No
* `HPE_INVALID_HEADER_TOKEN` will be raised for incorrect header values when
* lenient parsing is "on".
*
* **Enabling this flag can pose a security issue since you will be exposed to
* request smuggling attacks. USE WITH CAUTION!**
*/
LLHTTP_EXPORT
void llhttp_set_lenient_headers(llhttp_t* parser, int enabled);
/* Enables/disables lenient handling of conflicting `Transfer-Encoding` and
* `Content-Length` headers (disabled by default).
*
* Normally `llhttp` would error when `Transfer-Encoding` is present in
* conjunction with `Content-Length`. This error is important to prevent HTTP
* request smuggling, but may be less desirable for small number of cases
* involving legacy servers.
*
* **Enabling this flag can pose a security issue since you will be exposed to
* request smuggling attacks. USE WITH CAUTION!**
*/
LLHTTP_EXPORT
void llhttp_set_lenient_chunked_length(llhttp_t* parser, int enabled);
/* Enables/disables lenient handling of `Connection: close` and HTTP/1.0
* requests responses.
*
* Normally `llhttp` would error on (in strict mode) or discard (in loose mode)
* the HTTP request/response after the request/response with `Connection: close`
* and `Content-Length`. This is important to prevent cache poisoning attacks,
* but might interact badly with outdated and insecure clients. With this flag
* the extra request/response will be parsed normally.
*
* **Enabling this flag can pose a security issue since you will be exposed to
* poisoning attacks. USE WITH CAUTION!**
*/
LLHTTP_EXPORT
void llhttp_set_lenient_keep_alive(llhttp_t* parser, int enabled);
/* Enables/disables lenient handling of `Transfer-Encoding` header.
*
* Normally `llhttp` would error when a `Transfer-Encoding` has `chunked` value
* and another value after it (either in a single header or in multiple
* headers whose value are internally joined using `, `).
* This is mandated by the spec to reliably determine request body size and thus
* avoid request smuggling.
* With this flag the extra value will be parsed normally.
*
* **Enabling this flag can pose a security issue since you will be exposed to
* request smuggling attacks. USE WITH CAUTION!**
*/
LLHTTP_EXPORT
void llhttp_set_lenient_transfer_encoding(llhttp_t* parser, int enabled);
/* Enables/disables lenient handling of HTTP version.
*
* Normally `llhttp` would error when the HTTP version in the request or status line
* is not `0.9`, `1.0`, `1.1` or `2.0`.
* With this flag the invalid value will be parsed normally.
*
* **Enabling this flag can pose a security issue since you will allow unsupported
* HTTP versions. USE WITH CAUTION!**
*/
LLHTTP_EXPORT
void llhttp_set_lenient_version(llhttp_t* parser, int enabled);
/* Enables/disables lenient handling of additional data received after a message ends
* and keep-alive is disabled.
*
* Normally `llhttp` would error when additional unexpected data is received if the message
* contains the `Connection` header with `close` value.
* With this flag the extra data will discarded without throwing an error.
*
* **Enabling this flag can pose a security issue since you will be exposed to
* poisoning attacks. USE WITH CAUTION!**
*/
LLHTTP_EXPORT
void llhttp_set_lenient_data_after_close(llhttp_t* parser, int enabled);
/* Enables/disables lenient handling of incomplete CRLF sequences.
*
* Normally `llhttp` would error when a CR is not followed by LF when terminating the
* request line, the status line, the headers or a chunk header.
* With this flag only a CR is required to terminate such sections.
*
* **Enabling this flag can pose a security issue since you will be exposed to
* request smuggling attacks. USE WITH CAUTION!**
*/
LLHTTP_EXPORT
void llhttp_set_lenient_optional_lf_after_cr(llhttp_t* parser, int enabled);
/*
* Enables/disables lenient handling of line separators.
*
* Normally `llhttp` would error when a LF is not preceded by CR when terminating the
* request line, the status line, the headers, a chunk header or a chunk data.
* With this flag only a LF is required to terminate such sections.
*
* **Enabling this flag can pose a security issue since you will be exposed to
* request smuggling attacks. USE WITH CAUTION!**
*/
LLHTTP_EXPORT
void llhttp_set_lenient_optional_cr_before_lf(llhttp_t* parser, int enabled);
/* Enables/disables lenient handling of chunks not separated via CRLF.
*
* Normally `llhttp` would error when after a chunk data a CRLF is missing before
* starting a new chunk.
* With this flag the new chunk can start immediately after the previous one.
*
* **Enabling this flag can pose a security issue since you will be exposed to
* request smuggling attacks. USE WITH CAUTION!**
*/
LLHTTP_EXPORT
void llhttp_set_lenient_optional_crlf_after_chunk(llhttp_t* parser, int enabled);
/* Enables/disables lenient handling of spaces after chunk size.
*
* Normally `llhttp` would error when after a chunk size is followed by one or more
* spaces are present instead of a CRLF or `;`.
* With this flag this check is disabled.
*
* **Enabling this flag can pose a security issue since you will be exposed to
* request smuggling attacks. USE WITH CAUTION!**
*/
LLHTTP_EXPORT
void llhttp_set_lenient_spaces_after_chunk_size(llhttp_t* parser, int enabled);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* INCLUDE_LLHTTP_API_H_ */
#endif /* INCLUDE_LLHTTP_H_ */

4
deps/xdiff/xmerge.c vendored
View File

@ -88,7 +88,7 @@ static int xdl_cleanup_merge(xdmerge_t *c)
if (c->mode == 0) if (c->mode == 0)
count++; count++;
next_c = c->next; next_c = c->next;
free(c); xdl_free(c);
} }
return count; return count;
} }
@ -456,7 +456,7 @@ static void xdl_merge_two_conflicts(xdmerge_t *m)
m->chg1 = next_m->i1 + next_m->chg1 - m->i1; m->chg1 = next_m->i1 + next_m->chg1 - m->i1;
m->chg2 = next_m->i2 + next_m->chg2 - m->i2; m->chg2 = next_m->i2 + next_m->chg2 - m->i2;
m->next = next_m->next; m->next = next_m->next;
free(next_m); xdl_free(next_m);
} }
/* /*

View File

@ -1,42 +1,434 @@
v1.7.2 v1.8.2
------ ------
This release reverts a const-correctness change introduced in
v1.8.0 for the `git_commit_create` functions. We now retain the
const-behavior for the `commits` arguments from prior to v1.8.0.
This change was meant to resolve compatibility issues with bindings
and downstream users.
## What's Changed ## What's Changed
This release fixes three bugs that can cause undefined behavior when given well-crafted inputs, either in input files or over network connections. These bugs may be able to be leveraged to cause denial of service attacks or unauthorized code execution. ### New features
Two of these issues were discovered and reported by security engineers at Amazon Web Services. We thank the AWS Security team for their efforts to identify these issues, provide helpful reproduction cases, and responsibly disclose their findings. * Introduce a stricter debugging allocator for testing by @ethomson in https://github.com/libgit2/libgit2/pull/6811
### Security fixes
* transport: safely handle messages with no caps
* revparse: fix parsing bug for trailing `@`
* index: correct index has_dir_name check
**Full Changelog**: https://github.com/libgit2/libgit2/compare/v1.7.1...v1.7.2
v1.7.1
------
## What's Changed
### Bug fixes ### Bug fixes
* proxy: Return an error for invalid proxy URLs instead of crashing. by @lrm29 in https://github.com/libgit2/libgit2/pull/6597 * Fix constness issue introduced in #6716 by @ethomson in https://github.com/libgit2/libgit2/pull/6829
* ssh: fix known_hosts leak in _git_ssh_setup_conn by @steven9724 in https://github.com/libgit2/libgit2/pull/6599
* repository: make cleanup safe for re-use with grafts by @carlosmn in https://github.com/libgit2/libgit2/pull/6600
* fix: Add missing include for oidarray. by @dvzrv in https://github.com/libgit2/libgit2/pull/6608
* Revert "CMake: Search for ssh2 instead of libssh2." by @ethomson in https://github.com/libgit2/libgit2/pull/6619
### Compatibility improvements ### Build and CI improvements
* stransport: macOS: replace errSSLNetworkTimeout, with hard-coded value by @mascguy in https://github.com/libgit2/libgit2/pull/6610 * README: add experimental builds to ci table by @ethomson in https://github.com/libgit2/libgit2/pull/6816
**Full Changelog**: https://github.com/libgit2/libgit2/compare/v1.8.1...v1.8.2
v1.8.1
------
This release primarily includes straightforward bugfixes, as well as
new functionality to have more control over the HTTP User-Agent header.
However, there is an API change from v1.8 that was required for
improved compatibility.
In v1.8, libgit2 introduced the `report_unchanged ` member in the
`git_fetch_options` structure. We mistakenly introduced this as a
bitfield, which is not suitable for our public API. To correct this
mistake, we have _removed_ the `report_unchanged ` member. To support
the report unchanged tips option, users can set the `update_fetchhead`
member to include the `GIT_REMOTE_UPDATE_REPORT_UNCHANGED` value.
The libgit2 projects regrets the API change, but this was required to
support cross-platform compatibility.
## What's Changed
### New features
* Allow more control over the user-agent by @ethomson in
https://github.com/libgit2/libgit2/pull/6788
### Bug fixes
* commit: Fix git_commit_create_from_stage without author and
committer by @florianpircher in
https://github.com/libgit2/libgit2/pull/6781
* process.c: fix environ for macOS by @barracuda156 in
https://github.com/libgit2/libgit2/pull/6792
* Bounds check for pack index read by @ConradIrwin in
https://github.com/libgit2/libgit2/pull/6796
* transport: provide a useful error message during cancellation
by @ethomson in https://github.com/libgit2/libgit2/pull/6802
* transport: support sha256 oids by @ethomson in
https://github.com/libgit2/libgit2/pull/6803
* Revparse: Correctly accept ref with '@' at the end by @csware in
https://github.com/libgit2/libgit2/pull/6809
* remote: drop bitfields in git_remote_fetch_options by @ethomson in
https://github.com/libgit2/libgit2/pull/6806
* examples: fix memory leak in for-each-ref.c by @qaqland in
https://github.com/libgit2/libgit2/pull/6808
* xdiff: use proper free function by @ethomson in
https://github.com/libgit2/libgit2/pull/6810
* rand: avoid uninitialized loadavg warnings by @ethomson in
https://github.com/libgit2/libgit2/pull/6812
* cli: include alloca on illumos / solaris / sunos by @ethomson in
https://github.com/libgit2/libgit2/pull/6813
* Update git_array allocator to obey strict aliasing rules
by @ethomson in https://github.com/libgit2/libgit2/pull/6814
* tree: avoid mixed signedness comparison by @ethomson in
https://github.com/libgit2/libgit2/pull/6815
### Build and CI improvements
* ci: update nightly workflows by @ethomson in
https://github.com/libgit2/libgit2/pull/6773
* ci: give all nightly builds a unique id by @ethomson in
https://github.com/libgit2/libgit2/pull/6782
* cmake: remove workaround that isn't compatible with Windows on
ARM by @hackhaslam in https://github.com/libgit2/libgit2/pull/6794
### Documentation improvements
* Docs meta-updates by @ethomson in
https://github.com/libgit2/libgit2/pull/6787
### Dependency updates
* Enable llhttp for HTTP parsing by @sgallagher in
https://github.com/libgit2/libgit2/pull/6713
## New Contributors ## New Contributors
* @dvzrv made their first contribution in https://github.com/libgit2/libgit2/pull/6608
* @steven9724 made their first contribution in https://github.com/libgit2/libgit2/pull/6599
**Full Changelog**: https://github.com/libgit2/libgit2/compare/v1.7.0...v1.7.1 * @florianpircher made their first contribution in
https://github.com/libgit2/libgit2/pull/6781
* @barracuda156 made their first contribution in
https://github.com/libgit2/libgit2/pull/6792
* @sgallagher made their first contribution in
https://github.com/libgit2/libgit2/pull/6713
* @ConradIrwin made their first contribution in
https://github.com/libgit2/libgit2/pull/6796
* @qaqland made their first contribution in
https://github.com/libgit2/libgit2/pull/6808
**Full Changelog**: https://github.com/libgit2/libgit2/compare/v1.8.0...v1.8.1
v1.8
----
This is release v1.8.0, "Das Fliegende Klassenzimmer". This release
includes optional, experimental support for invoking OpenSSH to fetch
and push, an easier mechanism to perform the default behavior of
`git commit`, and has many improvements for worktrees. This release
also includes many other new features and bugfixes.
## Major changes
* **Executable SSH (OpenSSH) support**
libgit2 can now invoke the command-line OpenSSH to fetch from and push
to remotes over SSH. This support takes the place of libssh2 support.
To use it, configure libgit2 with `cmake -DUSE_SSH=exec`, and please
report any problems that you discover. By @ethomson in
https://github.com/libgit2/libgit2/pull/6617
* **Simplified commit creation**
The `git_commit_create_from_stage` API was introduced to allow users to
better emulate the behavior of `git commit` without needing to provide
unnecessary information. The current state of the index is committed to
the current branch. By @ethomson in
https://github.com/libgit2/libgit2/pull/6716
* **Worktree improvements**
A number of worktree improvements have been made for better
compatibility with core git. First, libgit2 now understands per-worktree
references, thanks to @csware in
https://github.com/libgit2/libgit2/pull/6387. Worktree-specific
configuration is now supported, thanks to @vermiculus in
https://github.com/libgit2/libgit2/pull/6202. And improved compatibility
with `git worktree add` is now supported, thanks to @herrerog in
https://github.com/libgit2/libgit2/pull/5319.
## Breaking changes
* **Adding `WORKTREE` configuration level** (ABI breaking change)
To support worktree configurations at the appropriate level (higher
priority than local configuration, but lower priority than app-specific
configuration), the `GIT_CONFIG_LEVEL_WORKTREE` level was introduced at
priority 6. `GIT_CONFIG_LEVEL_APP` now begins at priority 7.
* **Changes to `git_config_entry`** (ABI breaking change)
The `git_config_entry` structure now contains information about the
`backend_type` and `origin_path`. The unused `payload` value has been
removed.
* **`git_push_options` includes remote push options** (ABI breaking change)
The `git_push_options` structure now contains a value for remote push
options.
## Other changes
### New features
* config: provide an "origin" for config entries by @ethomson in
https://github.com/libgit2/libgit2/pull/6615
* cli: add a `git config` command by @ethomson in
https://github.com/libgit2/libgit2/pull/6616
* Add OpenSSH support by @ethomson in
https://github.com/libgit2/libgit2/pull/6617
* remote: optionally report unchanged tips by @ethomson in
https://github.com/libgit2/libgit2/pull/6645
* Support setting oid type for in-memory repositories by @kcsaul in
https://github.com/libgit2/libgit2/pull/6671
* cli: add `index-pack` command by @ethomson in
https://github.com/libgit2/libgit2/pull/6681
* Add `git_repository_commit_parents` to identify the parents of the next
commit given the repository state by @ethomson in
https://github.com/libgit2/libgit2/pull/6707
* commit: introduce `git_commit_create_from_stage` by @ethomson in
https://github.com/libgit2/libgit2/pull/6716
* set SSH timeout by @vafada in
https://github.com/libgit2/libgit2/pull/6721
* Implement push options on push by @russell in
https://github.com/libgit2/libgit2/pull/6439
* Support index.skipHash true config by @parnic in
https://github.com/libgit2/libgit2/pull/6738
* worktree: mimic 'git worktree add' behavior. by @herrerog in
https://github.com/libgit2/libgit2/pull/5319
* Support the extension for worktree-specific config by @vermiculus in
https://github.com/libgit2/libgit2/pull/6202
* Separate config reader and writer backend priorities (for worktree
configs) by @ethomson in https://github.com/libgit2/libgit2/pull/6756
* fetch: enable deepening/shortening shallow clones by @kempniu in
https://github.com/libgit2/libgit2/pull/6662
### Bug fixes
* repository: make cleanup safe for re-use with grafts by @carlosmn in
https://github.com/libgit2/libgit2/pull/6600
* fix: Add missing include for `oidarray`. by @dvzrv in
https://github.com/libgit2/libgit2/pull/6608
* ssh: fix `known_hosts` leak in `_git_ssh_setup_conn` by @steven9724 in
https://github.com/libgit2/libgit2/pull/6599
* proxy: Return an error for invalid proxy URLs instead of crashing by
@lrm29 in https://github.com/libgit2/libgit2/pull/6597
* errors: refactoring - never return `NULL` in `git_error_last()` by
@ethomson in https://github.com/libgit2/libgit2/pull/6625
* Reject potential option injections over ssh by @carlosmn in
https://github.com/libgit2/libgit2/pull/6636
* remote: fix memory leak in `git_remote_download()` by @7Ji in
https://github.com/libgit2/libgit2/pull/6651
* git2: Fix crash when called w/o parameters by @csware in
https://github.com/libgit2/libgit2/pull/6673
* Avoid macro redefinition of `ENABLE_INTSAFE_SIGNED_FUNCTIONS` by @csware
in https://github.com/libgit2/libgit2/pull/6666
* util: suppress some uninitialized variable warnings by @boretrk in
https://github.com/libgit2/libgit2/pull/6659
* push: set generic error in `push_negotiation` cb by @ethomson in
https://github.com/libgit2/libgit2/pull/6675
* process: test `/usr/bin/false` on BSDs by @ethomson in
https://github.com/libgit2/libgit2/pull/6677
* clone: don't mix up "http://url" with "http:/url" when figuring out if we
should do a local clone by @boretrk in
https://github.com/libgit2/libgit2/pull/6361
* Several compatibility fixes by @ethomson in
https://github.com/libgit2/libgit2/pull/6678
* Git blame buffer gives the wrong result in many cases where there are
by @thosey in https://github.com/libgit2/libgit2/pull/6572
* Fix 'path cannot exist in repository' during diff for in-memory repository
by @kcsaul in https://github.com/libgit2/libgit2/pull/6683
* process: don't try to close the status by @ethomson in
https://github.com/libgit2/libgit2/pull/6693
* Minor bug fixes by @ethomson in
https://github.com/libgit2/libgit2/pull/6695
* Bypass shallow clone support for in-memory repositories by @kcsaul in
https://github.com/libgit2/libgit2/pull/6684
* examples: use `unsigned` int for bitfields by @ethomson in
https://github.com/libgit2/libgit2/pull/6699
* Fix some bugs caught by UBscan by @ethomson in
https://github.com/libgit2/libgit2/pull/6700
* `git_diff_find_similar` doesn't always remove unmodified deltas by @yori
in https://github.com/libgit2/libgit2/pull/6642
* httpclient: clear `client->parser.data` after use by @ethomson in
https://github.com/libgit2/libgit2/pull/6705
* Do not normalize `safe.directory` paths by @csware in
https://github.com/libgit2/libgit2/pull/6668
* clone: don't swallow error in `should_checkout` by @ethomson in
https://github.com/libgit2/libgit2/pull/6727
* Correct index add directory/file conflict detection by @ethomson in
https://github.com/libgit2/libgit2/pull/6729
* Correct `git_revparse_single` and add revparse fuzzing by @ethomson in
https://github.com/libgit2/libgit2/pull/6730
* config: properly delete or rename section containing multivars by
@samueltardieu in https://github.com/libgit2/libgit2/pull/6723
* revparse: ensure bare '@' is truly bare by @ethomson in
https://github.com/libgit2/libgit2/pull/6742
* repo: ensure we can initialize win32 paths by @ethomson in
https://github.com/libgit2/libgit2/pull/6743
* Swap `GIT_DIFF_LINE_(ADD|DEL)_EOFNL` to match other Diffs by @xphoniex in
https://github.com/libgit2/libgit2/pull/6240
* diff: fix test for SHA256 support in `diff_from_buffer` by @ethomson in
https://github.com/libgit2/libgit2/pull/6745
* http: support empty http.proxy config setting by @ethomson in
https://github.com/libgit2/libgit2/pull/6744
* More `safe.directory` improvements by @ethomson in
https://github.com/libgit2/libgit2/pull/6739
* Ensure that completely ignored diff is empty by @ethomson in
https://github.com/libgit2/libgit2/pull/5893
* Fix broken regexp that matches submodule names containing ".path" by
@csware in https://github.com/libgit2/libgit2/pull/6749
* Fix memory leaks by @csware in
https://github.com/libgit2/libgit2/pull/6748
* Make `refdb_fs` (hopefully) fully aware of per worktree refs by @csware in
https://github.com/libgit2/libgit2/pull/6387
* fix log example by @albfan in https://github.com/libgit2/libgit2/pull/6359
* fetch: fail on depth for local transport by @ethomson in
https://github.com/libgit2/libgit2/pull/6757
* Fix message trailer parsing by @ethomson in
https://github.com/libgit2/libgit2/pull/6761
* config: correct fetching the `HIGHEST_LEVEL` config by @ethomson in
https://github.com/libgit2/libgit2/pull/6766
* Avoid some API breaking changes in v1.8 by @ethomson in
https://github.com/libgit2/libgit2/pull/6768
### Build and CI improvements
* meta: update version numbers to v1.8 by @ethomson in
https://github.com/libgit2/libgit2/pull/6596
* Revert "CMake: Search for ssh2 instead of libssh2." by @ethomson in
https://github.com/libgit2/libgit2/pull/6619
* cmake: fix openssl build on win32 by @lazka in
https://github.com/libgit2/libgit2/pull/6626
* ci: retry flaky online tests by @ethomson in
https://github.com/libgit2/libgit2/pull/6628
* ci: update to macOS 12 by @ethomson in
https://github.com/libgit2/libgit2/pull/6629
* Use `#!/bin/bash` for script with bash-specific commands by @roehling in
https://github.com/libgit2/libgit2/pull/6581
* ci: overwrite nonsense in `/usr/local` during macOS setup by @ethomson in
https://github.com/libgit2/libgit2/pull/6664
* release: add a compatibility label by @ethomson in
https://github.com/libgit2/libgit2/pull/6676
* actions: set permissions by @ethomson in
https://github.com/libgit2/libgit2/pull/6680
* cmake: rename FindIconv to avoid collision with cmake by @ethomson in
https://github.com/libgit2/libgit2/pull/6682
* ci: allow workflows to read and write packages by @ethomson in
https://github.com/libgit2/libgit2/pull/6687
* ci: allow workflows to push changes by @ethomson in
https://github.com/libgit2/libgit2/pull/6688
* tests: remove test for strcasecmp by @boretrk in
https://github.com/libgit2/libgit2/pull/6691
* CI fixes by @ethomson in
https://github.com/libgit2/libgit2/pull/6694
* ci: improvements to prepare for Cygwin support by @ethomson in
https://github.com/libgit2/libgit2/pull/6696
* Yet more CI improvements by @ethomson in
https://github.com/libgit2/libgit2/pull/6697
* Fix nightly builds by @ethomson in
https://github.com/libgit2/libgit2/pull/6709
* Benchmarks: add a site to view results by @ethomson in
https://github.com/libgit2/libgit2/pull/6715
* `GIT_RAND_GETENTROPY`: do not include `sys/random.h` by @semarie in
https://github.com/libgit2/libgit2/pull/6736
* add dl to `LIBGIT2_SYSTEM_LIBS` by @christopherfujino in
https://github.com/libgit2/libgit2/pull/6631
* meta: add dependency tag to release.yml by @ethomson in
https://github.com/libgit2/libgit2/pull/6740
* CI: fix our nightlies by @ethomson in
https://github.com/libgit2/libgit2/pull/6751
* trace: Re-enable tests as tracing is now enabled by default by @lrm29 in
https://github.com/libgit2/libgit2/pull/6752
* tests: don't free an unininitialized repo by @ethomson in
https://github.com/libgit2/libgit2/pull/6763
* ci: reduce ASLR randomization for TSAN by @ethomson in
https://github.com/libgit2/libgit2/pull/6764
* packbuilder: adjust nondeterministic tests by @ethomson in
https://github.com/libgit2/libgit2/pull/6762
* Allow libgit2 to be compiled with mbedtls3. by @adamharrison in
https://github.com/libgit2/libgit2/pull/6759
* build: update to latest actions versions by @ethomson in
https://github.com/libgit2/libgit2/pull/6765
* ctype: cast characters to unsigned when classifying characters by
@boretrk in https://github.com/libgit2/libgit2/pull/6679 and
@ethomson in https://github.com/libgit2/libgit2/pull/6770
* valgrind: suppress OpenSSL warnings by @ethomson in https://github.com/libgit2/libgit2/pull/6769
### Documentation improvements
* README.md: Fix link to conan packages by @lrm29 in
https://github.com/libgit2/libgit2/pull/6621
* README: replace gmaster with GitButler by @ethomson in
https://github.com/libgit2/libgit2/pull/6692
* blame example: Fix support for line range in CLI by @wetneb in
https://github.com/libgit2/libgit2/pull/6638
* Support authentication in push example by @pluehne in
https://github.com/libgit2/libgit2/pull/5904
* docs: fix mistake in attr.h by @DavHau in
https://github.com/libgit2/libgit2/pull/6714
* Fix broken links by @csware in
https://github.com/libgit2/libgit2/pull/6747
### Platform compatibility fixes
* stransport: macOS: replace `errSSLNetworkTimeout`, with hard-coded
value by @mascguy in https://github.com/libgit2/libgit2/pull/6610
### Git compatibility fixes
* Do not trim dots from usernames by @georgthegreat in
https://github.com/libgit2/libgit2/pull/6657
* merge: fix incorrect rename detection for empty files by @herrerog in
https://github.com/libgit2/libgit2/pull/6717
### Dependency updates
* zlib: upgrade bundled zlib to v1.3 by @ethomson in
https://github.com/libgit2/libgit2/pull/6698
* ntlmclient: update to latest upstream ntlmclient by @ethomson in
https://github.com/libgit2/libgit2/pull/6704
## New Contributors
* @dvzrv made their first contribution in
https://github.com/libgit2/libgit2/pull/6608
* @mascguy made their first contribution in
https://github.com/libgit2/libgit2/pull/6610
* @steven9724 made their first contribution in
https://github.com/libgit2/libgit2/pull/6599
* @lazka made their first contribution in
https://github.com/libgit2/libgit2/pull/6626
* @roehling made their first contribution in
https://github.com/libgit2/libgit2/pull/6581
* @7Ji made their first contribution in
https://github.com/libgit2/libgit2/pull/6651
* @kempniu made their first contribution in
https://github.com/libgit2/libgit2/pull/6662
* @thosey made their first contribution in
https://github.com/libgit2/libgit2/pull/6572
* @wetneb made their first contribution in
https://github.com/libgit2/libgit2/pull/6638
* @yori made their first contribution in
https://github.com/libgit2/libgit2/pull/6642
* @pluehne made their first contribution in
https://github.com/libgit2/libgit2/pull/5904
* @DavHau made their first contribution in
https://github.com/libgit2/libgit2/pull/6714
* @vafada made their first contribution in
https://github.com/libgit2/libgit2/pull/6721
* @semarie made their first contribution in
https://github.com/libgit2/libgit2/pull/6736
* @christopherfujino made their first contribution in
https://github.com/libgit2/libgit2/pull/6631
* @parnic made their first contribution in
https://github.com/libgit2/libgit2/pull/6738
* @samueltardieu made their first contribution in
https://github.com/libgit2/libgit2/pull/6723
* @xphoniex made their first contribution in
https://github.com/libgit2/libgit2/pull/6240
* @adamharrison made their first contribution in
https://github.com/libgit2/libgit2/pull/6759
**Full Changelog**: https://github.com/libgit2/libgit2/compare/v1.7.0...v1.8.0
v1.7 v1.7
---- ----

View File

@ -15,8 +15,8 @@ so there are no restrictions on their use.
For annotated HTML versions, see the "Examples" section of: For annotated HTML versions, see the "Examples" section of:
http://libgit2.github.com/libgit2 https://libgit2.org/libgit2
such as: such as:
http://libgit2.github.com/libgit2/ex/HEAD/general.html https://libgit2.org/libgit2/ex/HEAD/general.html

View File

@ -8,7 +8,7 @@ struct args_info {
int argc; int argc;
char **argv; char **argv;
int pos; int pos;
int opts_done : 1; /**< Did we see a -- separator */ unsigned int opts_done : 1; /**< Did we see a -- separator */
}; };
#define ARGS_INFO_INIT { argc, argv, 0, 0 } #define ARGS_INFO_INIT { argc, argv, 0, 0 }
#define ARGS_CURRENT(args) args->argv[args->pos] #define ARGS_CURRENT(args) args->argv[args->pos]

View File

@ -47,6 +47,10 @@ int lg2_blame(git_repository *repo, int argc, char *argv[])
if (o.M) blameopts.flags |= GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES; if (o.M) blameopts.flags |= GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES;
if (o.C) blameopts.flags |= GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES; if (o.C) blameopts.flags |= GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES;
if (o.F) blameopts.flags |= GIT_BLAME_FIRST_PARENT; if (o.F) blameopts.flags |= GIT_BLAME_FIRST_PARENT;
if (o.start_line && o.end_line) {
blameopts.min_line = o.start_line;
blameopts.max_line = o.end_line;
}
/** /**
* The commit range comes in "committish" form. Use the rev-parse API to * The commit range comes in "committish" form. Use the rev-parse API to

View File

@ -35,9 +35,9 @@
*/ */
typedef struct { typedef struct {
int force : 1; unsigned int force : 1;
int progress : 1; unsigned int progress : 1;
int perf : 1; unsigned int perf : 1;
} checkout_options; } checkout_options;
static void print_usage(void) static void print_usage(void)

View File

@ -25,6 +25,8 @@ static int show_ref(git_reference *ref, void *data)
git_object_type2string(git_object_type(obj)), git_object_type2string(git_object_type(obj)),
git_reference_name(ref)); git_reference_name(ref));
git_object_free(obj);
git_reference_free(ref);
if (resolved) if (resolved)
git_reference_free(resolved); git_reference_free(resolved);
return 0; return 0;

View File

@ -31,8 +31,8 @@
* Git Internals that you will need to know to work with Git at this level, * Git Internals that you will need to know to work with Git at this level,
* check out [Chapter 10][pg] of the Pro Git book. * check out [Chapter 10][pg] of the Pro Git book.
* *
* [lg]: http://libgit2.github.com * [lg]: https://libgit2.org
* [ap]: http://libgit2.github.com/libgit2 * [ap]: https://libgit2.org/libgit2
* [pg]: https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain * [pg]: https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain
*/ */
@ -97,7 +97,7 @@ int lg2_general(git_repository *repo, int argc, char** argv)
* *
* (Try running this program against tests/resources/testrepo.git.) * (Try running this program against tests/resources/testrepo.git.)
* *
* [me]: http://libgit2.github.com/libgit2/#HEAD/group/repository * [me]: https://libgit2.org/libgit2/#HEAD/group/repository
*/ */
repo_path = (argc > 1) ? argv[1] : "/opt/libgit2-test/.git"; repo_path = (argc > 1) ? argv[1] : "/opt/libgit2-test/.git";
@ -173,7 +173,7 @@ static void oid_parsing(git_oid *oid)
* working with raw objects, we'll need to get this structure from the * working with raw objects, we'll need to get this structure from the
* repository. * repository.
* *
* [odb]: http://libgit2.github.com/libgit2/#HEAD/group/odb * [odb]: https://libgit2.org/libgit2/#HEAD/group/odb
*/ */
static void object_database(git_repository *repo, git_oid *oid) static void object_database(git_repository *repo, git_oid *oid)
{ {
@ -262,7 +262,7 @@ static void object_database(git_repository *repo, git_oid *oid)
* of them here. You can read about the other ones in the [commit API * of them here. You can read about the other ones in the [commit API
* docs][cd]. * docs][cd].
* *
* [cd]: http://libgit2.github.com/libgit2/#HEAD/group/commit * [cd]: https://libgit2.org/libgit2/#HEAD/group/commit
*/ */
static void commit_writing(git_repository *repo) static void commit_writing(git_repository *repo)
{ {
@ -347,7 +347,7 @@ static void commit_writing(git_repository *repo)
* data in the commit - the author (name, email, datetime), committer * data in the commit - the author (name, email, datetime), committer
* (same), tree, message, encoding and parent(s). * (same), tree, message, encoding and parent(s).
* *
* [pco]: http://libgit2.github.com/libgit2/#HEAD/group/commit * [pco]: https://libgit2.org/libgit2/#HEAD/group/commit
*/ */
static void commit_parsing(git_repository *repo) static void commit_parsing(git_repository *repo)
{ {
@ -418,7 +418,7 @@ static void commit_parsing(git_repository *repo)
* functions very similarly to the commit lookup, parsing and creation * functions very similarly to the commit lookup, parsing and creation
* methods, since the objects themselves are very similar. * methods, since the objects themselves are very similar.
* *
* [tm]: http://libgit2.github.com/libgit2/#HEAD/group/tag * [tm]: https://libgit2.org/libgit2/#HEAD/group/tag
*/ */
static void tag_parsing(git_repository *repo) static void tag_parsing(git_repository *repo)
{ {
@ -472,7 +472,7 @@ static void tag_parsing(git_repository *repo)
* object type in Git, but a useful structure for parsing and traversing * object type in Git, but a useful structure for parsing and traversing
* tree entries. * tree entries.
* *
* [tp]: http://libgit2.github.com/libgit2/#HEAD/group/tree * [tp]: https://libgit2.org/libgit2/#HEAD/group/tree
*/ */
static void tree_parsing(git_repository *repo) static void tree_parsing(git_repository *repo)
{ {
@ -536,7 +536,7 @@ static void tree_parsing(git_repository *repo)
* from disk and writing it to the db and getting the oid back so you * from disk and writing it to the db and getting the oid back so you
* don't have to do all those steps yourself. * don't have to do all those steps yourself.
* *
* [ba]: http://libgit2.github.com/libgit2/#HEAD/group/blob * [ba]: https://libgit2.org/libgit2/#HEAD/group/blob
*/ */
static void blob_parsing(git_repository *repo) static void blob_parsing(git_repository *repo)
{ {
@ -578,7 +578,7 @@ static void blob_parsing(git_repository *repo)
* that were ancestors of (reachable from) a given starting point. This * that were ancestors of (reachable from) a given starting point. This
* can allow you to create `git log` type functionality. * can allow you to create `git log` type functionality.
* *
* [rw]: http://libgit2.github.com/libgit2/#HEAD/group/revwalk * [rw]: https://libgit2.org/libgit2/#HEAD/group/revwalk
*/ */
static void revwalking(git_repository *repo) static void revwalking(git_repository *repo)
{ {
@ -643,7 +643,7 @@ static void revwalking(git_repository *repo)
* The [index file API][gi] allows you to read, traverse, update and write * The [index file API][gi] allows you to read, traverse, update and write
* the Git index file (sometimes thought of as the staging area). * the Git index file (sometimes thought of as the staging area).
* *
* [gi]: http://libgit2.github.com/libgit2/#HEAD/group/index * [gi]: https://libgit2.org/libgit2/#HEAD/group/index
*/ */
static void index_walking(git_repository *repo) static void index_walking(git_repository *repo)
{ {
@ -687,7 +687,7 @@ static void index_walking(git_repository *repo)
* references such as branches, tags and remote references (everything in * references such as branches, tags and remote references (everything in
* the .git/refs directory). * the .git/refs directory).
* *
* [ref]: http://libgit2.github.com/libgit2/#HEAD/group/reference * [ref]: https://libgit2.org/libgit2/#HEAD/group/reference
*/ */
static void reference_listing(git_repository *repo) static void reference_listing(git_repository *repo)
{ {
@ -740,7 +740,7 @@ static void reference_listing(git_repository *repo)
* The [config API][config] allows you to list and update config values * The [config API][config] allows you to list and update config values
* in any of the accessible config file locations (system, global, local). * in any of the accessible config file locations (system, global, local).
* *
* [config]: http://libgit2.github.com/libgit2/#HEAD/group/config * [config]: https://libgit2.org/libgit2/#HEAD/group/config
*/ */
static void config_files(const char *repo_path, git_repository* repo) static void config_files(const char *repo_path, git_repository* repo)
{ {

View File

@ -50,6 +50,7 @@ static int add_revision(struct log_state *s, const char *revstr);
/** log_options holds other command line options that affect log output */ /** log_options holds other command line options that affect log output */
struct log_options { struct log_options {
int show_diff; int show_diff;
int show_oneline;
int show_log_size; int show_log_size;
int skip, limit; int skip, limit;
int min_parents, max_parents; int min_parents, max_parents;
@ -81,9 +82,11 @@ int lg2_log(git_repository *repo, int argc, char *argv[])
git_commit *commit = NULL; git_commit *commit = NULL;
git_pathspec *ps = NULL; git_pathspec *ps = NULL;
memset(&s, 0, sizeof(s));
/** Parse arguments and set up revwalker. */ /** Parse arguments and set up revwalker. */
last_arg = parse_options(&s, &opt, argc, argv);
s.repo = repo; s.repo = repo;
last_arg = parse_options(&s, &opt, argc, argv);
diffopts.pathspec.strings = &argv[last_arg]; diffopts.pathspec.strings = &argv[last_arg];
diffopts.pathspec.count = argc - last_arg; diffopts.pathspec.count = argc - last_arg;
@ -335,34 +338,45 @@ static void print_commit(git_commit *commit, struct log_options *opts)
const char *scan, *eol; const char *scan, *eol;
git_oid_tostr(buf, sizeof(buf), git_commit_id(commit)); git_oid_tostr(buf, sizeof(buf), git_commit_id(commit));
printf("commit %s\n", buf);
if (opts->show_log_size) { if (opts->show_oneline) {
printf("log size %d\n", (int)strlen(git_commit_message(commit))); printf("%s ", buf);
} } else {
printf("commit %s\n", buf);
if ((count = (int)git_commit_parentcount(commit)) > 1) { if (opts->show_log_size) {
printf("Merge:"); printf("log size %d\n", (int)strlen(git_commit_message(commit)));
for (i = 0; i < count; ++i) { }
git_oid_tostr(buf, 8, git_commit_parent_id(commit, i));
printf(" %s", buf); if ((count = (int)git_commit_parentcount(commit)) > 1) {
printf("Merge:");
for (i = 0; i < count; ++i) {
git_oid_tostr(buf, 8, git_commit_parent_id(commit, i));
printf(" %s", buf);
}
printf("\n");
}
if ((sig = git_commit_author(commit)) != NULL) {
printf("Author: %s <%s>\n", sig->name, sig->email);
print_time(&sig->when, "Date: ");
} }
printf("\n"); printf("\n");
} }
if ((sig = git_commit_author(commit)) != NULL) {
printf("Author: %s <%s>\n", sig->name, sig->email);
print_time(&sig->when, "Date: ");
}
printf("\n");
for (scan = git_commit_message(commit); scan && *scan; ) { for (scan = git_commit_message(commit); scan && *scan; ) {
for (eol = scan; *eol && *eol != '\n'; ++eol) /* find eol */; for (eol = scan; *eol && *eol != '\n'; ++eol) /* find eol */;
printf(" %.*s\n", (int)(eol - scan), scan); if (opts->show_oneline)
printf("%.*s\n", (int)(eol - scan), scan);
else
printf(" %.*s\n", (int)(eol - scan), scan);
scan = *eol ? eol + 1 : NULL; scan = *eol ? eol + 1 : NULL;
if (opts->show_oneline)
break;
} }
printf("\n"); if (!opts->show_oneline)
printf("\n");
} }
/** Helper to find how many files in a commit changed from its nth parent. */ /** Helper to find how many files in a commit changed from its nth parent. */
@ -407,8 +421,6 @@ static int parse_options(
struct log_state *s, struct log_options *opt, int argc, char **argv) struct log_state *s, struct log_options *opt, int argc, char **argv)
{ {
struct args_info args = ARGS_INFO_INIT; struct args_info args = ARGS_INFO_INIT;
memset(s, 0, sizeof(*s));
s->sorting = GIT_SORT_TIME; s->sorting = GIT_SORT_TIME;
memset(opt, 0, sizeof(*opt)); memset(opt, 0, sizeof(*opt));
@ -424,7 +436,7 @@ static int parse_options(
else else
/** Try failed revision parse as filename. */ /** Try failed revision parse as filename. */
break; break;
} else if (!match_arg_separator(&args)) { } else if (match_arg_separator(&args)) {
break; break;
} }
else if (!strcmp(a, "--date-order")) else if (!strcmp(a, "--date-order"))
@ -474,6 +486,8 @@ static int parse_options(
opt->show_diff = 1; opt->show_diff = 1;
else if (!strcmp(a, "--log-size")) else if (!strcmp(a, "--log-size"))
opt->show_log_size = 1; opt->show_log_size = 1;
else if (!strcmp(a, "--oneline"))
opt->show_oneline = 1;
else else
usage("Unsupported argument", a); usage("Unsupported argument", a);
} }

View File

@ -30,7 +30,7 @@ struct merge_options {
git_annotated_commit **annotated; git_annotated_commit **annotated;
size_t annotated_count; size_t annotated_count;
int no_commit : 1; unsigned int no_commit : 1;
}; };
static void print_usage(void) static void print_usage(void)

View File

@ -32,6 +32,7 @@
/** Entry point for this command */ /** Entry point for this command */
int lg2_push(git_repository *repo, int argc, char **argv) { int lg2_push(git_repository *repo, int argc, char **argv) {
git_push_options options; git_push_options options;
git_remote_callbacks callbacks;
git_remote* remote = NULL; git_remote* remote = NULL;
char *refspec = "refs/heads/master"; char *refspec = "refs/heads/master";
const git_strarray refspecs = { const git_strarray refspecs = {
@ -47,7 +48,11 @@ int lg2_push(git_repository *repo, int argc, char **argv) {
check_lg2(git_remote_lookup(&remote, repo, "origin" ), "Unable to lookup remote", NULL); check_lg2(git_remote_lookup(&remote, repo, "origin" ), "Unable to lookup remote", NULL);
check_lg2(git_remote_init_callbacks(&callbacks, GIT_REMOTE_CALLBACKS_VERSION), "Error initializing remote callbacks", NULL);
callbacks.credentials = cred_acquire_cb;
check_lg2(git_push_options_init(&options, GIT_PUSH_OPTIONS_VERSION ), "Error initializing push", NULL); check_lg2(git_push_options_init(&options, GIT_PUSH_OPTIONS_VERSION ), "Error initializing push", NULL);
options.callbacks = callbacks;
check_lg2(git_remote_push(remote, &refspecs, &options), "Error pushing", NULL); check_lg2(git_remote_push(remote, &refspecs, &options), "Error pushing", NULL);

View File

@ -12,10 +12,13 @@ foreach(fuzz_target_src ${SRC_FUZZERS})
string(REPLACE ".c" "" fuzz_target_name ${fuzz_target_src}) string(REPLACE ".c" "" fuzz_target_name ${fuzz_target_src})
string(REPLACE "_fuzzer" "" fuzz_name ${fuzz_target_name}) string(REPLACE "_fuzzer" "" fuzz_name ${fuzz_target_name})
set(${fuzz_target_name}_SOURCES ${fuzz_target_src} ${LIBGIT2_OBJECTS}) set(${fuzz_target_name}_SOURCES
${fuzz_target_src} "fuzzer_utils.c" ${LIBGIT2_OBJECTS})
if(USE_STANDALONE_FUZZERS) if(USE_STANDALONE_FUZZERS)
list(APPEND ${fuzz_target_name}_SOURCES "standalone_driver.c") list(APPEND ${fuzz_target_name}_SOURCES "standalone_driver.c")
endif() endif()
add_executable(${fuzz_target_name} ${${fuzz_target_name}_SOURCES}) add_executable(${fuzz_target_name} ${${fuzz_target_name}_SOURCES})
set_target_properties(${fuzz_target_name} PROPERTIES C_STANDARD 90) set_target_properties(${fuzz_target_name} PROPERTIES C_STANDARD 90)

View File

@ -43,7 +43,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
goto out; goto out;
} }
if ((err = git_config_backend_from_string(&backend, (const char*)data, size)) != 0) { if ((err = git_config_backend_from_string(&backend, (const char*)data, size, NULL)) != 0) {
goto out; goto out;
} }
if ((err = git_config_add_backend(cfg, backend, 0, NULL, 0)) != 0) { if ((err = git_config_add_backend(cfg, backend, 0, NULL, 0)) != 0) {

View File

@ -0,0 +1 @@
HEAD

View File

@ -0,0 +1 @@
xxxxxxxxxxxxxxxx@

View File

@ -16,6 +16,7 @@
#include "futils.h" #include "futils.h"
#include "standalone_driver.h" #include "standalone_driver.h"
#include "fuzzer_utils.h"
#define UNUSED(x) (void)(x) #define UNUSED(x) (void)(x)
@ -157,33 +158,10 @@ static int fuzzer_transport_cb(git_transport **out, git_remote *owner, void *par
return git_transport_smart(out, owner, &def); return git_transport_smart(out, owner, &def);
} }
static void fuzzer_git_abort(const char *op)
{
const git_error *err = git_error_last();
fprintf(stderr, "unexpected libgit error: %s: %s\n",
op, err ? err->message : "<none>");
abort();
}
int LLVMFuzzerInitialize(int *argc, char ***argv) int LLVMFuzzerInitialize(int *argc, char ***argv)
{ {
#if defined(_WIN32) UNUSED(argc);
char tmpdir[MAX_PATH], path[MAX_PATH]; UNUSED(argv);
if (GetTempPath((DWORD)sizeof(tmpdir), tmpdir) == 0)
abort();
if (GetTempFileName(tmpdir, "lg2", 1, path) == 0)
abort();
if (git_futils_mkdir(path, 0700, 0) < 0)
abort();
#else
char path[] = "/tmp/git2.XXXXXX";
if (mkdtemp(path) != path)
abort();
#endif
if (git_libgit2_init() < 0) if (git_libgit2_init() < 0)
abort(); abort();
@ -191,12 +169,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv)
if (git_libgit2_opts(GIT_OPT_SET_PACK_MAX_OBJECTS, 10000000) < 0) if (git_libgit2_opts(GIT_OPT_SET_PACK_MAX_OBJECTS, 10000000) < 0)
abort(); abort();
UNUSED(argc); repo = fuzzer_repo_init();
UNUSED(argv);
if (git_repository_init(&repo, path, 1) < 0)
fuzzer_git_abort("git_repository_init");
return 0; return 0;
} }

51
fuzzers/fuzzer_utils.c Normal file
View File

@ -0,0 +1,51 @@
/*
* 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.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "git2.h"
#include "futils.h"
#include "fuzzer_utils.h"
void fuzzer_git_abort(const char *op)
{
const git_error *err = git_error_last();
fprintf(stderr, "unexpected libgit error: %s: %s\n",
op, err ? err->message : "<none>");
abort();
}
git_repository *fuzzer_repo_init(void)
{
git_repository *repo;
#if defined(_WIN32)
char tmpdir[MAX_PATH], path[MAX_PATH];
if (GetTempPath((DWORD)sizeof(tmpdir), tmpdir) == 0)
abort();
if (GetTempFileName(tmpdir, "lg2", 1, path) == 0)
abort();
if (git_futils_mkdir(path, 0700, 0) < 0)
abort();
#else
char path[] = "/tmp/git2.XXXXXX";
if (mkdtemp(path) != path)
abort();
#endif
if (git_repository_init(&repo, path, 1) < 0)
fuzzer_git_abort("git_repository_init");
return repo;
}

View File

@ -4,11 +4,11 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with * This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file. * a Linking Exception. For full terms see the included COPYING file.
*/ */
#ifndef INCLUDE_transports_ssh_h__
#define INCLUDE_transports_ssh_h__
#include "common.h" #ifndef INCLUDE_fuzzer_utils_h__
#define INCLUDE_fuzzer_utils_h__
int git_transport_ssh_global_init(void); extern void fuzzer_git_abort(const char *op);
extern git_repository *fuzzer_repo_init(void);
#endif #endif

52
fuzzers/revparse_fuzzer.c Normal file
View File

@ -0,0 +1,52 @@
/*
* libgit2 revparse fuzzer target.
*
* 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.
*/
#include <stdio.h>
#include <string.h>
#include "git2.h"
#include "standalone_driver.h"
#include "fuzzer_utils.h"
#define UNUSED(x) (void)(x)
static git_repository *repo;
int LLVMFuzzerInitialize(int *argc, char ***argv)
{
UNUSED(argc);
UNUSED(argv);
if (git_libgit2_init() < 0)
abort();
if (git_libgit2_opts(GIT_OPT_SET_PACK_MAX_OBJECTS, 10000000) < 0)
abort();
repo = fuzzer_repo_init();
return 0;
}
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
git_object *obj = NULL;
char *c;
if ((c = calloc(1, size + 1)) == NULL)
abort();
memcpy(c, data, size);
git_revparse_single(&obj, repo, c);
git_object_free(obj);
free(c);
return 0;
}

View File

@ -116,14 +116,12 @@ GIT_EXTERN(git_attr_value_t) git_attr_value(const char *attr);
*/ */
#define GIT_ATTR_CHECK_FILE_THEN_INDEX 0 #define GIT_ATTR_CHECK_FILE_THEN_INDEX 0
#define GIT_ATTR_CHECK_INDEX_THEN_FILE 1 #define GIT_ATTR_CHECK_INDEX_THEN_FILE 1
#define GIT_ATTR_CHECK_INDEX_ONLY 2 #define GIT_ATTR_CHECK_INDEX_ONLY 2
/** /**
* Check attribute flags: controlling extended attribute behavior. * Check attribute flags: controlling extended attribute behavior.
* *
* Normally, attribute checks include looking in the /etc (or system * Normally, attribute checks include looking in the /etc (or system
* equivalent) directory for a `gitattributes` file. Passing this
* flag will cause attribute checks to ignore that file.
* equivalent) directory for a `gitattributes` file. Passing the * equivalent) directory for a `gitattributes` file. Passing the
* `GIT_ATTR_CHECK_NO_SYSTEM` flag will cause attribute checks to * `GIT_ATTR_CHECK_NO_SYSTEM` flag will cause attribute checks to
* ignore that file. * ignore that file.

View File

@ -394,6 +394,49 @@ GIT_EXTERN(int) git_commit_create_v(
size_t parent_count, size_t parent_count,
...); ...);
typedef struct {
unsigned int version;
/**
* Flags for creating the commit.
*
* If `allow_empty_commit` is specified, a commit with no changes
* from the prior commit (and "empty" commit) is allowed. Otherwise,
* commit creation will be stopped.
*/
unsigned int allow_empty_commit : 1;
/** The commit author, or NULL for the default. */
const git_signature *author;
/** The committer, or NULL for the default. */
const git_signature *committer;
/** Encoding for the commit message; leave NULL for default. */
const char *message_encoding;
} git_commit_create_options;
#define GIT_COMMIT_CREATE_OPTIONS_VERSION 1
#define GIT_COMMIT_CREATE_OPTIONS_INIT { GIT_COMMIT_CREATE_OPTIONS_VERSION }
/**
* Commits the staged changes in the repository; this is a near analog to
* `git commit -m message`.
*
* By default, empty commits are not allowed.
*
* @param id pointer to store the new commit's object id
* @param repo repository to commit changes in
* @param message the commit message
* @param opts options for creating the commit
* @return 0 on success, GIT_EUNCHANGED if there were no changes to commit, or an error code
*/
GIT_EXTERN(int) git_commit_create_from_stage(
git_oid *id,
git_repository *repo,
const char *message,
const git_commit_create_options *opts);
/** /**
* Amend an existing commit by replacing only non-NULL values. * Amend an existing commit by replacing only non-NULL values.
* *
@ -541,6 +584,24 @@ typedef int (*git_commit_create_cb)(
const git_commit *parents[], const git_commit *parents[],
void *payload); void *payload);
/** An array of commits returned from the library */
typedef struct git_commitarray {
git_commit *const *commits;
size_t count;
} git_commitarray;
/**
* Free the commits contained in a commit array. This method should
* be called on `git_commitarray` objects that were provided by the
* library. Not doing so will result in a memory leak.
*
* This does not free the `git_commitarray` itself, since the library
* will never allocate that object directly itself.
*
* @param array The git_commitarray that contains commits to free
*/
GIT_EXTERN(void) git_commitarray_dispose(git_commitarray *array);
/** @} */ /** @} */
GIT_END_DECL GIT_END_DECL
#endif #endif

View File

@ -228,7 +228,9 @@ typedef enum {
GIT_OPT_SET_SERVER_CONNECT_TIMEOUT, GIT_OPT_SET_SERVER_CONNECT_TIMEOUT,
GIT_OPT_GET_SERVER_CONNECT_TIMEOUT, GIT_OPT_GET_SERVER_CONNECT_TIMEOUT,
GIT_OPT_SET_SERVER_TIMEOUT, GIT_OPT_SET_SERVER_TIMEOUT,
GIT_OPT_GET_SERVER_TIMEOUT GIT_OPT_GET_SERVER_TIMEOUT,
GIT_OPT_SET_USER_AGENT_PRODUCT,
GIT_OPT_GET_USER_AGENT_PRODUCT
} git_libgit2_opt_t; } git_libgit2_opt_t;
/** /**
@ -337,11 +339,35 @@ typedef enum {
* *
* * opts(GIT_OPT_SET_USER_AGENT, const char *user_agent) * * opts(GIT_OPT_SET_USER_AGENT, const char *user_agent)
* *
* > Set the value of the User-Agent header. This value will be * > Set the value of the comment section of the User-Agent header.
* > appended to "git/1.0", for compatibility with other git clients. * > This can be information about your product and its version.
* > By default this is "libgit2" followed by the libgit2 version.
* > * >
* > - `user_agent` is the value that will be delivered as the * > This value will be appended to User-Agent _product_, which
* > User-Agent header on HTTP requests. * > is typically set to "git/2.0".
* >
* > Set to the empty string ("") to not send any information in the
* > comment section, or set to NULL to restore the default.
*
* * opts(GIT_OPT_GET_USER_AGENT, git_buf *out)
*
* > Get the value of the User-Agent header.
* > The User-Agent is written to the `out` buffer.
*
* * opts(GIT_OPT_SET_USER_AGENT_PRODUCT, const char *user_agent_product)
*
* > Set the value of the product portion of the User-Agent header.
* > This defaults to "git/2.0", for compatibility with other git
* > clients. It is recommended to keep this as git/<version> for
* > compatibility with servers that do user-agent detection.
* >
* > Set to the empty string ("") to not send any user-agent string,
* > or set to NULL to restore the default.
*
* * opts(GIT_OPT_GET_USER_AGENT_PRODUCT, git_buf *out)
*
* > Get the value of the User-Agent product header.
* > The User-Agent product is written to the `out` buffer.
* *
* * opts(GIT_OPT_SET_WINDOWS_SHAREMODE, unsigned long value) * * opts(GIT_OPT_SET_WINDOWS_SHAREMODE, unsigned long value)
* *
@ -377,11 +403,6 @@ typedef enum {
* > * >
* > - `ciphers` is the list of ciphers that are eanbled. * > - `ciphers` is the list of ciphers that are eanbled.
* *
* * opts(GIT_OPT_GET_USER_AGENT, git_buf *out)
*
* > Get the value of the User-Agent header.
* > The User-Agent is written to the `out` buffer.
*
* * opts(GIT_OPT_ENABLE_OFS_DELTA, int enabled) * * opts(GIT_OPT_ENABLE_OFS_DELTA, int enabled)
* *
* > Enable or disable the use of "offset deltas" when creating packfiles, * > Enable or disable the use of "offset deltas" when creating packfiles,
@ -490,10 +511,9 @@ typedef enum {
* *
* opts(GIT_OPT_SET_SERVER_CONNECT_TIMEOUT, int timeout) * opts(GIT_OPT_SET_SERVER_CONNECT_TIMEOUT, int timeout)
* > Sets the timeout (in milliseconds) to attempt connections to * > Sets the timeout (in milliseconds) to attempt connections to
* > a remote server. This is supported only for HTTP(S) connections * > a remote server. Set to 0 to use the system default. Note that
* > and is not supported by SSH. Set to 0 to use the system default. * > this may not be able to be configured longer than the system
* > Note that this may not be able to be configured longer than the * > default, typically 75 seconds.
* > system default, typically 75 seconds.
* *
* opts(GIT_OPT_GET_SERVER_TIMEOUT, int *timeout) * opts(GIT_OPT_GET_SERVER_TIMEOUT, int *timeout)
* > Gets the timeout (in milliseconds) for reading from and writing * > Gets the timeout (in milliseconds) for reading from and writing
@ -501,9 +521,7 @@ typedef enum {
* *
* opts(GIT_OPT_SET_SERVER_TIMEOUT, int timeout) * opts(GIT_OPT_SET_SERVER_TIMEOUT, int timeout)
* > Sets the timeout (in milliseconds) for reading from and writing * > Sets the timeout (in milliseconds) for reading from and writing
* > to a remote server. This is supported only for HTTP(S) * > to a remote server. Set to 0 to use the system default.
* > connections and is not supported by SSH. Set to 0 to use the
* > system default.
* *
* @param option Option key * @param option Option key
* @param ... value to set the option * @param ... value to set the option

View File

@ -22,8 +22,19 @@ GIT_BEGIN_DECL
/** /**
* Priority level of a config file. * Priority level of a config file.
*
* These priority levels correspond to the natural escalation logic * These priority levels correspond to the natural escalation logic
* (from higher to lower) when searching for config entries in git.git. * (from higher to lower) when reading or searching for config entries
* in git.git. Meaning that for the same key, the configuration in
* the local configuration is preferred over the configuration in
* the system configuration file.
*
* Callers can add their own custom configuration, beginning at the
* `GIT_CONFIG_LEVEL_APP` level.
*
* Writes, by default, occur in the highest priority level backend
* that is writable. This ordering can be overridden with
* `git_config_set_writeorder`.
* *
* git_config_open_default() and git_repository_config() honor those * git_config_open_default() and git_repository_config() honor those
* priority levels as well. * priority levels as well.
@ -48,9 +59,13 @@ typedef enum {
*/ */
GIT_CONFIG_LEVEL_LOCAL = 5, GIT_CONFIG_LEVEL_LOCAL = 5,
/** Worktree specific configuration file; $GIT_DIR/config.worktree
*/
GIT_CONFIG_LEVEL_WORKTREE = 6,
/** Application specific configuration file; freely defined by applications /** Application specific configuration file; freely defined by applications
*/ */
GIT_CONFIG_LEVEL_APP = 6, GIT_CONFIG_LEVEL_APP = 7,
/** Represents the highest level available config file (i.e. the most /** Represents the highest level available config file (i.e. the most
* specific config file available that actually is loaded) * specific config file available that actually is loaded)
@ -62,12 +77,32 @@ typedef enum {
* An entry in a configuration file * An entry in a configuration file
*/ */
typedef struct git_config_entry { typedef struct git_config_entry {
const char *name; /**< Name of the entry (normalised) */ /** Name of the configuration entry (normalized) */
const char *value; /**< String value of the entry */ const char *name;
unsigned int include_depth; /**< Depth of includes where this variable was found */
git_config_level_t level; /**< Which config file this was found in */ /** Literal (string) value of the entry */
void GIT_CALLBACK(free)(struct git_config_entry *entry); /**< Free function for this entry */ const char *value;
void *payload; /**< Opaque value for the free function. Do not read or write */
/** The type of backend that this entry exists in (eg, "file") */
const char *backend_type;
/**
* The path to the origin of this entry. For config files, this is
* the path to the file.
*/
const char *origin_path;
/** Depth of includes where this variable was found */
unsigned int include_depth;
/** Configuration level for the file this was found in */
git_config_level_t level;
/**
* Free function for this entry; for internal purposes. Callers
* should call `git_config_entry_free` to free data.
*/
void GIT_CALLBACK(free)(struct git_config_entry *entry);
} git_config_entry; } git_config_entry;
/** /**
@ -276,6 +311,11 @@ GIT_EXTERN(int) git_config_open_level(
*/ */
GIT_EXTERN(int) git_config_open_global(git_config **out, git_config *config); GIT_EXTERN(int) git_config_open_global(git_config **out, git_config *config);
GIT_EXTERN(int) git_config_set_writeorder(
git_config *cfg,
git_config_level_t *levels,
size_t len);
/** /**
* Create a snapshot of the configuration * Create a snapshot of the configuration
* *

View File

@ -8,6 +8,7 @@
#define INCLUDE_git_email_h__ #define INCLUDE_git_email_h__
#include "common.h" #include "common.h"
#include "diff.h"
/** /**
* @file git2/email.h * @file git2/email.h

View File

@ -19,20 +19,20 @@ GIT_BEGIN_DECL
/** Generic return codes */ /** Generic return codes */
typedef enum { typedef enum {
GIT_OK = 0, /**< No error */ GIT_OK = 0, /**< No error */
GIT_ERROR = -1, /**< Generic error */ GIT_ERROR = -1, /**< Generic error */
GIT_ENOTFOUND = -3, /**< Requested object could not be found */ GIT_ENOTFOUND = -3, /**< Requested object could not be found */
GIT_EEXISTS = -4, /**< Object exists preventing operation */ GIT_EEXISTS = -4, /**< Object exists preventing operation */
GIT_EAMBIGUOUS = -5, /**< More than one object matches */ GIT_EAMBIGUOUS = -5, /**< More than one object matches */
GIT_EBUFS = -6, /**< Output buffer too short to hold data */ GIT_EBUFS = -6, /**< Output buffer too short to hold data */
/** /**
* GIT_EUSER is a special error that is never generated by libgit2 * 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) * 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. * to know that it was generated by the callback and not by libgit2.
*/ */
GIT_EUSER = -7, GIT_EUSER = -7,
GIT_EBAREREPO = -8, /**< Operation not allowed on bare repository */ GIT_EBAREREPO = -8, /**< Operation not allowed on bare repository */
GIT_EUNBORNBRANCH = -9, /**< HEAD refers to branch with no commits */ GIT_EUNBORNBRANCH = -9, /**< HEAD refers to branch with no commits */
@ -59,7 +59,10 @@ typedef enum {
GIT_EINDEXDIRTY = -34, /**< Unsaved changes in the index would be overwritten */ GIT_EINDEXDIRTY = -34, /**< Unsaved changes in the index would be overwritten */
GIT_EAPPLYFAIL = -35, /**< Patch application failed */ GIT_EAPPLYFAIL = -35, /**< Patch application failed */
GIT_EOWNER = -36, /**< The object is not owned by the current user */ GIT_EOWNER = -36, /**< The object is not owned by the current user */
GIT_TIMEOUT = -37 /**< The operation timed out */ GIT_TIMEOUT = -37, /**< The operation timed out */
GIT_EUNCHANGED = -38, /**< There were no changes */
GIT_ENOTSUPPORTED = -39, /**< An option is not supported */
GIT_EREADONLY = -40 /**< The subject is read-only */
} git_error_code; } git_error_code;
/** /**
@ -118,64 +121,23 @@ typedef enum {
* Return the last `git_error` object that was generated for the * Return the last `git_error` object that was generated for the
* current thread. * current thread.
* *
* The default behaviour of this function is to return NULL if no previous error has occurred. * This function will never return NULL.
* However, libgit2's error strings are not cleared aggressively, so a prior *
* (unrelated) error may be returned. This can be avoided by only calling * Callers should not rely on this to determine whether an error has
* this function if the prior call to a libgit2 API returned an error. * occurred. For error checking, callers should examine the return
* codes of libgit2 functions.
*
* This call can only reliably report error messages when an error
* has occurred. (It may contain stale information if it is called
* after a different function that succeeds.)
*
* The memory for this object is managed by libgit2. It should not
* be freed.
* *
* @return A git_error object. * @return A git_error object.
*/ */
GIT_EXTERN(const git_error *) git_error_last(void); 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, using `printf`-style
* formatting.
*
* 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 fmt The `printf`-style format string; subsequent arguments must
* be the arguments for the format string.
*/
GIT_EXTERN(void) git_error_set(int error_class, const char *fmt, ...)
GIT_FORMAT_PRINTF(2, 3);
/**
* Set the error message string for this thread. This function is like
* `git_error_set` but takes a static string instead of a `printf`-style
* format.
*
* @param error_class One of the `git_error_t` enum above describing the
* general subsystem that is responsible for the error.
* @param string The 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 GIT_END_DECL
#endif #endif

View File

@ -58,7 +58,7 @@ GIT_EXTERN(const char *) git_refspec_dst(const git_refspec *refspec);
* Get the refspec's string * Get the refspec's string
* *
* @param refspec the refspec * @param refspec the refspec
* @returns the refspec's original string * @return the refspec's original string
*/ */
GIT_EXTERN(const char *) git_refspec_string(const git_refspec *refspec); GIT_EXTERN(const char *) git_refspec_string(const git_refspec *refspec);

View File

@ -76,6 +76,17 @@ typedef enum {
GIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC = (1 << 1) GIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC = (1 << 1)
} git_remote_create_flags; } git_remote_create_flags;
/**
* How to handle reference updates.
*/
typedef enum {
/* Write the fetch results to FETCH_HEAD. */
GIT_REMOTE_UPDATE_FETCHHEAD = (1 << 0),
/* Report unchanged tips in the update_tips callback. */
GIT_REMOTE_UPDATE_REPORT_UNCHANGED = (1 << 1)
} git_remote_update_flags;
/** /**
* Remote creation options structure * Remote creation options structure
* *
@ -733,10 +744,9 @@ typedef struct {
git_fetch_prune_t prune; git_fetch_prune_t prune;
/** /**
* Whether to write the results to FETCH_HEAD. Defaults to * How to handle reference updates; see `git_remote_update_flags`.
* on. Leave this default in order to behave like git.
*/ */
int update_fetchhead; unsigned int update_fetchhead;
/** /**
* Determines how to behave regarding tags on the remote, such * Determines how to behave regarding tags on the remote, such
@ -775,8 +785,13 @@ typedef struct {
} git_fetch_options; } git_fetch_options;
#define GIT_FETCH_OPTIONS_VERSION 1 #define GIT_FETCH_OPTIONS_VERSION 1
#define GIT_FETCH_OPTIONS_INIT { GIT_FETCH_OPTIONS_VERSION, GIT_REMOTE_CALLBACKS_INIT, GIT_FETCH_PRUNE_UNSPECIFIED, 1, \ #define GIT_FETCH_OPTIONS_INIT { \
GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED, GIT_PROXY_OPTIONS_INIT } GIT_FETCH_OPTIONS_VERSION, \
GIT_REMOTE_CALLBACKS_INIT, \
GIT_FETCH_PRUNE_UNSPECIFIED, \
GIT_REMOTE_UPDATE_FETCHHEAD, \
GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED, \
GIT_PROXY_OPTIONS_INIT }
/** /**
* Initialize git_fetch_options structure * Initialize git_fetch_options structure
@ -830,6 +845,11 @@ typedef struct {
* Extra headers for this push operation * Extra headers for this push operation
*/ */
git_strarray custom_headers; git_strarray custom_headers;
/**
* "Push options" to deliver to the remote.
*/
git_strarray remote_push_options;
} git_push_options; } git_push_options;
#define GIT_PUSH_OPTIONS_VERSION 1 #define GIT_PUSH_OPTIONS_VERSION 1
@ -1001,7 +1021,7 @@ GIT_EXTERN(int) git_remote_upload(
* the name of the remote (or its url, for in-memory remotes). This * the name of the remote (or its url, for in-memory remotes). This
* parameter is ignored when pushing. * parameter is ignored when pushing.
* @param callbacks pointer to the callback structure to use or NULL * @param callbacks pointer to the callback structure to use or NULL
* @param update_fetchhead whether to write to FETCH_HEAD. Pass 1 to behave like git. * @param update_flags the git_remote_update_flags for these tips.
* @param download_tags what the behaviour for downloading tags is for this fetch. This is * @param download_tags what the behaviour for downloading tags is for this fetch. This is
* ignored for push. This must be the same value passed to `git_remote_download()`. * ignored for push. This must be the same value passed to `git_remote_download()`.
* @return 0 or an error code * @return 0 or an error code
@ -1009,7 +1029,7 @@ GIT_EXTERN(int) git_remote_upload(
GIT_EXTERN(int) git_remote_update_tips( GIT_EXTERN(int) git_remote_update_tips(
git_remote *remote, git_remote *remote,
const git_remote_callbacks *callbacks, const git_remote_callbacks *callbacks,
int update_fetchhead, unsigned int update_flags,
git_remote_autotag_option_t download_tags, git_remote_autotag_option_t download_tags,
const char *reflog_message); const char *reflog_message);

View File

@ -11,6 +11,7 @@
#include "types.h" #include "types.h"
#include "oid.h" #include "oid.h"
#include "buffer.h" #include "buffer.h"
#include "commit.h"
/** /**
* @file git2/repository.h * @file git2/repository.h
@ -503,6 +504,7 @@ typedef enum {
GIT_REPOSITORY_ITEM_LOGS, GIT_REPOSITORY_ITEM_LOGS,
GIT_REPOSITORY_ITEM_MODULES, GIT_REPOSITORY_ITEM_MODULES,
GIT_REPOSITORY_ITEM_WORKTREES, GIT_REPOSITORY_ITEM_WORKTREES,
GIT_REPOSITORY_ITEM_WORKTREE_CONFIG,
GIT_REPOSITORY_ITEM__LAST GIT_REPOSITORY_ITEM__LAST
} git_repository_item_t; } git_repository_item_t;
@ -978,6 +980,17 @@ GIT_EXTERN(int) git_repository_set_ident(git_repository *repo, const char *name,
*/ */
GIT_EXTERN(git_oid_t) git_repository_oid_type(git_repository *repo); GIT_EXTERN(git_oid_t) git_repository_oid_type(git_repository *repo);
/**
* Gets the parents of the next commit, given the current repository state.
* Generally, this is the HEAD commit, except when performing a merge, in
* which case it is two or more commits.
*
* @param commits a `git_commitarray` that will contain the commit parents
* @param repo the repository
* @return 0 or an error code
*/
GIT_EXTERN(int) git_repository_commit_parents(git_commitarray *commits, git_repository *repo);
/** @} */ /** @} */
GIT_END_DECL GIT_END_DECL
#endif #endif

View File

@ -125,6 +125,57 @@ GIT_EXTERN(int) git_config_add_backend(
const git_repository *repo, const git_repository *repo,
int force); int force);
/** Options for in-memory configuration backends. */
typedef struct {
unsigned int version;
/**
* The type of this backend (eg, "command line"). If this is
* NULL, then this will be "in-memory".
*/
const char *backend_type;
/**
* The path to the origin; if this is NULL then it will be
* left unset in the resulting configuration entries.
*/
const char *origin_path;
} git_config_backend_memory_options;
#define GIT_CONFIG_BACKEND_MEMORY_OPTIONS_VERSION 1
#define GIT_CONFIG_BACKEND_MEMORY_OPTIONS_INIT { GIT_CONFIG_BACKEND_MEMORY_OPTIONS_VERSION }
/**
* Create an in-memory configuration backend from a string in standard
* git configuration file format.
*
* @param out the new backend
* @param cfg the configuration that is to be parsed
* @param len the length of the string pointed to by `cfg`
* @param opts the options to initialize this backend with, or NULL
*/
extern int git_config_backend_from_string(
git_config_backend **out,
const char *cfg,
size_t len,
git_config_backend_memory_options *opts);
/**
* Create an in-memory configuration backend from a list of name/value
* pairs.
*
* @param out the new backend
* @param values the configuration values to set (in "key=value" format)
* @param len the length of the values array
* @param opts the options to initialize this backend with, or NULL
*/
extern int git_config_backend_from_values(
git_config_backend **out,
const char **values,
size_t len,
git_config_backend_memory_options *opts);
/** @} */ /** @} */
GIT_END_DECL GIT_END_DECL
#endif #endif

View File

@ -7,6 +7,11 @@
#ifndef INCLUDE_sys_git_email_h__ #ifndef INCLUDE_sys_git_email_h__
#define INCLUDE_sys_git_email_h__ #define INCLUDE_sys_git_email_h__
#include "git2/common.h"
#include "git2/diff.h"
#include "git2/email.h"
#include "git2/types.h"
/** /**
* @file git2/sys/email.h * @file git2/sys/email.h
* @brief Advanced git email creation routines * @brief Advanced git email creation routines

66
include/git2/sys/errors.h Normal file
View File

@ -0,0 +1,66 @@
/*
* 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_sys_git_errors_h__
#define INCLUDE_sys_git_errors_h__
#include "git2/common.h"
GIT_BEGIN_DECL
/**
* 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, using `printf`-style
* formatting.
*
* 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 fmt The `printf`-style format string; subsequent arguments must
* be the arguments for the format string.
*/
GIT_EXTERN(void) git_error_set(int error_class, const char *fmt, ...)
GIT_FORMAT_PRINTF(2, 3);
/**
* Set the error message string for this thread. This function is like
* `git_error_set` but takes a static string instead of a `printf`-style
* format.
*
* @param error_class One of the `git_error_t` enum above describing the
* general subsystem that is responsible for the error.
* @param string The 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

View File

@ -20,12 +20,18 @@
GIT_BEGIN_DECL GIT_BEGIN_DECL
/**
* A remote's capabilities.
*/
typedef enum { typedef enum {
/** Remote supports fetching an advertised object by ID. */ /** Remote supports fetching an advertised object by ID. */
GIT_REMOTE_CAPABILITY_TIP_OID = (1 << 0), GIT_REMOTE_CAPABILITY_TIP_OID = (1 << 0),
/** Remote supports fetching an individual reachable object. */ /** Remote supports fetching an individual reachable object. */
GIT_REMOTE_CAPABILITY_REACHABLE_OID = (1 << 1), GIT_REMOTE_CAPABILITY_REACHABLE_OID = (1 << 1),
/** Remote supports push options. */
GIT_REMOTE_CAPABILITY_PUSH_OPTIONS = (1 << 2),
} git_remote_capability_t; } git_remote_capability_t;
/** /**

View File

@ -9,6 +9,7 @@
#include "git2/common.h" #include "git2/common.h"
#include "git2/types.h" #include "git2/types.h"
#include "git2/oid.h"
/** /**
* @file git2/sys/repository.h * @file git2/sys/repository.h
@ -32,7 +33,11 @@ GIT_BEGIN_DECL
* @param out The blank repository * @param out The blank repository
* @return 0 on success, or an error code * @return 0 on success, or an error code
*/ */
#ifdef GIT_EXPERIMENTAL_SHA256
GIT_EXTERN(int) git_repository_new(git_repository **out, git_oid_t oid_type);
#else
GIT_EXTERN(int) git_repository_new(git_repository **out); GIT_EXTERN(int) git_repository_new(git_repository **out);
#endif
/** /**
* Reset all the internal state in a repository. * Reset all the internal state in a repository.

View File

@ -29,8 +29,8 @@ GIT_BEGIN_DECL
typedef struct git_stream { typedef struct git_stream {
int version; int version;
int encrypted : 1, unsigned int encrypted : 1,
proxy_support : 1; proxy_support : 1;
/** /**
* Timeout for read and write operations; can be set to `0` to * Timeout for read and write operations; can be set to `0` to

View File

@ -11,13 +11,13 @@
* The version string for libgit2. This string follows semantic * The version string for libgit2. This string follows semantic
* versioning (v2) guidelines. * versioning (v2) guidelines.
*/ */
#define LIBGIT2_VERSION "1.7.2" #define LIBGIT2_VERSION "1.8.2"
/** The major version number for this version of libgit2. */ /** The major version number for this version of libgit2. */
#define LIBGIT2_VER_MAJOR 1 #define LIBGIT2_VER_MAJOR 1
/** The minor version number for this version of libgit2. */ /** The minor version number for this version of libgit2. */
#define LIBGIT2_VER_MINOR 7 #define LIBGIT2_VER_MINOR 8
/** The revision ("teeny") version number for this version of libgit2. */ /** The revision ("teeny") version number for this version of libgit2. */
#define LIBGIT2_VER_REVISION 2 #define LIBGIT2_VER_REVISION 2
@ -33,7 +33,11 @@
*/ */
#define LIBGIT2_VER_PRERELEASE NULL #define LIBGIT2_VER_PRERELEASE NULL
/** The library ABI soversion for this version of libgit2. */ /**
#define LIBGIT2_SOVERSION "1.7" * The library ABI soversion for this version of libgit2. This should
* only be changed when the library has a breaking ABI change, and so
* may trail the library's version number.
*/
#define LIBGIT2_SOVERSION "1.8"
#endif #endif

View File

@ -11,6 +11,7 @@
#include "buffer.h" #include "buffer.h"
#include "types.h" #include "types.h"
#include "strarray.h" #include "strarray.h"
#include "checkout.h"
/** /**
* @file git2/worktrees.h * @file git2/worktrees.h
@ -85,8 +86,9 @@ GIT_EXTERN(int) git_worktree_validate(const git_worktree *wt);
typedef struct git_worktree_add_options { typedef struct git_worktree_add_options {
unsigned int version; unsigned int version;
int lock; /**< lock newly created worktree */ int lock; /**< lock newly created worktree */
git_reference *ref; /**< reference to use for the new worktree HEAD */ int checkout_existing; /**< allow checkout of existing branch matching worktree name */
git_reference *ref; /**< reference to use for the new worktree HEAD */
/** /**
* Options for the checkout. * Options for the checkout.
@ -95,7 +97,8 @@ typedef struct git_worktree_add_options {
} git_worktree_add_options; } git_worktree_add_options;
#define GIT_WORKTREE_ADD_OPTIONS_VERSION 1 #define GIT_WORKTREE_ADD_OPTIONS_VERSION 1
#define GIT_WORKTREE_ADD_OPTIONS_INIT {GIT_WORKTREE_ADD_OPTIONS_VERSION,0,NULL,GIT_CHECKOUT_OPTIONS_INIT} #define GIT_WORKTREE_ADD_OPTIONS_INIT { GIT_WORKTREE_ADD_OPTIONS_VERSION, \
0, 0, NULL, GIT_CHECKOUT_OPTIONS_INIT }
/** /**
* Initialize git_worktree_add_options structure * Initialize git_worktree_add_options structure

View File

@ -1,6 +1,6 @@
{ {
"name": "libgit2", "name": "libgit2",
"version": "1.7.2", "version": "1.8.2",
"repo": "https://github.com/libgit2/libgit2", "repo": "https://github.com/libgit2/libgit2",
"description": " A cross-platform, linkable library implementation of Git that you can use in your application.", "description": " A cross-platform, linkable library implementation of Git that you can use in your application.",
"install": "mkdir build && cd build && cmake .. && cmake --build ." "install": "mkdir build && cd build && cmake .. && cmake --build ."

View File

@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
exec valgrind --leak-check=full --show-reachable=yes --error-exitcode=125 --num-callers=50 --suppressions="$(dirname "${BASH_SOURCE[0]}")/valgrind.supp" "$@" exec valgrind --leak-check=full --show-reachable=yes --child-silent-after-fork=yes --error-exitcode=125 --num-callers=50 --suppressions="$(dirname "${BASH_SOURCE[0]}")/valgrind.supp" "$@"

View File

@ -80,6 +80,13 @@
fun:__check_pf fun:__check_pf
} }
{
ignore-glibc-getaddrinfo-fn
Memcheck:Leak
...
fun:getaddrinfo
}
{ {
ignore-curl-global-init ignore-curl-global-init
Memcheck:Leak Memcheck:Leak
@ -191,6 +198,16 @@
... ...
} }
{
ignore-openssl-undefined-in-connect
Memcheck:Cond
...
obj:*libcrypto.so*
...
fun:openssl_connect
...
}
{ {
ignore-libssh2-rsa-sha1-sign ignore-libssh2-rsa-sha1-sign
Memcheck:Leak Memcheck:Leak

View File

@ -135,7 +135,8 @@ endif()
# platform libraries # platform libraries
if(WIN32) if(WIN32)
list(APPEND LIBGIT2_SYSTEM_LIBS ws2_32) list(APPEND LIBGIT2_SYSTEM_LIBS "ws2_32" "secur32")
list(APPEND LIBGIT2_PC_LIBS "-lws2_32" "-lsecur32")
endif() endif()
if(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") if(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
@ -183,7 +184,7 @@ add_feature_info(ntlmclient GIT_NTLM "NTLM authentication support for Unix")
# iconv # iconv
if(USE_ICONV) if(USE_ICONV)
find_package(Iconv) find_package(IntlIconv)
endif() endif()
if(ICONV_FOUND) if(ICONV_FOUND)
set(GIT_USE_ICONV 1) set(GIT_USE_ICONV 1)

View File

@ -4,7 +4,8 @@ set(CLI_INCLUDES
"${libgit2_SOURCE_DIR}/src/util" "${libgit2_SOURCE_DIR}/src/util"
"${libgit2_SOURCE_DIR}/src/cli" "${libgit2_SOURCE_DIR}/src/cli"
"${libgit2_SOURCE_DIR}/include" "${libgit2_SOURCE_DIR}/include"
"${LIBGIT2_DEPENDENCY_INCLUDES}") "${LIBGIT2_DEPENDENCY_INCLUDES}"
"${LIBGIT2_SYSTEM_INCLUDES}")
if(WIN32 AND NOT CYGWIN) if(WIN32 AND NOT CYGWIN)
file(GLOB CLI_SRC_OS win32/*.c) file(GLOB CLI_SRC_OS win32/*.c)

View File

@ -5,7 +5,7 @@
* a Linking Exception. For full terms see the included COPYING file. * a Linking Exception. For full terms see the included COPYING file.
*/ */
#include "cli.h" #include "common.h"
#include "cmd.h" #include "cmd.h"
const cli_cmd_spec *cli_cmd_spec_byname(const char *name) const cli_cmd_spec *cli_cmd_spec_byname(const char *name)

View File

@ -27,7 +27,9 @@ extern const cli_cmd_spec *cli_cmd_spec_byname(const char *name);
/* Commands */ /* Commands */
extern int cmd_cat_file(int argc, char **argv); extern int cmd_cat_file(int argc, char **argv);
extern int cmd_clone(int argc, char **argv); extern int cmd_clone(int argc, char **argv);
extern int cmd_config(int argc, char **argv);
extern int cmd_hash_object(int argc, char **argv); extern int cmd_hash_object(int argc, char **argv);
extern int cmd_help(int argc, char **argv); extern int cmd_help(int argc, char **argv);
extern int cmd_index_pack(int argc, char **argv);
#endif /* CLI_cmd_h__ */ #endif /* CLI_cmd_h__ */

View File

@ -6,7 +6,7 @@
*/ */
#include <git2.h> #include <git2.h>
#include "cli.h" #include "common.h"
#include "cmd.h" #include "cmd.h"
#define COMMAND_NAME "cat-file" #define COMMAND_NAME "cat-file"
@ -24,9 +24,7 @@ static int display = DISPLAY_CONTENT;
static char *type_name, *object_spec; static char *type_name, *object_spec;
static const cli_opt_spec opts[] = { static const cli_opt_spec opts[] = {
{ CLI_OPT_TYPE_SWITCH, "help", 0, &show_help, 1, CLI_COMMON_OPT,
CLI_OPT_USAGE_HIDDEN | CLI_OPT_USAGE_STOP_PARSING, NULL,
"display help about the " COMMAND_NAME " command" },
{ CLI_OPT_TYPE_SWITCH, NULL, 't', &display, DISPLAY_TYPE, { CLI_OPT_TYPE_SWITCH, NULL, 't', &display, DISPLAY_TYPE,
CLI_OPT_USAGE_REQUIRED, NULL, "display the type of the object" }, CLI_OPT_USAGE_REQUIRED, NULL, "display the type of the object" },
@ -139,6 +137,7 @@ static int print_pretty(git_object *object)
int cmd_cat_file(int argc, char **argv) int cmd_cat_file(int argc, char **argv)
{ {
cli_repository_open_options open_opts = { argv + 1, argc - 1};
git_repository *repo = NULL; git_repository *repo = NULL;
git_object *object = NULL; git_object *object = NULL;
git_object_t type; git_object_t type;
@ -153,7 +152,7 @@ int cmd_cat_file(int argc, char **argv)
return 0; return 0;
} }
if (git_repository_open_ext(&repo, ".", GIT_REPOSITORY_OPEN_FROM_ENV, NULL) < 0) if (cli_repository_open(&repo, &open_opts) < 0)
return cli_error_git(); return cli_error_git();
if ((giterr = git_revparse_single(&object, repo, object_spec)) < 0) { if ((giterr = git_revparse_single(&object, repo, object_spec)) < 0) {

View File

@ -7,7 +7,7 @@
#include <stdio.h> #include <stdio.h>
#include <git2.h> #include <git2.h>
#include "cli.h" #include "common.h"
#include "cmd.h" #include "cmd.h"
#include "error.h" #include "error.h"
#include "sighandler.h" #include "sighandler.h"
@ -24,9 +24,7 @@ static bool local_path_exists;
static cli_progress progress = CLI_PROGRESS_INIT; static cli_progress progress = CLI_PROGRESS_INIT;
static const cli_opt_spec opts[] = { static const cli_opt_spec opts[] = {
{ CLI_OPT_TYPE_SWITCH, "help", 0, &show_help, 1, CLI_COMMON_OPT,
CLI_OPT_USAGE_HIDDEN | CLI_OPT_USAGE_STOP_PARSING, NULL,
"display help about the " COMMAND_NAME " command" },
{ CLI_OPT_TYPE_SWITCH, "quiet", 'q', &quiet, 1, { CLI_OPT_TYPE_SWITCH, "quiet", 'q', &quiet, 1,
CLI_OPT_USAGE_DEFAULT, NULL, "display the type of the object" }, CLI_OPT_USAGE_DEFAULT, NULL, "display the type of the object" },

242
src/cli/cmd_config.c Normal file
View File

@ -0,0 +1,242 @@
/*
* 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.
*/
#include <git2.h>
#include "common.h"
#include "cmd.h"
#define COMMAND_NAME "config"
typedef enum {
ACTION_NONE = 0,
ACTION_GET,
ACTION_ADD,
ACTION_REPLACE_ALL,
ACTION_LIST
} action_t;
static action_t action = ACTION_NONE;
static int show_origin;
static int show_scope;
static int show_help;
static int null_separator;
static int config_level;
static char *config_filename;
static char *name, *value, *value_pattern;
static const cli_opt_spec opts[] = {
CLI_COMMON_OPT, \
{ CLI_OPT_TYPE_SWITCH, "null", 'z', &null_separator, 1,
0, NULL, "use NUL as a separator" },
{ CLI_OPT_TYPE_SWITCH, "system", 0, &config_level, GIT_CONFIG_LEVEL_SYSTEM,
0, NULL, "read/write to system configuration" },
{ CLI_OPT_TYPE_SWITCH, "global", 0, &config_level, GIT_CONFIG_LEVEL_GLOBAL,
CLI_OPT_USAGE_CHOICE, NULL, "read/write to global configuration" },
{ CLI_OPT_TYPE_SWITCH, "local", 0, &config_level, GIT_CONFIG_LEVEL_LOCAL,
CLI_OPT_USAGE_CHOICE, NULL, "read/write to local configuration" },
{ CLI_OPT_TYPE_VALUE, "file", 0, &config_filename, 0,
CLI_OPT_USAGE_CHOICE, "filename", "read/write to specified configuration file" },
{ CLI_OPT_TYPE_SWITCH, "get", 0, &action, ACTION_GET,
CLI_OPT_USAGE_REQUIRED, NULL, "get a configuration value" },
{ CLI_OPT_TYPE_SWITCH, "add", 0, &action, ACTION_ADD,
CLI_OPT_USAGE_CHOICE, NULL, "add a configuration value" },
{ CLI_OPT_TYPE_SWITCH, "replace-all", 0, &action, ACTION_REPLACE_ALL,
CLI_OPT_USAGE_CHOICE, NULL, "add a configuration value, replacing any old values" },
{ CLI_OPT_TYPE_SWITCH, "list", 'l', &action, ACTION_LIST,
CLI_OPT_USAGE_CHOICE | CLI_OPT_USAGE_SHOW_LONG,
NULL, "list all configuration entries" },
{ CLI_OPT_TYPE_SWITCH, "show-origin", 0, &show_origin, 1,
0, NULL, "show origin of configuration" },
{ CLI_OPT_TYPE_SWITCH, "show-scope", 0, &show_scope, 1,
0, NULL, "show scope of configuration" },
{ CLI_OPT_TYPE_ARG, "name", 0, &name, 0,
0, "name", "name of configuration entry" },
{ CLI_OPT_TYPE_ARG, "value", 0, &value, 0,
0, "value", "value of configuration entry" },
{ CLI_OPT_TYPE_ARG, "regexp", 0, &value_pattern, 0,
0, "regexp", "regular expression of values to replace" },
{ 0 },
};
static void print_help(void)
{
cli_opt_usage_fprint(stdout, PROGRAM_NAME, COMMAND_NAME, opts);
printf("\n");
printf("Query and set configuration options.\n");
printf("\n");
printf("Options:\n");
cli_opt_help_fprint(stdout, opts);
}
static int get_config(git_config *config)
{
git_buf value = GIT_BUF_INIT;
char sep = null_separator ? '\0' : '\n';
int error;
error = git_config_get_string_buf(&value, config, name);
if (error && error != GIT_ENOTFOUND)
return cli_error_git();
else if (error == GIT_ENOTFOUND)
return 1;
printf("%s%c", value.ptr, sep);
return 0;
}
static int add_config(git_config *config)
{
if (git_config_set_multivar(config, name, "$^", value) < 0)
return cli_error_git();
return 0;
}
static int replace_all_config(git_config *config)
{
if (git_config_set_multivar(config, name, value_pattern ? value_pattern : ".*", value) < 0)
return cli_error_git();
return 0;
}
static const char *level_name(git_config_level_t level)
{
switch (level) {
case GIT_CONFIG_LEVEL_PROGRAMDATA:
return "programdata";
case GIT_CONFIG_LEVEL_SYSTEM:
return "system";
case GIT_CONFIG_LEVEL_XDG:
return "global";
case GIT_CONFIG_LEVEL_GLOBAL:
return "global";
case GIT_CONFIG_LEVEL_LOCAL:
return "local";
case GIT_CONFIG_LEVEL_APP:
return "command";
default:
return "unknown";
}
}
static int list_config(git_config *config)
{
git_config_iterator *iterator;
git_config_entry *entry;
char data_separator = null_separator ? '\0' : '\t';
char kv_separator = null_separator ? '\n' : '=';
char entry_separator = null_separator ? '\0' : '\n';
int error;
if (git_config_iterator_new(&iterator, config) < 0)
return cli_error_git();
while ((error = git_config_next(&entry, iterator)) == 0) {
if (show_scope)
printf("%s%c",
level_name(entry->level),
data_separator);
if (show_origin)
printf("%s%s%s%c",
entry->backend_type ? entry->backend_type : "",
entry->backend_type && entry->origin_path ? ":" : "",
entry->origin_path ? entry->origin_path : "",
data_separator);
printf("%s%c%s%c", entry->name, kv_separator, entry->value,
entry_separator);
}
if (error != GIT_ITEROVER)
return cli_error_git();
git_config_iterator_free(iterator);
return 0;
}
int cmd_config(int argc, char **argv)
{
git_repository *repo = NULL;
git_config *config = NULL;
cli_repository_open_options open_opts = { argv + 1, argc - 1};
cli_opt invalid_opt;
int ret = 0;
if (cli_opt_parse(&invalid_opt, opts, argv + 1, argc - 1, CLI_OPT_PARSE_GNU))
return cli_opt_usage_error(COMMAND_NAME, opts, &invalid_opt);
if (show_help) {
print_help();
return 0;
}
if (config_filename) {
if (git_config_new(&config) < 0 ||
git_config_add_file_ondisk(config, config_filename,
GIT_CONFIG_LEVEL_APP, NULL, 0) < 0) {
ret = cli_error_git();
goto done;
}
} else {
if (cli_repository_open(&repo, &open_opts) < 0 ||
git_repository_config(&config, repo) < 0) {
ret = cli_error_git();
goto done;
}
if (config_level &&
git_config_open_level(&config, config, config_level) < 0) {
ret = cli_error_git();
goto done;
}
}
switch (action) {
case ACTION_ADD:
if (!name || !value || value_pattern)
ret = cli_error_usage("%s --add requires two arguments", COMMAND_NAME);
else
ret = add_config(config);
break;
case ACTION_REPLACE_ALL:
if (!name || !value)
ret = cli_error_usage("%s --replace-all requires two or three arguments", COMMAND_NAME);
else
ret = replace_all_config(config);
break;
case ACTION_GET:
if (!name)
ret = cli_error_usage("%s --get requires an argument", COMMAND_NAME);
else
ret = get_config(config);
break;
case ACTION_LIST:
if (name)
ret = cli_error_usage("%s --list does not take an argument", COMMAND_NAME);
else
ret = list_config(config);
break;
default:
ret = cli_error_usage("unknown action");
}
done:
git_config_free(config);
git_repository_free(repo);
return ret;
}

View File

@ -6,7 +6,7 @@
*/ */
#include <git2.h> #include <git2.h>
#include "cli.h" #include "common.h"
#include "cmd.h" #include "cmd.h"
#include "futils.h" #include "futils.h"
@ -19,9 +19,7 @@ static int write_object, read_stdin, literally;
static char **filenames; static char **filenames;
static const cli_opt_spec opts[] = { static const cli_opt_spec opts[] = {
{ CLI_OPT_TYPE_SWITCH, "help", 0, &show_help, 1, CLI_COMMON_OPT,
CLI_OPT_USAGE_HIDDEN | CLI_OPT_USAGE_STOP_PARSING, NULL,
"display help about the " COMMAND_NAME " command" },
{ CLI_OPT_TYPE_VALUE, NULL, 't', &type_name, 0, { CLI_OPT_TYPE_VALUE, NULL, 't', &type_name, 0,
CLI_OPT_USAGE_DEFAULT, "type", "the type of object to hash (default: \"blob\")" }, CLI_OPT_USAGE_DEFAULT, "type", "the type of object to hash (default: \"blob\")" },
@ -92,6 +90,7 @@ static int hash_buf(
int cmd_hash_object(int argc, char **argv) int cmd_hash_object(int argc, char **argv)
{ {
cli_repository_open_options open_opts = { argv + 1, argc - 1};
git_repository *repo = NULL; git_repository *repo = NULL;
git_odb *odb = NULL; git_odb *odb = NULL;
git_oid_t oid_type; git_oid_t oid_type;
@ -113,7 +112,7 @@ int cmd_hash_object(int argc, char **argv)
return cli_error_usage("invalid object type '%s'", type_name); return cli_error_usage("invalid object type '%s'", type_name);
if (write_object && if (write_object &&
(git_repository_open_ext(&repo, ".", GIT_REPOSITORY_OPEN_FROM_ENV, NULL) < 0 || (cli_repository_open(&repo, &open_opts) < 0 ||
git_repository_odb(&odb, repo) < 0)) { git_repository_odb(&odb, repo) < 0)) {
ret = cli_error_git(); ret = cli_error_git();
goto done; goto done;

View File

@ -7,7 +7,7 @@
#include <stdio.h> #include <stdio.h>
#include <git2.h> #include <git2.h>
#include "cli.h" #include "common.h"
#include "cmd.h" #include "cmd.h"
#define COMMAND_NAME "help" #define COMMAND_NAME "help"
@ -16,8 +16,8 @@ static char *command;
static int show_help; static int show_help;
static const cli_opt_spec opts[] = { static const cli_opt_spec opts[] = {
{ CLI_OPT_TYPE_SWITCH, "help", 0, &show_help, 1, CLI_COMMON_OPT,
CLI_OPT_USAGE_HIDDEN, NULL, "display help about the help command" },
{ CLI_OPT_TYPE_ARG, "command", 0, &command, 0, { CLI_OPT_TYPE_ARG, "command", 0, &command, 0,
CLI_OPT_USAGE_DEFAULT, "command", "the command to show help for" }, CLI_OPT_USAGE_DEFAULT, "command", "the command to show help for" },
{ 0 }, { 0 },

114
src/cli/cmd_index_pack.c Normal file
View File

@ -0,0 +1,114 @@
/*
* 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.
*/
#include <git2.h>
#include "common.h"
#include "cmd.h"
#include "progress.h"
#define COMMAND_NAME "index-pack"
#define BUFFER_SIZE (1024 * 1024)
static int show_help, verbose, read_stdin;
static char *filename;
static cli_progress progress = CLI_PROGRESS_INIT;
static const cli_opt_spec opts[] = {
{ CLI_OPT_TYPE_SWITCH, "help", 0, &show_help, 1,
CLI_OPT_USAGE_HIDDEN | CLI_OPT_USAGE_STOP_PARSING, NULL,
"display help about the " COMMAND_NAME " command" },
{ CLI_OPT_TYPE_SWITCH, "verbose", 'v', &verbose, 1,
CLI_OPT_USAGE_DEFAULT, NULL, "display progress output" },
{ CLI_OPT_TYPE_LITERAL },
{ CLI_OPT_TYPE_SWITCH, "stdin", 0, &read_stdin, 1,
CLI_OPT_USAGE_REQUIRED, NULL, "read from stdin" },
{ CLI_OPT_TYPE_ARG, "pack-file", 0, &filename, 0,
CLI_OPT_USAGE_CHOICE, "pack-file", "packfile path" },
{ 0 },
};
static void print_help(void)
{
cli_opt_usage_fprint(stdout, PROGRAM_NAME, COMMAND_NAME, opts);
printf("\n");
printf("Indexes a packfile and writes the index to disk.\n");
printf("\n");
printf("Options:\n");
cli_opt_help_fprint(stdout, opts);
}
int cmd_index_pack(int argc, char **argv)
{
cli_opt invalid_opt;
git_indexer *idx = NULL;
git_indexer_options idx_opts = GIT_INDEXER_OPTIONS_INIT;
git_indexer_progress stats = {0};
char buf[BUFFER_SIZE];
ssize_t read_len;
int fd, ret;
if (cli_opt_parse(&invalid_opt, opts, argv + 1, argc - 1, CLI_OPT_PARSE_GNU))
return cli_opt_usage_error(COMMAND_NAME, opts, &invalid_opt);
if (show_help) {
print_help();
return 0;
}
if (verbose) {
idx_opts.progress_cb = cli_progress_indexer;
idx_opts.progress_cb_payload = &progress;
}
if (read_stdin) {
fd = fileno(stdin);
} else if ((fd = p_open(filename, O_RDONLY)) < 0) {
ret = cli_error_git();
goto done;
}
#ifdef GIT_EXPERIMENTAL_SHA256
ret = git_indexer_new(&idx, ".", GIT_OID_SHA1, &idx_opts);
#else
ret = git_indexer_new(&idx, ".", 0, NULL, &idx_opts);
#endif
if (ret < 0) {
ret = cli_error_git();
goto done;
}
while ((read_len = p_read(fd, buf, sizeof(buf))) > 0) {
if (git_indexer_append(idx, buf, (size_t)read_len, &stats) < 0) {
ret = cli_error_git();
goto done;
}
}
if (git_indexer_commit(idx, &stats) < 0) {
ret = cli_error_git();
goto done;
}
cli_progress_finish(&progress);
done:
if (!read_stdin && fd >= 0)
p_close(fd);
cli_progress_dispose(&progress);
git_indexer_free(idx);
return ret;
}

126
src/cli/common.c Normal file
View File

@ -0,0 +1,126 @@
/*
* 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.
*/
#include <git2.h>
#include <git2/sys/config.h>
#include "git2_util.h"
#include "vector.h"
#include "common.h"
#include "error.h"
static int parse_option(cli_opt *opt, void *data)
{
git_str kv = GIT_STR_INIT, env = GIT_STR_INIT;
git_vector *cmdline_config = data;
int error = 0;
if (opt->spec && opt->spec->alias == 'c') {
if (git_str_puts(&kv, opt->value) < 0) {
error = cli_error_git();
goto done;
}
}
else if (opt->spec && !strcmp(opt->spec->name, "config-env")) {
char *val = strchr(opt->value, '=');
if (val == NULL || *(val + 1) == '\0') {
error = cli_error("invalid config format: '%s'", opt->value);
goto done;
}
if (git_str_put(&kv, opt->value, (val - opt->value)) < 0) {
error = cli_error_git();
goto done;
}
val++;
if ((error = git__getenv(&env, val)) == GIT_ENOTFOUND) {
error = cli_error("missing environment variable '%s' for configuration '%s'", val, kv.ptr);
goto done;
} else if (error) {
error = cli_error_git();
goto done;
}
if (git_str_putc(&kv, '=') < 0 ||
git_str_puts(&kv, env.ptr) < 0) {
error = cli_error_git();
goto done;
}
}
if (kv.size > 0 &&
git_vector_insert(cmdline_config, git_str_detach(&kv)) < 0)
error = cli_error_git();
done:
git_str_dispose(&env);
git_str_dispose(&kv);
return error;
}
static int parse_common_options(
git_repository *repo,
cli_repository_open_options *opts)
{
cli_opt_spec common_opts[] = {
{ CLI_COMMON_OPT_CONFIG },
{ CLI_COMMON_OPT_CONFIG_ENV },
{ 0 }
};
git_config_backend_memory_options config_opts =
GIT_CONFIG_BACKEND_MEMORY_OPTIONS_INIT;
git_vector cmdline = GIT_VECTOR_INIT;
git_config *config = NULL;
git_config_backend *backend = NULL;
int error = 0;
config_opts.backend_type = "command line";
if ((error = cli_opt_foreach(common_opts, opts->args,
opts->args_len, CLI_OPT_PARSE_GNU, parse_option,
&cmdline)) < 0)
goto done;
if (git_vector_length(&cmdline) == 0)
goto done;
if (git_repository_config(&config, repo) < 0 ||
git_config_backend_from_values(&backend,
(const char **)cmdline.contents, cmdline.length,
&config_opts) < 0 ||
git_config_add_backend(config, backend, GIT_CONFIG_LEVEL_APP,
repo, 0) < 0)
error = cli_error_git();
done:
if (error && backend)
backend->free(backend);
git_config_free(config);
git_vector_free_deep(&cmdline);
return error;
}
int cli_repository_open(
git_repository **out,
cli_repository_open_options *opts)
{
git_repository *repo;
if (git_repository_open_ext(&repo, ".", GIT_REPOSITORY_OPEN_FROM_ENV, NULL) < 0)
return -1;
if (opts && parse_common_options(repo, opts) < 0)
return -1;
*out = repo;
return 0;
}

66
src/cli/common.h Normal file
View File

@ -0,0 +1,66 @@
/*
* 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 CLI_common_h__
#define CLI_common_h__
#define PROGRAM_NAME "git2"
#include "git2_util.h"
#include "error.h"
#include "opt.h"
#include "opt_usage.h"
/*
* Common command arguments.
*/
#define CLI_COMMON_OPT_HELP \
CLI_OPT_TYPE_SWITCH, "help", 0, &show_help, 1, \
CLI_OPT_USAGE_HIDDEN | CLI_OPT_USAGE_STOP_PARSING
#define CLI_COMMON_OPT_CONFIG \
CLI_OPT_TYPE_VALUE, NULL, 'c', NULL, 0, \
CLI_OPT_USAGE_HIDDEN
#define CLI_COMMON_OPT_CONFIG_ENV \
CLI_OPT_TYPE_VALUE, "config-env", 0, NULL, 0, \
CLI_OPT_USAGE_HIDDEN
#define CLI_COMMON_OPT \
{ CLI_COMMON_OPT_HELP }, \
{ CLI_COMMON_OPT_CONFIG }, \
{ CLI_COMMON_OPT_CONFIG_ENV }
typedef struct {
char **args;
int args_len;
} cli_repository_open_options;
extern int cli_repository_open(
git_repository **out,
cli_repository_open_options *opts);
/*
* Common command arguments.
*/
#define CLI_COMMON_OPT_HELP \
CLI_OPT_TYPE_SWITCH, "help", 0, &show_help, 1, \
CLI_OPT_USAGE_HIDDEN | CLI_OPT_USAGE_STOP_PARSING
#define CLI_COMMON_OPT_CONFIG \
CLI_OPT_TYPE_VALUE, NULL, 'c', NULL, 0, \
CLI_OPT_USAGE_HIDDEN
#define CLI_COMMON_OPT_CONFIG_ENV \
CLI_OPT_TYPE_VALUE, "config-env", 0, NULL, 0, \
CLI_OPT_USAGE_HIDDEN
#define CLI_COMMON_OPT \
{ CLI_COMMON_OPT_HELP }, \
{ CLI_COMMON_OPT_CONFIG }, \
{ CLI_COMMON_OPT_CONFIG_ENV }
#endif /* CLI_common_h__ */

View File

@ -8,7 +8,7 @@
#ifndef CLI_error_h__ #ifndef CLI_error_h__
#define CLI_error_h__ #define CLI_error_h__
#include "cli.h" #include "common.h"
#include <stdio.h> #include <stdio.h>
#define CLI_EXIT_OK 0 #define CLI_EXIT_OK 0

View File

@ -7,7 +7,7 @@
#include <stdio.h> #include <stdio.h>
#include <git2.h> #include <git2.h>
#include "cli.h" #include "common.h"
#include "cmd.h" #include "cmd.h"
static int show_help = 0; static int show_help = 0;
@ -16,8 +16,12 @@ static char *command = NULL;
static char **args = NULL; static char **args = NULL;
const cli_opt_spec cli_common_opts[] = { const cli_opt_spec cli_common_opts[] = {
{ CLI_OPT_TYPE_SWITCH, "help", 0, &show_help, 1, { CLI_OPT_TYPE_SWITCH, "help", 0, &show_help, 1,
CLI_OPT_USAGE_DEFAULT, NULL, "display help information" }, CLI_OPT_USAGE_DEFAULT, NULL, "display help information" },
{ CLI_OPT_TYPE_VALUE, NULL, 'c', NULL, 0,
CLI_OPT_USAGE_DEFAULT, "key=value", "add configuration value" },
{ CLI_OPT_TYPE_VALUE, "config-env", 0, NULL, 0,
CLI_OPT_USAGE_DEFAULT, "key=value", "set configuration value to environment variable" },
{ CLI_OPT_TYPE_SWITCH, "version", 0, &show_version, 1, { CLI_OPT_TYPE_SWITCH, "version", 0, &show_version, 1,
CLI_OPT_USAGE_DEFAULT, NULL, "display the version" }, CLI_OPT_USAGE_DEFAULT, NULL, "display the version" },
{ CLI_OPT_TYPE_ARG, "command", 0, &command, 0, { CLI_OPT_TYPE_ARG, "command", 0, &command, 0,
@ -30,19 +34,40 @@ const cli_opt_spec cli_common_opts[] = {
const cli_cmd_spec cli_cmds[] = { const cli_cmd_spec cli_cmds[] = {
{ "cat-file", cmd_cat_file, "Display an object in the repository" }, { "cat-file", cmd_cat_file, "Display an object in the repository" },
{ "clone", cmd_clone, "Clone a repository into a new directory" }, { "clone", cmd_clone, "Clone a repository into a new directory" },
{ "config", cmd_config, "View or set configuration values " },
{ "hash-object", cmd_hash_object, "Hash a raw object and product its object ID" }, { "hash-object", cmd_hash_object, "Hash a raw object and product its object ID" },
{ "help", cmd_help, "Display help information" }, { "help", cmd_help, "Display help information" },
{ "index-pack", cmd_index_pack, "Create an index for a packfile" },
{ NULL } { NULL }
}; };
/*
* Reorder the argv as it was given, since git has the notion of global
* options (like `--help` or `-c key=val`) that we want to pass to the
* subcommand, and that can appear early in the arguments, before the
* command name. Put the command-name in argv[1] to allow easier parsing.
*/
static void reorder_args(char **argv, size_t first)
{
char *tmp;
size_t i;
if (first == 1)
return;
tmp = argv[first];
for (i = first; i > 1; i--)
argv[i] = argv[i - 1];
argv[1] = tmp;
}
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
const cli_cmd_spec *cmd; const cli_cmd_spec *cmd;
cli_opt_parser optparser; cli_opt_parser optparser;
cli_opt opt; cli_opt opt;
char *help_args[3] = { NULL };
int help_args_len;
int args_len = 0;
int ret = 0; int ret = 0;
if (git_libgit2_init() < 0) { if (git_libgit2_init() < 0) {
@ -66,8 +91,7 @@ int main(int argc, char **argv)
* remaining arguments as args for the command itself. * remaining arguments as args for the command itself.
*/ */
if (command) { if (command) {
args = &argv[optparser.idx]; reorder_args(argv, optparser.idx);
args_len = (int)(argc - optparser.idx);
break; break;
} }
} }
@ -77,19 +101,9 @@ int main(int argc, char **argv)
goto done; goto done;
} }
/* if (!command) {
* If `--help <command>` is specified, delegate to that command's ret = cmd_help(argc, argv);
* `--help` option. If no command is specified, run the `help` goto done;
* command. Do this by updating the args to emulate that behavior.
*/
if (!command || show_help) {
help_args[0] = command ? (char *)command : "help";
help_args[1] = command ? "--help" : NULL;
help_args_len = command ? 2 : 1;
command = help_args[0];
args = help_args;
args_len = help_args_len;
} }
if ((cmd = cli_cmd_spec_byname(command)) == NULL) { if ((cmd = cli_cmd_spec_byname(command)) == NULL) {
@ -98,7 +112,7 @@ int main(int argc, char **argv)
goto done; goto done;
} }
ret = cmd->fn(args_len, args); ret = cmd->fn(argc - 1, &argv[1]);
done: done:
git_libgit2_shutdown(); git_libgit2_shutdown();

Some files were not shown because too many files have changed in this diff Show More