mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-01 13:15:12 +00:00
Update upstream source from tag 'upstream/1.3.0+dfsg.1'
Update to upstream version '1.3.0+dfsg.1'
with Debian dir 6aa2d8b875
This commit is contained in:
commit
0daf0fd6bf
3
.devcontainer/devcontainer.json
Normal file
3
.devcontainer/devcontainer.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"postCreateCommand": "bash .devcontainer/setup.sh"
|
||||
}
|
9
.devcontainer/setup.sh
Executable file
9
.devcontainer/setup.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get -y --no-install-recommends install cmake
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1 +1,2 @@
|
||||
* text=auto
|
||||
tests/resources/** linguist-vendored
|
||||
|
36
.github/workflows/codeql.yml
vendored
Normal file
36
.github/workflows/codeql.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '21 3 * * 1'
|
||||
|
||||
env:
|
||||
docker-registry: docker.pkg.github.com
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: 'cpp'
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON
|
||||
cmake --build .
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
141
.github/workflows/main.yml
vendored
141
.github/workflows/main.yml
vendored
@ -1,16 +1,17 @@
|
||||
# Continuous integration and pull request validation builds for the
|
||||
# master and maintenance branches.
|
||||
# main and maintenance branches.
|
||||
name: CI Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, maint/* ]
|
||||
branches: [ main, maint/* ]
|
||||
pull_request:
|
||||
branches: [ master, maint/* ]
|
||||
branches: [ main, maint/* ]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
docker-registry: docker.pkg.github.com
|
||||
docker-config-path: azure-pipelines/docker
|
||||
docker-config-path: source/ci/docker
|
||||
|
||||
jobs:
|
||||
# Build the docker container images that we will use for our Linux
|
||||
@ -26,69 +27,99 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
container:
|
||||
- xenial
|
||||
- bionic
|
||||
- focal
|
||||
- docurium
|
||||
- name: xenial
|
||||
- name: bionic
|
||||
- name: focal
|
||||
- name: docurium
|
||||
- name: bionic-x86
|
||||
dockerfile: bionic
|
||||
base: multiarch/ubuntu-core:x86-bionic
|
||||
qemu: true
|
||||
- name: bionic-arm32
|
||||
dockerfile: bionic
|
||||
base: multiarch/ubuntu-core:armhf-bionic
|
||||
qemu: true
|
||||
- name: bionic-arm64
|
||||
dockerfile: bionic
|
||||
base: multiarch/ubuntu-core:arm64-bionic
|
||||
qemu: true
|
||||
- name: centos7
|
||||
- name: centos8
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: source
|
||||
fetch-depth: 0
|
||||
if: github.event_name == 'push'
|
||||
if: github.event_name != 'pull_request'
|
||||
- name: Setup QEMU
|
||||
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
if: matrix.container.qemu == true
|
||||
- name: Download existing container
|
||||
run: azure-pipelines/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.container }}
|
||||
run: |
|
||||
"${{ github.workspace }}/source/ci/getcontainer.sh" "${{ matrix.container.name }}" "${{ matrix.container.dockerfile }}"
|
||||
env:
|
||||
DOCKER_REGISTRY: ${{ env.docker-registry }}
|
||||
GITHUB_TOKEN: ${{ secrets.github_token }}
|
||||
if: github.event_name == 'push'
|
||||
working-directory: ${{ env.docker-config-path }}
|
||||
if: github.event_name != 'pull_request'
|
||||
- name: Build and publish image
|
||||
run: |
|
||||
docker build -t ${{ env.docker-registry-container-sha }} --build-arg BASE=${{ matrix.container.base }} -f ${{ matrix.container }} .
|
||||
if [ "${{ matrix.container.base }}" != "" ]; then
|
||||
BASE_ARG="--build-arg BASE=${{ matrix.container.base }}"
|
||||
fi
|
||||
docker build -t ${{ env.docker-registry-container-sha }} ${BASE_ARG} -f ${{ env.dockerfile }} .
|
||||
docker tag ${{ env.docker-registry-container-sha }} ${{ env.docker-registry-container-latest }}
|
||||
docker push ${{ env.docker-registry-container-sha }}
|
||||
docker push ${{ env.docker-registry-container-latest }}
|
||||
working-directory: ${{ env.docker-config-path }}
|
||||
if: github.event_name == 'push' && env.docker-container-exists != 'true'
|
||||
if: github.event_name != 'pull_request' && env.docker-container-exists != 'true'
|
||||
|
||||
# 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:
|
||||
name: Build
|
||||
needs: [build_containers]
|
||||
needs: [ build_containers ]
|
||||
strategy:
|
||||
matrix:
|
||||
platform:
|
||||
- # Xenial, GCC, OpenSSL
|
||||
image: xenial
|
||||
container:
|
||||
name: xenial
|
||||
env:
|
||||
CC: gcc
|
||||
CMAKE_GENERATOR: Ninja
|
||||
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
|
||||
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DDEBUG_STRICT_ALLOC=ON -DDEBUG_STRICT_OPEN=ON
|
||||
os: ubuntu-latest
|
||||
- # Xenial, GCC, mbedTLS
|
||||
image: xenial
|
||||
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
|
||||
os: ubuntu-latest
|
||||
- # Xenial, Clang, OpenSSL
|
||||
image: xenial
|
||||
container:
|
||||
name: xenial
|
||||
env:
|
||||
CC: clang
|
||||
CMAKE_GENERATOR: Ninja
|
||||
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
|
||||
os: ubuntu-latest
|
||||
- # Xenial, Clang, mbedTLS
|
||||
image: xenial
|
||||
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
|
||||
CMAKE_GENERATOR: Ninja
|
||||
os: ubuntu-latest
|
||||
- # Focal, Clang 10, mbedTLS, MemorySanitizer
|
||||
image: focal
|
||||
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
|
||||
@ -97,9 +128,11 @@ jobs:
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
|
||||
UBSAN_OPTIONS: print_stacktrace=1
|
||||
os: ubuntu-latest
|
||||
- # Focal, Clang 10, OpenSSL, UndefinedBehaviorSanitizer
|
||||
image: focal
|
||||
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
|
||||
@ -108,13 +141,27 @@ jobs:
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
|
||||
UBSAN_OPTIONS: print_stacktrace=1
|
||||
os: ubuntu-latest
|
||||
- # Focal, Clang 10, OpenSSL, 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
|
||||
UBSAN_OPTIONS: print_stacktrace=1
|
||||
TSAN_OPTIONS: suppressions=/home/libgit2/source/script/thread-sanitizer.supp second_deadlock_stack=1
|
||||
os: ubuntu-latest
|
||||
- # macOS
|
||||
os: macos-10.15
|
||||
env:
|
||||
CC: clang
|
||||
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
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
@ -124,7 +171,7 @@ jobs:
|
||||
env:
|
||||
ARCH: amd64
|
||||
CMAKE_GENERATOR: Visual Studio 16 2019
|
||||
CMAKE_OPTIONS: -A x64 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON
|
||||
CMAKE_OPTIONS: -A x64 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
- # Windows x86 Visual Studio
|
||||
@ -132,7 +179,7 @@ jobs:
|
||||
env:
|
||||
ARCH: x86
|
||||
CMAKE_GENERATOR: Visual Studio 16 2019
|
||||
CMAKE_OPTIONS: -A Win32 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS -DUSE_BUNDLED_ZLIB=ON
|
||||
CMAKE_OPTIONS: -A Win32 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS -DUSE_BUNDLED_ZLIB=ON
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
- # Windows amd64 mingw
|
||||
@ -164,30 +211,37 @@ jobs:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: source
|
||||
fetch-depth: 0
|
||||
- name: Set up build environment
|
||||
run: azure-pipelines/setup-${{ matrix.platform.setup-script }}.sh
|
||||
run: source/ci/setup-${{ matrix.platform.setup-script }}.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: Download container
|
||||
run: azure-pipelines/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.platform.image }}
|
||||
run: |
|
||||
"${{ github.workspace }}/source/ci/getcontainer.sh" "${{ matrix.platform.container.name }}" "${{ matrix.platform.container.dockerfile }}"
|
||||
env:
|
||||
DOCKER_REGISTRY: ${{ env.docker-registry }}
|
||||
GITHUB_TOKEN: ${{ secrets.github_token }}
|
||||
if: matrix.platform.image != ''
|
||||
- name: Create container
|
||||
run: docker build -t ${{ env.docker-registry-container-sha }} -f ${{ matrix.platform.image }} .
|
||||
working-directory: ${{ env.docker-config-path }}
|
||||
if: matrix.platform.image != '' && env.docker-container-exists != 'true'
|
||||
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: Build and test
|
||||
run: |
|
||||
export GITTEST_NEGOTIATE_PASSWORD="${{ secrets.GITTEST_NEGOTIATE_PASSWORD }}"
|
||||
|
||||
if [ -n "${{ matrix.platform.image }}" ]; then
|
||||
if [ -n "${{ matrix.platform.container.name }}" ]; then
|
||||
docker run \
|
||||
--rm \
|
||||
-v "$(pwd):/home/libgit2/source" \
|
||||
-w /home/libgit2/source \
|
||||
--user libgit2:libgit2 \
|
||||
-v "$(pwd)/source:/home/libgit2/source" \
|
||||
-w /home/libgit2 \
|
||||
-e ASAN_SYMBOLIZER_PATH \
|
||||
-e CC \
|
||||
-e CFLAGS \
|
||||
@ -197,19 +251,21 @@ jobs:
|
||||
-e PKG_CONFIG_PATH \
|
||||
-e SKIP_NEGOTIATE_TESTS \
|
||||
-e SKIP_SSH_TESTS \
|
||||
-e TSAN_OPTIONS \
|
||||
-e UBSAN_OPTIONS \
|
||||
${{ env.docker-registry-container-sha }} \
|
||||
/bin/bash -c "mkdir build && cd build && ../azure-pipelines/build.sh && ../azure-pipelines/test.sh"
|
||||
/bin/bash -c "mkdir build && cd build && ../source/ci/build.sh && ../source/ci/test.sh"
|
||||
else
|
||||
mkdir build && cd build
|
||||
../azure-pipelines/build.sh
|
||||
../azure-pipelines/test.sh
|
||||
../source/ci/build.sh
|
||||
../source/ci/test.sh
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
# Generate documentation using docurium. We'll upload the documentation
|
||||
# as a build artifact so that it can be reviewed as part of a pull
|
||||
# request or in a forked build. For CI builds in the main repository's
|
||||
# master branch, we'll push the gh-pages branch back up so that it is
|
||||
# main branch, we'll push the gh-pages branch back up so that it is
|
||||
# published to our documentation site.
|
||||
documentation:
|
||||
name: Generate documentation
|
||||
@ -219,8 +275,10 @@ jobs:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: source
|
||||
fetch-depth: 0
|
||||
- name: Generate documentation
|
||||
working-directory: source
|
||||
run: |
|
||||
git config user.name 'Documentation Generation'
|
||||
git config user.email 'libgit2@users.noreply.github.com'
|
||||
@ -228,8 +286,8 @@ jobs:
|
||||
docker login https://${{ env.docker-registry }} -u ${{ github.actor }} -p ${{ github.token }}
|
||||
docker run \
|
||||
--rm \
|
||||
-v "$(pwd):/home/libgit2/source" \
|
||||
-w /home/libgit2/source \
|
||||
-v "$(pwd):/home/libgit2" \
|
||||
-w /home/libgit2 \
|
||||
${{ env.docker-registry }}/${{ github.repository }}/docurium:latest \
|
||||
cm doc api.docurium
|
||||
git checkout gh-pages
|
||||
@ -238,7 +296,8 @@ jobs:
|
||||
name: Upload artifact
|
||||
with:
|
||||
name: api-documentation
|
||||
path: api-documentation.zip
|
||||
path: source/api-documentation.zip
|
||||
- name: Push documentation branch
|
||||
working-directory: source
|
||||
run: git push origin gh-pages
|
||||
if: github.event_name == 'push' && github.repository == 'libgit2/libgit2'
|
||||
if: github.event_name != 'pull_request' && github.repository == 'libgit2/libgit2'
|
||||
|
339
.github/workflows/nightly.yml
vendored
Normal file
339
.github/workflows/nightly.yml
vendored
Normal file
@ -0,0 +1,339 @@
|
||||
# Nightly build for the main branch across multiple targets.
|
||||
name: Nightly Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '15 1 * * *'
|
||||
|
||||
env:
|
||||
docker-registry: docker.pkg.github.com
|
||||
docker-config-path: source/ci/docker
|
||||
|
||||
jobs:
|
||||
# Run our nightly 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:
|
||||
name: Build
|
||||
strategy:
|
||||
matrix:
|
||||
platform:
|
||||
- # Xenial, GCC, OpenSSL
|
||||
container:
|
||||
name: xenial
|
||||
env:
|
||||
CC: gcc
|
||||
CMAKE_GENERATOR: Ninja
|
||||
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
|
||||
os: ubuntu-latest
|
||||
- # 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
|
||||
os: ubuntu-latest
|
||||
- # 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
|
||||
os: ubuntu-latest
|
||||
- # 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
|
||||
CMAKE_GENERATOR: Ninja
|
||||
os: ubuntu-latest
|
||||
- # Xenial, GCC, thread-free
|
||||
container:
|
||||
name: xenial
|
||||
env:
|
||||
CC: gcc
|
||||
CMAKE_OPTIONS: -DTHREADSAFE=OFF -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
|
||||
CMAKE_GENERATOR: Ninja
|
||||
os: ubuntu-latest
|
||||
- # Xenial, Clang, OpenSSL (dynamically loaded)
|
||||
container:
|
||||
name: xenial
|
||||
env:
|
||||
CC: clang
|
||||
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
|
||||
CMAKE_GENERATOR: Ninja
|
||||
os: ubuntu-latest
|
||||
- # Focal, Clang 10, mbedTLS, 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
|
||||
CMAKE_GENERATOR: Ninja
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
|
||||
os: ubuntu-latest
|
||||
- # Focal, Clang 10, OpenSSL, 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
|
||||
- # Focal, Clang 10, OpenSSL, 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
|
||||
- # Focal, Clang 10, mmap emulation (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
|
||||
- # CentOS 7
|
||||
container:
|
||||
name: centos7
|
||||
env:
|
||||
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
|
||||
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
os: ubuntu-latest
|
||||
- # CentOS 7, OpenSSL (dynamically loaded)
|
||||
container:
|
||||
name: centos7
|
||||
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
|
||||
os: ubuntu-latest
|
||||
- # 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
|
||||
- # CentOS 8, OpenSSL (dynamically loaded)
|
||||
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
|
||||
- # macOS
|
||||
os: macos-10.15
|
||||
env:
|
||||
CC: clang
|
||||
CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON
|
||||
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
setup-script: osx
|
||||
- # Windows amd64 Visual Studio
|
||||
os: windows-2019
|
||||
env:
|
||||
ARCH: amd64
|
||||
CMAKE_GENERATOR: Visual Studio 16 2019
|
||||
CMAKE_OPTIONS: -A x64 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
- # Windows amd64 Visual Studio (NO_MMAP)
|
||||
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
|
||||
- # Windows x86 Visual Studio
|
||||
os: windows-2019
|
||||
env:
|
||||
ARCH: x86
|
||||
CMAKE_GENERATOR: Visual Studio 16 2019
|
||||
CMAKE_OPTIONS: -A Win32 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS -DUSE_BUNDLED_ZLIB=ON
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
- # Windows amd64 mingw
|
||||
os: windows-2019
|
||||
setup-script: mingw
|
||||
env:
|
||||
ARCH: amd64
|
||||
CMAKE_GENERATOR: MinGW Makefiles
|
||||
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
|
||||
BUILD_TEMP: D:\Temp
|
||||
BUILD_PATH: D:\Temp\mingw64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
- # Windows x86 mingw
|
||||
os: windows-2019
|
||||
setup-script: mingw
|
||||
env:
|
||||
ARCH: x86
|
||||
CMAKE_GENERATOR: MinGW Makefiles
|
||||
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
|
||||
BUILD_TEMP: D:\Temp
|
||||
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_NEGOTIATE_TESTS: true
|
||||
- # Bionic, GCC, OpenSSL (dynamically loaded)
|
||||
container:
|
||||
name: bionic
|
||||
dockerfile: bionic
|
||||
env:
|
||||
CC: gcc
|
||||
CMAKE_GENERATOR: Ninja
|
||||
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL-Dynamic -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
|
||||
RUN_INVASIVE_TESTS: true
|
||||
os: ubuntu-latest
|
||||
- # Bionic, x86, Clang, OpenSSL
|
||||
container:
|
||||
name: bionic-x86
|
||||
dockerfile: bionic
|
||||
qemu: true
|
||||
env:
|
||||
CC: clang
|
||||
CMAKE_GENERATOR: Ninja
|
||||
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
|
||||
RUN_INVASIVE_TESTS: true
|
||||
os: ubuntu-latest
|
||||
- # Bionic, x86, GCC, OpenSSL
|
||||
container:
|
||||
name: bionic-x86
|
||||
dockerfile: bionic
|
||||
env:
|
||||
CC: gcc
|
||||
CMAKE_GENERATOR: Ninja
|
||||
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
|
||||
RUN_INVASIVE_TESTS: true
|
||||
os: ubuntu-latest
|
||||
- # Bionic, arm32, GCC, OpenSSL
|
||||
container:
|
||||
name: bionic-arm32
|
||||
dockerfile: bionic
|
||||
qemu: true
|
||||
env:
|
||||
CC: gcc
|
||||
CMAKE_GENERATOR: Ninja
|
||||
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON
|
||||
RUN_INVASIVE_TESTS: true
|
||||
SKIP_PROXY_TESTS: true
|
||||
os: ubuntu-latest
|
||||
- # Bionic, arm64, GCC, OpenSSL
|
||||
container:
|
||||
name: bionic-arm64
|
||||
dockerfile: bionic
|
||||
qemu: true
|
||||
env:
|
||||
CC: gcc
|
||||
CMAKE_GENERATOR: Ninja
|
||||
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON
|
||||
RUN_INVASIVE_TESTS: true
|
||||
SKIP_PROXY_TESTS: true
|
||||
os: ubuntu-latest
|
||||
fail-fast: false
|
||||
env: ${{ matrix.platform.env }}
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: source
|
||||
fetch-depth: 0
|
||||
- name: Set up build environment
|
||||
run: source/ci/setup-${{ matrix.platform.setup-script }}.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: Download container
|
||||
run: |
|
||||
"${{ github.workspace }}/source/ci/getcontainer.sh" "${{ matrix.platform.container.name }}" "${{ matrix.platform.container.dockerfile }}"
|
||||
env:
|
||||
DOCKER_REGISTRY: ${{ env.docker-registry }}
|
||||
GITHUB_TOKEN: ${{ secrets.github_token }}
|
||||
working-directory: ${{ env.docker-config-path }}
|
||||
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: Build and test
|
||||
run: |
|
||||
export GITTEST_NEGOTIATE_PASSWORD="${{ secrets.GITTEST_NEGOTIATE_PASSWORD }}"
|
||||
|
||||
if [ -n "${{ matrix.platform.container.name }}" ]; then
|
||||
docker run \
|
||||
--rm \
|
||||
--user libgit2:libgit2 \
|
||||
-v "$(pwd)/source:/home/libgit2/source" \
|
||||
-w /home/libgit2 \
|
||||
-e ASAN_SYMBOLIZER_PATH \
|
||||
-e CC \
|
||||
-e CFLAGS \
|
||||
-e CMAKE_GENERATOR \
|
||||
-e CMAKE_OPTIONS \
|
||||
-e GITTEST_NEGOTIATE_PASSWORD \
|
||||
-e PKG_CONFIG_PATH \
|
||||
-e SKIP_NEGOTIATE_TESTS \
|
||||
-e SKIP_SSH_TESTS \
|
||||
-e TSAN_OPTIONS \
|
||||
${{ env.docker-registry-container-sha }} \
|
||||
/bin/bash -c "mkdir build && cd build && ../source/ci/build.sh && ../source/ci/test.sh"
|
||||
else
|
||||
mkdir build && cd build
|
||||
../source/ci/build.sh
|
||||
../source/ci/test.sh
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
coverity:
|
||||
name: Coverity
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: source
|
||||
fetch-depth: 0
|
||||
- name: Download container
|
||||
run: |
|
||||
"${{ github.workspace }}/source/ci/getcontainer.sh" xenial
|
||||
env:
|
||||
DOCKER_REGISTRY: ${{ env.docker-registry }}
|
||||
GITHUB_TOKEN: ${{ secrets.github_token }}
|
||||
working-directory: ${{ env.docker-config-path }}
|
||||
- name: Run Coverity
|
||||
run: source/ci/coverity.sh
|
||||
env:
|
||||
COVERITY_TOKEN: ${{ secrets.coverity_token }}
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,7 +1,8 @@
|
||||
build/
|
||||
/build/
|
||||
.DS_Store
|
||||
*~
|
||||
.*.swp
|
||||
tags
|
||||
/tags
|
||||
CMakeSettings.json
|
||||
.vs
|
||||
.idea
|
||||
|
27
.vscode/launch.json
vendored
Normal file
27
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "(gdb) Launch",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/build/libgit2_clar",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${fileDirname}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
27
.vscode/tasks.json
vendored
Normal file
27
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Build",
|
||||
"type": "shell",
|
||||
"command": "cd build && cmake --build . --parallel",
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "new"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Run Tests",
|
||||
"type": "shell",
|
||||
"command": "build/libgit2_clar -v",
|
||||
"group": "test",
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "new"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -13,7 +13,7 @@
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1)
|
||||
|
||||
project(libgit2 VERSION "1.1.0" LANGUAGES C)
|
||||
project(libgit2 VERSION "1.3.0" LANGUAGES C)
|
||||
|
||||
# Add find modules to the path
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${libgit2_SOURCE_DIR}/cmake/")
|
||||
@ -27,6 +27,7 @@ INCLUDE(AddCFlagIfSupported)
|
||||
INCLUDE(FindPkgLibraries)
|
||||
INCLUDE(FindThreads)
|
||||
INCLUDE(FindStatNsec)
|
||||
INCLUDE(Findfutimens)
|
||||
INCLUDE(GNUInstallDirs)
|
||||
INCLUDE(IdeSplitSources)
|
||||
INCLUDE(FeatureSummary)
|
||||
@ -49,8 +50,10 @@ OPTION(USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF)
|
||||
OPTION(USE_STANDALONE_FUZZERS "Enable standalone fuzzers (compatible with gcc)" OFF)
|
||||
OPTION(USE_LEAK_CHECKER "Run tests with leak checker" OFF)
|
||||
OPTION(DEBUG_POOL "Enable debug pool allocator" OFF)
|
||||
OPTION(DEBUG_STRICT_ALLOC "Enable strict allocator behavior" OFF)
|
||||
OPTION(DEBUG_STRICT_OPEN "Enable path validation in open" OFF)
|
||||
OPTION(ENABLE_WERROR "Enable compilation with -Werror" OFF)
|
||||
OPTION(USE_BUNDLED_ZLIB "Use the bundled version of zlib" OFF)
|
||||
OPTION(USE_BUNDLED_ZLIB "Use the bundled version of zlib. Can be set to one of Bundled(ON)/Chromium. The Chromium option requires a x86_64 processor with SSE4.2 and CLMUL" OFF)
|
||||
SET(USE_HTTP_PARSER "" CACHE STRING "Specifies the HTTP Parser implementation; either system or builtin.")
|
||||
OPTION(DEPRECATE_HARD "Do not include deprecated functions in the library" OFF)
|
||||
SET(REGEX_BACKEND "" CACHE STRING "Regular expression implementation. One of regcomp_l, pcre2, pcre, regcomp, or builtin.")
|
||||
@ -89,8 +92,8 @@ IF(WIN32)
|
||||
ENDIF()
|
||||
|
||||
IF(MSVC)
|
||||
# Enable MSVC CRTDBG memory leak reporting when in debug mode.
|
||||
OPTION(MSVC_CRTDBG "Enable CRTDBG memory leak reporting" OFF)
|
||||
# Enable leak checking using the debugging C runtime.
|
||||
OPTION(WIN32_LEAKCHECK "Enable leak reporting via crtdbg" OFF)
|
||||
ENDIF()
|
||||
|
||||
IF (DEPRECATE_HARD)
|
||||
@ -129,8 +132,8 @@ IF (MSVC)
|
||||
SET(CRT_FLAG_RELEASE "/MD")
|
||||
ENDIF()
|
||||
|
||||
IF (MSVC_CRTDBG)
|
||||
SET(GIT_MSVC_CRTDBG 1)
|
||||
IF (WIN32_LEAKCHECK)
|
||||
SET(GIT_WIN32_LEAKCHECK 1)
|
||||
SET(CRT_FLAG_DEBUG "${CRT_FLAG_DEBUG}")
|
||||
SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} Dbghelp.lib")
|
||||
ENDIF()
|
||||
@ -231,6 +234,8 @@ ELSE ()
|
||||
enable_warnings(unused-const-variable)
|
||||
enable_warnings(unused-function)
|
||||
enable_warnings(int-conversion)
|
||||
enable_warnings(c11-extensions)
|
||||
enable_warnings(c99-c11-compat)
|
||||
|
||||
# MinGW uses gcc, which expects POSIX formatting for printf, but
|
||||
# uses the Windows C library, which uses its own format specifiers.
|
||||
|
110
COPYING
110
COPYING
@ -420,7 +420,7 @@ The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
@ -1019,3 +1019,111 @@ following restrictions are are met:
|
||||
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Portions of the OpenSSL headers are included under the OpenSSL license:
|
||||
|
||||
Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
All rights reserved.
|
||||
|
||||
This package is an SSL implementation written
|
||||
by Eric Young (eay@cryptsoft.com).
|
||||
The implementation was written so as to conform with Netscapes SSL.
|
||||
|
||||
This library is free for commercial and non-commercial use as long as
|
||||
the following conditions are aheared to. The following conditions
|
||||
apply to all code found in this distribution, be it the RC4, RSA,
|
||||
lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
included with this distribution is covered by the same copyright terms
|
||||
except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
|
||||
Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
the code are not to be removed.
|
||||
If this package is used in a product, Eric Young should be given attribution
|
||||
as the author of the parts of the library used.
|
||||
This can be in the form of a textual message at program startup or
|
||||
in documentation (online or textual) provided with the package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. All advertising materials mentioning features or use of this software
|
||||
must display the following acknowledgement:
|
||||
"This product includes cryptographic software written by
|
||||
Eric Young (eay@cryptsoft.com)"
|
||||
The word 'cryptographic' can be left out if the rouines from the library
|
||||
being used are not cryptographic related :-).
|
||||
4. If you include any Windows specific code (or a derivative thereof) from
|
||||
the apps directory (application code) you must include an acknowledgement:
|
||||
"This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
||||
The licence and distribution terms for any publically available version or
|
||||
derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
copied and put under another distribution licence
|
||||
[including the GNU Public Licence.]
|
||||
|
||||
====================================================================
|
||||
Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
3. All advertising materials mentioning features or use of this
|
||||
software must display the following acknowledgment:
|
||||
"This product includes software developed by the OpenSSL Project
|
||||
for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
|
||||
4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
endorse or promote products derived from this software without
|
||||
prior written permission. For written permission, please contact
|
||||
openssl-core@openssl.org.
|
||||
|
||||
5. Products derived from this software may not be called "OpenSSL"
|
||||
nor may "OpenSSL" appear in their names without prior written
|
||||
permission of the OpenSSL Project.
|
||||
|
||||
6. Redistributions of any form whatsoever must retain the following
|
||||
acknowledgment:
|
||||
"This product includes software developed by the OpenSSL Project
|
||||
for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
43
README.md
43
README.md
@ -3,10 +3,10 @@ libgit2 - the Git linkable library
|
||||
|
||||
| Build Status | |
|
||||
| ------------ | - |
|
||||
| **master** branch CI builds | [](https://dev.azure.com/libgit2/libgit2/_build/latest?definitionId=7&branchName=master) |
|
||||
| **v1.0 branch** CI builds | [](https://dev.azure.com/libgit2/libgit2/_build/latest?definitionId=7&branchName=maint/v1.0) |
|
||||
| **v0.28 branch** CI builds | [](https://dev.azure.com/libgit2/libgit2/_build/latest?definitionId=7&branchName=maint/v0.28) |
|
||||
| **Nightly** builds | [](https://libgit2.visualstudio.com/libgit2/_build/latest?definitionId=9&branchName=master) [](https://dev.azure.com/libgit2/libgit2/_build/latest?definitionId=21?branchName=master) [](https://scan.coverity.com/projects/639) |
|
||||
| **main** branch CI builds | [](https://github.com/libgit2/libgit2/actions?query=workflow%3A%22CI+Build%22+event%3Apush) |
|
||||
| **v1.2 branch** CI builds | [](https://github.com/libgit2/libgit2/actions?query=workflow%3A%22CI+Build%22+event%3Apush+branch%3Amaint%2Fv1.2) |
|
||||
| **v1.1 branch** CI builds | [](https://github.com/libgit2/libgit2/actions?query=workflow%3A%22CI+Build%22+event%3Apush+branch%3Amaint%2Fv1.1) |
|
||||
| **Nightly** builds | [](https://github.com/libgit2/libgit2/actions?query=workflow%3A%22Nightly+Build%22) [](https://scan.coverity.com/projects/639) |
|
||||
|
||||
`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
|
||||
@ -33,6 +33,7 @@ Additionally, the example code has been released to the public domain (see the
|
||||
Table of Contents
|
||||
=================
|
||||
|
||||
* [Using libgit2](#using-libgit2)
|
||||
* [Quick Start](#quick-start)
|
||||
* [Getting Help](#getting-help)
|
||||
* [What It Can Do](#what-it-can-do)
|
||||
@ -52,6 +53,28 @@ Table of Contents
|
||||
* [How Can I Contribute?](#how-can-i-contribute)
|
||||
* [License](#license)
|
||||
|
||||
Using libgit2
|
||||
=============
|
||||
|
||||
Most of these instructions assume that you're writing an application
|
||||
in C and want to use libgit2 directly. If you're _not_ using C,
|
||||
and you're writing in a different language or platform like .NET,
|
||||
Node.js, or Ruby, then there is probably a
|
||||
"[language binding](#language-bindings)" that you can use to take care
|
||||
of the messy tasks of calling into native code.
|
||||
|
||||
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.
|
||||
There are packages for the
|
||||
[vcpkg](https://github.com/Microsoft/vcpkg) and
|
||||
[conan](https://conan.io/center/libgit2)
|
||||
package managers. And libgit2 is available in
|
||||
[Homebrew](https://formulae.brew.sh/formula/libgit2) and most Linux
|
||||
distributions.
|
||||
|
||||
However, these versions _may_ be outdated and we recommend using the
|
||||
latest version if possible. Thankfully libgit2 is not hard to compile.
|
||||
|
||||
Quick Start
|
||||
===========
|
||||
|
||||
@ -81,7 +104,8 @@ Getting Help
|
||||
|
||||
**Chat with us**
|
||||
|
||||
- via IRC: join [#libgit2](https://webchat.freenode.net/#libgit2) on Freenode
|
||||
- via IRC: join [#libgit2](https://web.libera.chat/#libgit2) on
|
||||
[libera](https://libera.chat).
|
||||
- via Slack: visit [slack.libgit2.org](http://slack.libgit2.org/) to sign up,
|
||||
then join us in `#libgit2`
|
||||
|
||||
@ -201,6 +225,8 @@ On most systems you can build the library using the following commands
|
||||
|
||||
Alternatively you can point the CMake GUI tool to the CMakeLists.txt file and generate platform specific build project or IDE workspace.
|
||||
|
||||
If you're not familiar with CMake, [a more detailed explanation](https://preshing.com/20170511/how-to-build-a-cmake-based-project/) may be helpful.
|
||||
|
||||
Running Tests
|
||||
-------------
|
||||
|
||||
@ -219,7 +245,7 @@ run the index tests:
|
||||
$ ./libgit2_clar -sindex
|
||||
|
||||
To run a single test named `index::racy::diff`, which corresponds to the test
|
||||
function [`test_index_racy__diff`](https://github.com/libgit2/libgit2/blob/master/tests/index/racy.c#L23):
|
||||
function [`test_index_racy__diff`](https://github.com/libgit2/libgit2/blob/main/tests/index/racy.c#L23):
|
||||
|
||||
$ ./libgit2_clar -sindex::racy::diff
|
||||
|
||||
@ -229,7 +255,7 @@ applicable to your platform or is particularly expensive.
|
||||
|
||||
**Note:** There should be _no_ failing tests when you build an unmodified
|
||||
source tree from a [release](https://github.com/libgit2/libgit2/releases),
|
||||
or from the [master branch](https://github.com/libgit2/libgit2/tree/master).
|
||||
or from the [main branch](https://github.com/libgit2/libgit2/tree/main).
|
||||
Please contact us or [open an issue](https://github.com/libgit2/libgit2/issues)
|
||||
if you see test failures.
|
||||
|
||||
@ -332,6 +358,7 @@ Here are the bindings to libgit2 that are currently available:
|
||||
* dlibgit <https://github.com/s-ludwig/dlibgit>
|
||||
* Delphi
|
||||
* GitForDelphi <https://github.com/libgit2/GitForDelphi>
|
||||
* libgit2-delphi <https://github.com/todaysoftware/libgit2-delphi>
|
||||
* Erlang
|
||||
* Geef <https://github.com/carlosmn/geef>
|
||||
* Go
|
||||
@ -344,6 +371,7 @@ Here are the bindings to libgit2 that are currently available:
|
||||
* hgit2 <https://github.com/jwiegley/gitlib>
|
||||
* Java
|
||||
* Jagged <https://github.com/ethomson/jagged>
|
||||
* Git24j <https://github.com/git24j/git24j>
|
||||
* Javascript / WebAssembly ( browser and nodejs )
|
||||
* WASM-git <https://github.com/petersalomonsen/wasm-git>
|
||||
* Julia
|
||||
@ -369,6 +397,7 @@ Here are the bindings to libgit2 that are currently available:
|
||||
* Python
|
||||
* pygit2 <https://github.com/libgit2/pygit2>
|
||||
* R
|
||||
* gert <https://docs.ropensci.org/gert>
|
||||
* git2r <https://github.com/ropensci/git2r>
|
||||
* Ruby
|
||||
* Rugged <https://github.com/libgit2/rugged>
|
||||
|
@ -1,153 +0,0 @@
|
||||
resources:
|
||||
- repo: self
|
||||
|
||||
trigger:
|
||||
- master
|
||||
- maint/*
|
||||
|
||||
jobs:
|
||||
- job: linux_amd64_xenial_gcc_openssl
|
||||
displayName: 'Linux (amd64; Xenial; GCC; OpenSSL)'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- template: azure-pipelines/docker.yml
|
||||
parameters:
|
||||
docker:
|
||||
image: xenial
|
||||
base: ubuntu:xenial
|
||||
environmentVariables: |
|
||||
CC=gcc
|
||||
CMAKE_GENERATOR=Ninja
|
||||
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
|
||||
GITTEST_NEGOTIATE_PASSWORD=${{ variables.GITTEST_NEGOTIATE_PASSWORD }}
|
||||
|
||||
- job: linux_amd64_xenial_gcc_mbedtls
|
||||
displayName: 'Linux (amd64; Xenial; GCC; mbedTLS)'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- template: azure-pipelines/docker.yml
|
||||
parameters:
|
||||
docker:
|
||||
image: xenial
|
||||
base: ubuntu:xenial
|
||||
environmentVariables: |
|
||||
CC=gcc
|
||||
CMAKE_GENERATOR=Ninja
|
||||
CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
|
||||
GITTEST_NEGOTIATE_PASSWORD=${{ variables.GITTEST_NEGOTIATE_PASSWORD }}
|
||||
|
||||
- job: linux_amd64_xenial_clang_openssl
|
||||
displayName: 'Linux (amd64; Xenial; Clang; OpenSSL)'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- template: azure-pipelines/docker.yml
|
||||
parameters:
|
||||
docker:
|
||||
image: xenial
|
||||
base: ubuntu:xenial
|
||||
environmentVariables: |
|
||||
CC=clang
|
||||
CMAKE_GENERATOR=Ninja
|
||||
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
|
||||
GITTEST_NEGOTIATE_PASSWORD=${{ variables.GITTEST_NEGOTIATE_PASSWORD }}
|
||||
|
||||
- job: linux_amd64_xenial_clang_mbedtls
|
||||
displayName: 'Linux (amd64; Xenial; Clang; mbedTLS)'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- template: azure-pipelines/docker.yml
|
||||
parameters:
|
||||
docker:
|
||||
image: xenial
|
||||
base: ubuntu:xenial
|
||||
environmentVariables: |
|
||||
CC=clang
|
||||
CMAKE_GENERATOR=Ninja
|
||||
CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
|
||||
GITTEST_NEGOTIATE_PASSWORD=${{ variables.GITTEST_NEGOTIATE_PASSWORD }}
|
||||
|
||||
- job: macos
|
||||
displayName: 'macOS (amd64; 10.15)'
|
||||
pool:
|
||||
vmImage: 'macOS-10.15'
|
||||
steps:
|
||||
- bash: . '$(Build.SourcesDirectory)/azure-pipelines/setup-osx.sh'
|
||||
displayName: Setup
|
||||
- template: azure-pipelines/bash.yml
|
||||
parameters:
|
||||
environmentVariables:
|
||||
TMPDIR: $(Agent.TempDirectory)
|
||||
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
|
||||
CMAKE_GENERATOR: Ninja
|
||||
CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON
|
||||
SKIP_SSH_TESTS: true
|
||||
GITTEST_NEGOTIATE_PASSWORD: ${{ variables.GITTEST_NEGOTIATE_PASSWORD }}
|
||||
|
||||
- job: windows_vs_amd64
|
||||
displayName: 'Windows (amd64; Visual Studio)'
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
steps:
|
||||
- template: azure-pipelines/bash.yml
|
||||
parameters:
|
||||
environmentVariables:
|
||||
CMAKE_GENERATOR: Visual Studio 15 2017
|
||||
CMAKE_OPTIONS: -A x64 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
|
||||
- job: windows_vs_x86
|
||||
displayName: 'Windows (x86; Visual Studio)'
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
steps:
|
||||
- template: azure-pipelines/bash.yml
|
||||
parameters:
|
||||
environmentVariables:
|
||||
CMAKE_GENERATOR: Visual Studio 15 2017
|
||||
CMAKE_OPTIONS: -A Win32 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS -DUSE_BUNDLED_ZLIB=ON
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
|
||||
- job: windows_mingw_amd64
|
||||
displayName: 'Windows (amd64; MinGW)'
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
steps:
|
||||
- bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh'
|
||||
displayName: Setup
|
||||
env:
|
||||
TEMP: $(Agent.TempDirectory)
|
||||
ARCH: amd64
|
||||
- template: azure-pipelines/bash.yml
|
||||
parameters:
|
||||
environmentVariables:
|
||||
BUILD_PATH: $(Agent.TempDirectory)\mingw64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
|
||||
CMAKE_GENERATOR: MinGW Makefiles
|
||||
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
||||
|
||||
- job: windows_mingw_x86
|
||||
displayName: 'Windows (x86; MinGW)'
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
steps:
|
||||
- bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh'
|
||||
displayName: Setup
|
||||
workingDirectory: '$(Build.BinariesDirectory)'
|
||||
env:
|
||||
TEMP: $(Agent.TempDirectory)
|
||||
ARCH: x86
|
||||
- template: azure-pipelines/bash.yml
|
||||
parameters:
|
||||
environmentVariables:
|
||||
BUILD_PATH: $(Agent.TempDirectory)\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
|
||||
CMAKE_GENERATOR: MinGW Makefiles
|
||||
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
|
||||
SKIP_SSH_TESTS: true
|
||||
SKIP_NEGOTIATE_TESTS: true
|
@ -1,17 +0,0 @@
|
||||
# These are the steps used for building on machines with bash.
|
||||
steps:
|
||||
- bash: . '$(Build.SourcesDirectory)/azure-pipelines/build.sh'
|
||||
displayName: Build
|
||||
workingDirectory: '$(Build.BinariesDirectory)'
|
||||
env: ${{ parameters.environmentVariables }}
|
||||
- bash: . '$(Build.SourcesDirectory)/azure-pipelines/test.sh'
|
||||
displayName: Test
|
||||
workingDirectory: '$(Build.BinariesDirectory)'
|
||||
env: ${{ parameters.environmentVariables }}
|
||||
- task: PublishTestResults@2
|
||||
displayName: Publish Test Results
|
||||
condition: succeededOrFailed()
|
||||
inputs:
|
||||
testResultsFiles: 'results_*.xml'
|
||||
searchFolder: '$(Build.BinariesDirectory)'
|
||||
mergeTestResults: true
|
@ -1,26 +0,0 @@
|
||||
resources:
|
||||
- repo: self
|
||||
|
||||
jobs:
|
||||
- job: coverity
|
||||
displayName: 'Coverity'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- script: |
|
||||
cd $(Build.SourcesDirectory)/azure-pipelines/docker
|
||||
docker build -t libgit2/xenial --build-arg BASE=ubuntu:xenial -f xenial .
|
||||
displayName: 'Build Docker image'
|
||||
- task: Docker@0
|
||||
displayName: Analyze
|
||||
inputs:
|
||||
action: 'Run an image'
|
||||
imageName: libgit2/xenial
|
||||
volumes: |
|
||||
$(Build.SourcesDirectory):/home/libgit2/source
|
||||
$(Build.BinariesDirectory):/home/libgit2/build
|
||||
envVars: |
|
||||
COVERITY_TOKEN=$(COVERITY_TOKEN)
|
||||
workDir: '/home/libgit2/build'
|
||||
containerCommand: '/home/libgit2/source/azure-pipelines/coverity.sh'
|
||||
detached: false
|
@ -1,51 +0,0 @@
|
||||
# These are the steps used in a container-based build in VSTS.
|
||||
steps:
|
||||
- ${{ if eq(parameters.qemu, 'true') }}:
|
||||
- script: docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
displayName: 'Register Docker QEMU'
|
||||
|
||||
- task: cache@2
|
||||
displayName: Cache Docker layers
|
||||
inputs:
|
||||
key: docker
|
||||
path: /tmp/dockercache
|
||||
- script: |
|
||||
if [ -f /tmp/dockercache/${{parameters.docker.image}}.tar ]; then docker load < /tmp/dockercache/${{parameters.docker.image}}.tar; fi
|
||||
displayName: 'Load Docker cache'
|
||||
- script: |
|
||||
cd $(Build.SourcesDirectory)/azure-pipelines/docker &&
|
||||
docker build -t libgit2/${{parameters.docker.image}} --build-arg BASE=${{parameters.docker.base}} -f ${{parameters.docker.image}} . &&
|
||||
if [ ! -d /tmp/dockercache ]; then mkdir /tmp/dockercache; fi &&
|
||||
docker save libgit2/${{parameters.docker.image}} $(docker history -q libgit2/${{parameters.docker.image}} | grep -v '<missing>') > /tmp/dockercache/${{parameters.docker.image}}.tar
|
||||
displayName: 'Build Docker image'
|
||||
- task: docker@0
|
||||
displayName: Build
|
||||
inputs:
|
||||
action: 'Run an image'
|
||||
imageName: libgit2/${{ parameters.docker.image }}
|
||||
volumes: |
|
||||
$(Build.SourcesDirectory):/home/libgit2/source
|
||||
$(Build.BinariesDirectory):/home/libgit2/build
|
||||
envVars: ${{ parameters.environmentVariables }}
|
||||
workDir: '/home/libgit2/build'
|
||||
containerCommand: '/home/libgit2/source/azure-pipelines/build.sh'
|
||||
detached: false
|
||||
- task: docker@0
|
||||
displayName: Test
|
||||
inputs:
|
||||
action: 'Run an image'
|
||||
imageName: libgit2/${{ parameters.docker.image }}
|
||||
volumes: |
|
||||
$(Build.SourcesDirectory):/home/libgit2/source
|
||||
$(Build.BinariesDirectory):/home/libgit2/build
|
||||
envVars: ${{ parameters.environmentVariables }}
|
||||
workDir: '/home/libgit2/build'
|
||||
containerCommand: '/home/libgit2/source/azure-pipelines/test.sh'
|
||||
detached: false
|
||||
- task: publishtestresults@2
|
||||
displayName: Publish Test Results
|
||||
condition: succeededOrFailed()
|
||||
inputs:
|
||||
testResultsFiles: 'results_*.xml'
|
||||
searchFolder: '$(Build.BinariesDirectory)'
|
||||
mergeTestResults: true
|
@ -1,4 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
useradd --shell /bin/bash libgit2
|
||||
chown --recursive libgit2:libgit2 /home/libgit2
|
||||
exec sudo --preserve-env --set-home --user=libgit2 "$@"
|
@ -1,219 +0,0 @@
|
||||
resources:
|
||||
- repo: self
|
||||
|
||||
jobs:
|
||||
- job: linux_amd64_xenial_gcc_openssl
|
||||
displayName: 'Linux (amd64; Xenial; GCC; OpenSSL)'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- template: docker.yml
|
||||
parameters:
|
||||
docker:
|
||||
image: xenial
|
||||
base: ubuntu:xenial
|
||||
environmentVariables: |
|
||||
CC=gcc
|
||||
CMAKE_GENERATOR=Ninja
|
||||
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
|
||||
RUN_INVASIVE_TESTS=true
|
||||
|
||||
- job: linux_amd64_xenial_gcc_mbedtls
|
||||
displayName: 'Linux (amd64; Xenial; GCC; mbedTLS)'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- template: docker.yml
|
||||
parameters:
|
||||
docker:
|
||||
image: xenial
|
||||
base: ubuntu:xenial
|
||||
environmentVariables: |
|
||||
CC=gcc
|
||||
CMAKE_GENERATOR=Ninja
|
||||
CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
|
||||
RUN_INVASIVE_TESTS=true
|
||||
|
||||
- job: linux_amd64_xenial_clang_openssl
|
||||
displayName: 'Linux (amd64; Xenial; Clang; OpenSSL)'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- template: docker.yml
|
||||
parameters:
|
||||
docker:
|
||||
image: xenial
|
||||
base: ubuntu:xenial
|
||||
environmentVariables: |
|
||||
CC=clang
|
||||
CMAKE_GENERATOR=Ninja
|
||||
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
|
||||
RUN_INVASIVE_TESTS=true
|
||||
|
||||
- job: linux_amd64_xenial_clang_mbedtls
|
||||
displayName: 'Linux (amd64; Xenial; Clang; mbedTLS)'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- template: docker.yml
|
||||
parameters:
|
||||
docker:
|
||||
image: xenial
|
||||
base: ubuntu:xenial
|
||||
environmentVariables: |
|
||||
CC=clang
|
||||
CMAKE_GENERATOR=Ninja
|
||||
CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
|
||||
RUN_INVASIVE_TESTS=true
|
||||
|
||||
- job: macos
|
||||
displayName: 'macOS (amd64; 10.15)'
|
||||
pool:
|
||||
vmImage: 'macOS-10.15'
|
||||
steps:
|
||||
- bash: . '$(Build.SourcesDirectory)/azure-pipelines/setup-osx.sh'
|
||||
displayName: Setup
|
||||
- template: bash.yml
|
||||
parameters:
|
||||
environmentVariables:
|
||||
TMPDIR: $(Agent.TempDirectory)
|
||||
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
|
||||
CMAKE_GENERATOR: Ninja
|
||||
CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON
|
||||
RUN_INVASIVE_TESTS: true
|
||||
SKIP_SSH_TESTS: true
|
||||
|
||||
- job: windows_vs_amd64
|
||||
displayName: 'Windows (amd64; Visual Studio)'
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
steps:
|
||||
- template: bash.yml
|
||||
parameters:
|
||||
environmentVariables:
|
||||
CMAKE_GENERATOR: Visual Studio 15 2017
|
||||
CMAKE_OPTIONS: -A x64 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON
|
||||
RUN_INVASIVE_TESTS: true
|
||||
SKIP_SSH_TESTS: true
|
||||
|
||||
- job: windows_vs_x86
|
||||
displayName: 'Windows (x86; Visual Studio)'
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
steps:
|
||||
- template: bash.yml
|
||||
parameters:
|
||||
environmentVariables:
|
||||
CMAKE_GENERATOR: Visual Studio 15 2017
|
||||
CMAKE_OPTIONS: -A Win32 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS
|
||||
RUN_INVASIVE_TESTS: true
|
||||
SKIP_SSH_TESTS: true
|
||||
|
||||
- job: windows_mingw_amd64
|
||||
displayName: 'Windows (amd64; MinGW)'
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
steps:
|
||||
- bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh'
|
||||
displayName: Setup
|
||||
env:
|
||||
TEMP: $(Agent.TempDirectory)
|
||||
ARCH: amd64
|
||||
- template: bash.yml
|
||||
parameters:
|
||||
environmentVariables:
|
||||
BUILD_PATH: $(Agent.TempDirectory)\mingw64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
|
||||
CMAKE_GENERATOR: MinGW Makefiles
|
||||
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
|
||||
RUN_INVASIVE_TESTS: true
|
||||
SKIP_SSH_TESTS: true
|
||||
|
||||
- job: windows_mingw_x86
|
||||
displayName: 'Windows (x86; MinGW)'
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
steps:
|
||||
- bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh'
|
||||
displayName: Setup
|
||||
workingDirectory: '$(Build.BinariesDirectory)'
|
||||
env:
|
||||
TEMP: $(Agent.TempDirectory)
|
||||
ARCH: x86
|
||||
- template: bash.yml
|
||||
parameters:
|
||||
environmentVariables:
|
||||
BUILD_PATH: $(Agent.TempDirectory)\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
|
||||
CMAKE_GENERATOR: MinGW Makefiles
|
||||
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
|
||||
RUN_INVASIVE_TESTS: true
|
||||
SKIP_SSH_TESTS: true
|
||||
|
||||
- job: linux_x86_bionic_gcc_openssl
|
||||
displayName: 'Linux (x86; Bionic; GCC; OpenSSL)'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- template: docker.yml
|
||||
parameters:
|
||||
qemu: 'true'
|
||||
docker:
|
||||
image: bionic
|
||||
base: multiarch/ubuntu-core:x86-bionic
|
||||
environmentVariables: |
|
||||
CC=gcc
|
||||
CMAKE_GENERATOR=Ninja
|
||||
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
|
||||
RUN_INVASIVE_TESTS=true
|
||||
|
||||
- job: linux_x86_bionic_clang_openssl
|
||||
displayName: 'Linux (x86; Bionic; Clang; OpenSSL)'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- template: docker.yml
|
||||
parameters:
|
||||
qemu: 'true'
|
||||
docker:
|
||||
image: bionic
|
||||
base: multiarch/ubuntu-core:x86-bionic
|
||||
environmentVariables: |
|
||||
CC=clang
|
||||
CMAKE_GENERATOR=Ninja
|
||||
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind
|
||||
RUN_INVASIVE_TESTS=true
|
||||
|
||||
- job: linux_arm32_bionic_gcc_openssl
|
||||
displayName: 'Linux (arm32; Bionic; GCC; OpenSSL)'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- template: docker.yml
|
||||
parameters:
|
||||
qemu: 'true'
|
||||
docker:
|
||||
image: bionic
|
||||
base: multiarch/ubuntu-core:armhf-bionic
|
||||
environmentVariables: |
|
||||
CC=gcc
|
||||
CMAKE_GENERATOR=Ninja
|
||||
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON
|
||||
RUN_INVASIVE_TESTS=true
|
||||
SKIP_PROXY_TESTS=true
|
||||
|
||||
- job: linux_arm64_bionic_gcc_openssl
|
||||
displayName: 'Linux (arm64; Bionic; GCC; OpenSSL)'
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- template: docker.yml
|
||||
parameters:
|
||||
qemu: 'true'
|
||||
docker:
|
||||
image: bionic
|
||||
base: multiarch/ubuntu-core:arm64-bionic
|
||||
environmentVariables: |
|
||||
CC=gcc
|
||||
CMAKE_GENERATOR=Ninja
|
||||
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON
|
||||
RUN_INVASIVE_TESTS=true
|
||||
SKIP_PROXY_TESTS=true
|
@ -33,6 +33,9 @@ if [ -f "/etc/debian_version" ]; then
|
||||
(source /etc/lsb-release && echo "${DISTRIB_DESCRIPTION}") | indent
|
||||
fi
|
||||
|
||||
CORES=$(getconf _NPROCESSORS_ONLN || true)
|
||||
echo "Number of cores: ${CORES:-(Unknown)}"
|
||||
|
||||
echo "Kernel version:"
|
||||
uname -a 2>&1 | indent
|
||||
|
||||
@ -64,4 +67,12 @@ echo "##########################################################################
|
||||
echo "## Building libgit2"
|
||||
echo "##############################################################################"
|
||||
|
||||
env PATH="${BUILD_PATH}" "${CMAKE}" --build .
|
||||
# Determine parallelism; newer cmake supports `--build --parallel` but
|
||||
# we cannot yet rely on that.
|
||||
if [ "${CMAKE_GENERATOR}" = "Unix Makefiles" -a "${CORES}" != "" ]; then
|
||||
BUILDER=(make -j ${CORES})
|
||||
else
|
||||
BUILDER=("${CMAKE}" --build .)
|
||||
fi
|
||||
|
||||
env PATH="${BUILD_PATH}" "${BUILDER[@]}"
|
@ -1,4 +1,6 @@
|
||||
FROM ubuntu:bionic AS apt
|
||||
ARG BASE=ubuntu:bionic
|
||||
|
||||
FROM ${BASE} AS apt
|
||||
RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
clang \
|
||||
@ -6,7 +8,9 @@ RUN apt-get update && \
|
||||
curl \
|
||||
gcc \
|
||||
git \
|
||||
krb5-user \
|
||||
libcurl4-openssl-dev \
|
||||
libkrb5-dev \
|
||||
libpcre3-dev \
|
||||
libssh2-1-dev \
|
||||
libssl-dev \
|
||||
@ -33,9 +37,8 @@ RUN cd /tmp && \
|
||||
cd .. && \
|
||||
rm -rf mbedtls-2.16.2
|
||||
|
||||
FROM mbedtls AS configure
|
||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
RUN chmod a+x /usr/local/bin/entrypoint.sh
|
||||
RUN mkdir /var/run/sshd
|
||||
FROM mbedtls AS adduser
|
||||
RUN useradd --shell /bin/bash libgit2 --create-home
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
FROM adduser AS configure
|
||||
RUN mkdir /var/run/sshd
|
55
ci/docker/centos7
Normal file
55
ci/docker/centos7
Normal file
@ -0,0 +1,55 @@
|
||||
ARG BASE=centos:7
|
||||
|
||||
FROM ${BASE} AS yum
|
||||
RUN yum install -y \
|
||||
which \
|
||||
bzip2 \
|
||||
git \
|
||||
libarchive \
|
||||
gcc \
|
||||
gcc-c++ \
|
||||
make \
|
||||
openssl-devel \
|
||||
openssh-server \
|
||||
git-daemon \
|
||||
java-1.8.0-openjdk-headless \
|
||||
sudo \
|
||||
python
|
||||
|
||||
FROM yum AS libssh2
|
||||
RUN cd /tmp && \
|
||||
curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.8.0.tar.gz | tar -xz && \
|
||||
cd libssh2-1.8.0 && \
|
||||
./configure && \
|
||||
make && \
|
||||
make install && \
|
||||
cd .. && \
|
||||
rm -rf libssh-1.8.0
|
||||
|
||||
FROM libssh2 AS valgrind
|
||||
RUN cd /tmp && \
|
||||
curl --insecure --location --silent --show-error https://sourceware.org/pub/valgrind/valgrind-3.15.0.tar.bz2 | \
|
||||
tar -xj && \
|
||||
cd valgrind-3.15.0 && \
|
||||
./configure && \
|
||||
make MAKEFLAGS="-j -l$(grep -c ^processor /proc/cpuinfo)" && \
|
||||
make install && \
|
||||
cd .. && \
|
||||
rm -rf valgrind-3.15.0
|
||||
|
||||
FROM valgrind AS cmake
|
||||
RUN cd /tmp && \
|
||||
curl -L https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1.tar.gz | tar -xz && \
|
||||
cd cmake-3.21.1 && \
|
||||
./configure && \
|
||||
make && \
|
||||
make install && \
|
||||
cd .. && \
|
||||
rm -rf cmake-3.21.1
|
||||
|
||||
FROM cmake AS adduser
|
||||
RUN useradd --shell /bin/bash libgit2 --create-home
|
||||
|
||||
FROM adduser AS configure
|
||||
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
|
||||
RUN mkdir /var/run/sshd
|
49
ci/docker/centos8
Normal file
49
ci/docker/centos8
Normal file
@ -0,0 +1,49 @@
|
||||
ARG BASE=centos:8
|
||||
|
||||
FROM ${BASE} 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 \
|
||||
python39 \
|
||||
krb5-workstation \
|
||||
krb5-libs
|
||||
|
||||
FROM yum AS libssh2
|
||||
RUN cd /tmp && \
|
||||
curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.8.0.tar.gz | tar -xz && \
|
||||
cd libssh2-1.8.0 && \
|
||||
./configure && \
|
||||
make && \
|
||||
make install && \
|
||||
cd .. && \
|
||||
rm -rf libssh2-1.8.0
|
||||
|
||||
FROM libssh2 AS valgrind
|
||||
RUN cd /tmp && \
|
||||
curl --insecure --location --silent --show-error https://sourceware.org/pub/valgrind/valgrind-3.15.0.tar.bz2 | \
|
||||
tar -xj && \
|
||||
cd valgrind-3.15.0 && \
|
||||
./configure && \
|
||||
make MAKEFLAGS="-j -l$(grep -c ^processor /proc/cpuinfo)" && \
|
||||
make install && \
|
||||
cd .. && \
|
||||
rm -rf valgrind-3.15.0
|
||||
|
||||
FROM valgrind AS adduser
|
||||
RUN useradd --shell /bin/bash libgit2 --create-home
|
||||
|
||||
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
|
@ -1,3 +1,5 @@
|
||||
FROM ubuntu:bionic
|
||||
ARG BASE=ubuntu:bionic
|
||||
|
||||
FROM ${BASE}
|
||||
RUN apt update && apt install -y cmake pkg-config ruby ruby-dev llvm libclang-dev libssl-dev python-pygments
|
||||
RUN gem install docurium
|
@ -1,4 +1,6 @@
|
||||
FROM ubuntu:focal AS apt
|
||||
ARG BASE=ubuntu:focal
|
||||
|
||||
FROM ${BASE} AS apt
|
||||
RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
bzip2 \
|
||||
@ -47,9 +49,8 @@ RUN cd /tmp && \
|
||||
|
||||
FROM mbedtls AS libssh2
|
||||
RUN cd /tmp && \
|
||||
curl --insecure --location --silent --show-error https://www.libssh2.org/download/libssh2-1.8.2.tar.gz | \
|
||||
tar -xz && \
|
||||
cd libssh2-1.8.2 && \
|
||||
curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.9.0.tar.gz | tar -xz && \
|
||||
cd libssh2-1.9.0 && \
|
||||
mkdir build build-msan && \
|
||||
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 .. && \
|
||||
@ -58,7 +59,7 @@ RUN cd /tmp && \
|
||||
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 .. && \
|
||||
ninja install && \
|
||||
cd .. && \
|
||||
rm -rf libssh2-1.8.2
|
||||
rm -rf libssh2-1.9.0
|
||||
|
||||
FROM libssh2 AS valgrind
|
||||
RUN cd /tmp && \
|
||||
@ -71,9 +72,8 @@ RUN cd /tmp && \
|
||||
cd .. && \
|
||||
rm -rf valgrind-3.15.0
|
||||
|
||||
FROM valgrind AS configure
|
||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
RUN chmod a+x /usr/local/bin/entrypoint.sh
|
||||
RUN mkdir /var/run/sshd
|
||||
FROM valgrind AS adduser
|
||||
RUN useradd --shell /bin/bash libgit2 --create-home
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
FROM adduser AS configure
|
||||
RUN mkdir /var/run/sshd
|
@ -1,4 +1,6 @@
|
||||
FROM ubuntu:xenial AS apt
|
||||
ARG BASE=ubuntu:xenial
|
||||
|
||||
FROM ${BASE} AS apt
|
||||
RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
bzip2 \
|
||||
@ -39,8 +41,7 @@ RUN cd /tmp && \
|
||||
|
||||
FROM mbedtls AS libssh2
|
||||
RUN cd /tmp && \
|
||||
curl --insecure --location --silent --show-error https://www.libssh2.org/download/libssh2-1.8.2.tar.gz | \
|
||||
tar -xz && \
|
||||
curl --location --silent --show-error https://www.libssh2.org/download/libssh2-1.8.2.tar.gz | tar -xz && \
|
||||
cd libssh2-1.8.2 && \
|
||||
CFLAGS=-fPIC cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCRYPTO_BACKEND=Libgcrypt . && \
|
||||
ninja install && \
|
||||
@ -58,9 +59,8 @@ RUN cd /tmp && \
|
||||
cd .. && \
|
||||
rm -rf valgrind-3.15.0
|
||||
|
||||
FROM valgrind AS configure
|
||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
RUN chmod a+x /usr/local/bin/entrypoint.sh
|
||||
RUN mkdir /var/run/sshd
|
||||
FROM valgrind AS adduser
|
||||
RUN useradd --shell /bin/bash libgit2 --create-home
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
FROM adduser AS configure
|
||||
RUN mkdir /var/run/sshd
|
@ -2,11 +2,16 @@
|
||||
|
||||
set -e
|
||||
|
||||
DOCKERFILE_PATH=$1
|
||||
IMAGE_NAME=$1
|
||||
DOCKERFILE_PATH=$2
|
||||
|
||||
if [ "${IMAGE_NAME}" = "" ]; then
|
||||
echo "usage: $0 image_name [dockerfile]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "${DOCKERFILE_PATH}" = "" ]; then
|
||||
echo "usage: $0 dockerfile"
|
||||
exit 1
|
||||
DOCKERFILE_PATH="${IMAGE_NAME}"
|
||||
fi
|
||||
|
||||
if [ "${DOCKER_REGISTRY}" = "" ]; then
|
||||
@ -15,21 +20,22 @@ if [ "${DOCKER_REGISTRY}" = "" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DOCKER_CONTAINER="${GITHUB_REPOSITORY}/$(basename ${DOCKERFILE_PATH})"
|
||||
DOCKER_CONTAINER="${GITHUB_REPOSITORY}/${IMAGE_NAME}"
|
||||
DOCKER_REGISTRY_CONTAINER="${DOCKER_REGISTRY}/${DOCKER_CONTAINER}"
|
||||
|
||||
echo "::set-env name=docker-container::${DOCKER_CONTAINER}"
|
||||
echo "::set-env name=docker-registry-container::${DOCKER_REGISTRY_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 "::set-env name=docker-sha::${DOCKER_SHA}"
|
||||
echo "docker-sha=${DOCKER_SHA}" >> $GITHUB_ENV
|
||||
|
||||
DOCKER_REGISTRY_CONTAINER_SHA="${DOCKER_REGISTRY_CONTAINER}:${DOCKER_SHA}"
|
||||
|
||||
echo "::set-env name=docker-registry-container-sha::${DOCKER_REGISTRY_CONTAINER_SHA}"
|
||||
echo "::set-env name=docker-registry-container-latest::${DOCKER_REGISTRY_CONTAINER}:latest"
|
||||
echo "docker-registry-container-sha=${DOCKER_REGISTRY_CONTAINER_SHA}" >> $GITHUB_ENV
|
||||
echo "docker-registry-container-latest=${DOCKER_REGISTRY_CONTAINER}:latest" >> $GITHUB_ENV
|
||||
|
||||
exists="true"
|
||||
docker login https://${DOCKER_REGISTRY} -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN} || exists="false"
|
||||
@ -39,7 +45,7 @@ if [ "${exists}" != "false" ]; then
|
||||
fi
|
||||
|
||||
if [ "${exists}" = "true" ]; then
|
||||
echo "::set-env name=docker-container-exists::true"
|
||||
echo "docker-container-exists=true" >> $GITHUB_ENV
|
||||
else
|
||||
echo "::set-env name=docker-container-exists::false"
|
||||
echo "docker-container-exists=false" >> $GITHUB_ENV
|
||||
fi
|
@ -9,9 +9,9 @@ BUILD_TEMP=$(cygpath $BUILD_TEMP)
|
||||
|
||||
case "$ARCH" in
|
||||
amd64)
|
||||
MINGW_URI="https://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-x86_64-8.1.0-release-win32-seh-rt_v6-rev0.zip";;
|
||||
MINGW_URI="https://github.com/libgit2/ci-dependencies/releases/download/2021-05-04/mingw-x86_64-8.1.0-release-win32-sjlj-rt_v6-rev0.zip";;
|
||||
x86)
|
||||
MINGW_URI="https://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-i686-8.1.0-release-win32-sjlj-rt_v6-rev0.zip";;
|
||||
MINGW_URI="https://github.com/libgit2/ci-dependencies/releases/download/2021-05-04/mingw-i686-8.1.0-release-win32-sjlj-rt_v6-rev0.zip";;
|
||||
esac
|
||||
|
||||
if [ -z "$MINGW_URI" ]; then
|
@ -17,6 +17,7 @@ TMPDIR=${TMPDIR:-/tmp}
|
||||
USER=${USER:-$(whoami)}
|
||||
|
||||
SUCCESS=1
|
||||
CONTINUE_ON_FAILURE=0
|
||||
|
||||
cleanup() {
|
||||
echo "Cleaning up..."
|
||||
@ -64,6 +65,10 @@ run_test() {
|
||||
done
|
||||
|
||||
if [ "$FAILED" -ne 0 ]; then
|
||||
if [ "$CONTINUE_ON_FAILURE" -ne 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SUCCESS=0
|
||||
fi
|
||||
}
|
||||
@ -174,9 +179,9 @@ if [ -n "$RUN_INVASIVE_TESTS" ]; then
|
||||
fi
|
||||
|
||||
if [ -z "$SKIP_ONLINE_TESTS" ]; then
|
||||
# Run the various online tests. The "online" test suite only includes the
|
||||
# default online tests that do not require additional configuration. The
|
||||
# "proxy" and "ssh" test suites require further setup.
|
||||
# Run the online tests. The "online" test suite only includes the
|
||||
# default online tests that do not require additional configuration.
|
||||
# The "proxy" and "ssh" test suites require further setup.
|
||||
|
||||
echo ""
|
||||
echo "##############################################################################"
|
||||
@ -186,6 +191,14 @@ if [ -z "$SKIP_ONLINE_TESTS" ]; then
|
||||
export GITTEST_FLAKY_RETRY=5
|
||||
run_test online
|
||||
unset GITTEST_FLAKY_RETRY
|
||||
|
||||
# Run the online tests that immutably change global state separately
|
||||
# to avoid polluting the test environment.
|
||||
echo ""
|
||||
echo "##############################################################################"
|
||||
echo "## Running (online_customcert) tests"
|
||||
echo "##############################################################################"
|
||||
run_test online_customcert
|
||||
fi
|
||||
|
||||
if [ -z "$SKIP_GITDAEMON_TESTS" ]; then
|
13
cmake/FindLibSSH2.cmake
Normal file
13
cmake/FindLibSSH2.cmake
Normal file
@ -0,0 +1,13 @@
|
||||
# LIBSSH2_FOUND - system has the libssh2 library
|
||||
# LIBSSH2_INCLUDE_DIR - the libssh2 include directory
|
||||
# LIBSSH2_LIBRARY - the libssh2 library name
|
||||
|
||||
FIND_PATH(LIBSSH2_INCLUDE_DIR libssh2.h)
|
||||
|
||||
FIND_LIBRARY(LIBSSH2_LIBRARY NAMES ssh2 libssh2)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibSSH2
|
||||
REQUIRED_VARS LIBSSH2_LIBRARY LIBSSH2_INCLUDE_DIR)
|
||||
|
||||
MARK_AS_ADVANCED(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
|
14
cmake/Findfutimens.cmake
Normal file
14
cmake/Findfutimens.cmake
Normal file
@ -0,0 +1,14 @@
|
||||
INCLUDE(EnableWarnings)
|
||||
|
||||
IF (APPLE)
|
||||
# We cannot simply CHECK_FUNCTION_EXISTS on macOS because
|
||||
# MACOSX_DEPLOYMENT_TARGET may be set to a version in the past
|
||||
# that doesn't have futimens. Instead we need to enable warnings
|
||||
# as errors, then check for the symbol existing in `sys/stat.h`,
|
||||
# then reset warnings as errors.
|
||||
ENABLE_WARNINGS(error)
|
||||
CHECK_SYMBOL_EXISTS(futimens sys/stat.h HAVE_FUTIMENS)
|
||||
DISABLE_WARNINGS(error)
|
||||
ELSE ()
|
||||
CHECK_FUNCTION_EXISTS(futimens HAVE_FUTIMENS)
|
||||
ENDIF ()
|
@ -108,6 +108,10 @@ IF(USE_HTTPS)
|
||||
LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
|
||||
ELSEIF (USE_HTTPS STREQUAL "WinHTTP")
|
||||
# WinHTTP setup was handled in the WinHTTP-specific block above
|
||||
ELSEIF (USE_HTTPS STREQUAL "OpenSSL-Dynamic")
|
||||
SET(GIT_OPENSSL 1)
|
||||
SET(GIT_OPENSSL_DYNAMIC 1)
|
||||
LIST(APPEND LIBGIT2_LIBS dl)
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Asked for backend ${USE_HTTPS} but it wasn't found")
|
||||
ENDIF()
|
||||
|
@ -56,6 +56,7 @@ ELSE()
|
||||
MESSAGE(FATAL_ERROR "Asked for unknown SHA1 backend: ${USE_SHA1}")
|
||||
ENDIF()
|
||||
|
||||
list(APPEND SRC_SHA1 "hash/sha1.h")
|
||||
list(SORT SRC_SHA1)
|
||||
|
||||
ADD_FEATURE_INFO(SHA ON "using ${USE_SHA1}")
|
||||
|
@ -1,3 +1,235 @@
|
||||
v1.3
|
||||
----
|
||||
|
||||
This is release v1.3.0, "Zugunruhe". This release includes only minor new features that will be helpful for users to have an orderly transition to the v2.0 lineage.
|
||||
|
||||
## New Features
|
||||
* Support custom git extensions by @ethomson in https://github.com/libgit2/libgit2/pull/6031
|
||||
* Introduce `git_email_create`; deprecate `git_diff_format_email` by @ethomson in https://github.com/libgit2/libgit2/pull/6061
|
||||
|
||||
## Deprecated APIs
|
||||
* `git_oidarray_free` is deprecated; callers should use `git_oidarray_dispose`
|
||||
|
||||
## Bug fixes
|
||||
* #6028: Check if `threadstate->error_t.message` is not `git_buf__initbuf` before freeing. by @arroz in https://github.com/libgit2/libgit2/pull/6029
|
||||
* remote: Mark `git_remote_name_is_valid` as `GIT_EXTERN` by @lhchavez in https://github.com/libgit2/libgit2/pull/6032
|
||||
* Fix config parsing for multiline with multiple quoted comment chars by @basile-henry in https://github.com/libgit2/libgit2/pull/6043
|
||||
* indexer: Avoid one `mmap(2)`/`munmap(2)` pair per `git_indexer_append` call by @lhchavez in https://github.com/libgit2/libgit2/pull/6039
|
||||
* merge: Check file mode when resolving renames by @ccstolley in https://github.com/libgit2/libgit2/pull/6060
|
||||
* Allow proxy options when connecting with a detached remote. by @lrm29 in https://github.com/libgit2/libgit2/pull/6058
|
||||
* win32: allow empty environment variables by @ethomson in https://github.com/libgit2/libgit2/pull/6063
|
||||
* Fixes for deprecated APIs by @ethomson in https://github.com/libgit2/libgit2/pull/6066
|
||||
* filter: use a `git_oid` in filter options, not a pointer by @ethomson in https://github.com/libgit2/libgit2/pull/6067
|
||||
* diff: update `GIT_DIFF_IGNORE_BLANK_LINES` by @ethomson in https://github.com/libgit2/libgit2/pull/6068
|
||||
* Attribute lookups are always on relative paths by @ethomson in https://github.com/libgit2/libgit2/pull/6073
|
||||
* Handle long paths when querying attributes by @ethomson in https://github.com/libgit2/libgit2/pull/6075
|
||||
|
||||
## Code cleanups
|
||||
* notes: use a buffer internally by @ethomson in https://github.com/libgit2/libgit2/pull/6047
|
||||
* Fix coding style for pointer by @punkymaniac in https://github.com/libgit2/libgit2/pull/6045
|
||||
* Use __typeof__ GNUC keyword for ISO C compatibility by @duncanthomson in https://github.com/libgit2/libgit2/pull/6041
|
||||
* Discover libssh2 without pkg-config by @stac47 in https://github.com/libgit2/libgit2/pull/6053
|
||||
* Longpath filter bug by @lrm29 in https://github.com/libgit2/libgit2/pull/6055
|
||||
* Add test to ensure empty proxy env behaves like unset env by @sathieu in https://github.com/libgit2/libgit2/pull/6052
|
||||
* Stdint header condition has been reverted. by @lolgear in https://github.com/libgit2/libgit2/pull/6020
|
||||
* buf: `common_prefix` takes a string array by @ethomson in https://github.com/libgit2/libgit2/pull/6077
|
||||
* oidarray: introduce `git_oidarray_dispose` by @ethomson in https://github.com/libgit2/libgit2/pull/6076
|
||||
* examples: Free the git_config and git_config_entry after use by @257 in https://github.com/libgit2/libgit2/pull/6071
|
||||
|
||||
## CI Improvements
|
||||
* ci: pull libssh2 from www.libssh2.org by @ethomson in https://github.com/libgit2/libgit2/pull/6064
|
||||
|
||||
## Documentation changes
|
||||
* Update README.md by @shijinglu in https://github.com/libgit2/libgit2/pull/6050
|
||||
|
||||
## New Contributors
|
||||
* @basile-henry made their first contribution in https://github.com/libgit2/libgit2/pull/6043
|
||||
* @duncanthomson made their first contribution in https://github.com/libgit2/libgit2/pull/6041
|
||||
* @stac47 made their first contribution in https://github.com/libgit2/libgit2/pull/6053
|
||||
* @shijinglu made their first contribution in https://github.com/libgit2/libgit2/pull/6050
|
||||
* @ccstolley made their first contribution in https://github.com/libgit2/libgit2/pull/6060
|
||||
* @sathieu made their first contribution in https://github.com/libgit2/libgit2/pull/6052
|
||||
* @257 made their first contribution in https://github.com/libgit2/libgit2/pull/6071
|
||||
|
||||
**Full Changelog**: https://github.com/libgit2/libgit2/compare/v1.2.0...v1.3.0
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
v1.2
|
||||
-----
|
||||
|
||||
This is release v1.2.0, "Absacker". This release includes many new features: in particular, support for commit graphs, multi-pack indexes, and `core.longpaths` support.
|
||||
|
||||
This is meant to be the final minor release in the v1 lineage. v2.0 will be the next major release and will remove deprecated APIs and may include breaking changes.
|
||||
|
||||
## Deprecated APIs
|
||||
|
||||
* revspec: rename git_revparse_mode_t to git_revspec_t by @ethomson in https://github.com/libgit2/libgit2/pull/5786
|
||||
* tree: deprecate `git_treebuilder_write_with_buffer` by @ethomson in https://github.com/libgit2/libgit2/pull/5815
|
||||
* Deprecate `is_valid_name` functions; replace with `name_is_valid` functions by @ethomson in https://github.com/libgit2/libgit2/pull/5659
|
||||
* filter: stop taking git_buf as user input by @ethomson in https://github.com/libgit2/libgit2/pull/5859
|
||||
* remote: introduce remote_ready_cb, deprecate resolve_url callback by @ethomson in https://github.com/libgit2/libgit2/pull/6012
|
||||
* Introduce `create_commit_cb`, deprecate `signing_cb` by @ethomson in https://github.com/libgit2/libgit2/pull/6016
|
||||
* filter: filter drivers stop taking git_buf as user input by @ethomson in https://github.com/libgit2/libgit2/pull/6011
|
||||
* buf: deprecate public git_buf writing functions by @ethomson in https://github.com/libgit2/libgit2/pull/6017
|
||||
|
||||
## New features
|
||||
|
||||
* winhttp: support optional client cert by @ianhattendorf in https://github.com/libgit2/libgit2/pull/5384
|
||||
* Add support for additional SSH hostkey types. by @arroz in https://github.com/libgit2/libgit2/pull/5750
|
||||
* Handle ipv6 addresses by @ethomson in https://github.com/libgit2/libgit2/pull/5741
|
||||
* zlib: Add support for building with Chromium's zlib implementation by @lhchavez in https://github.com/libgit2/libgit2/pull/5748
|
||||
* commit-graph: Introduce a parser for commit-graph files by @lhchavez in https://github.com/libgit2/libgit2/pull/5762
|
||||
* patch: add owner accessor by @KOLANICH in https://github.com/libgit2/libgit2/pull/5731
|
||||
* commit-graph: Support lookups of entries in a commit-graph by @lhchavez in https://github.com/libgit2/libgit2/pull/5763
|
||||
* commit-graph: Introduce `git_commit_graph_needs_refresh()` by @lhchavez in https://github.com/libgit2/libgit2/pull/5764
|
||||
* Working directory path validation by @ethomson in https://github.com/libgit2/libgit2/pull/5823
|
||||
* Support `core.longpaths` on Windows by @ethomson in https://github.com/libgit2/libgit2/pull/5857
|
||||
* git_reference_create_matching: Treat all-zero OID as "must be absent" by @novalis in https://github.com/libgit2/libgit2/pull/5842
|
||||
* diff:add option to ignore blank line changes by @yuuri in https://github.com/libgit2/libgit2/pull/5853
|
||||
* [Submodule] Git submodule dup by @lolgear in https://github.com/libgit2/libgit2/pull/5890
|
||||
* commit-graph: Use the commit-graph in revwalks by @lhchavez in https://github.com/libgit2/libgit2/pull/5765
|
||||
* commit-graph: Introduce `git_commit_list_generation_cmp` by @lhchavez in https://github.com/libgit2/libgit2/pull/5766
|
||||
* graph: Create `git_graph_reachable_from_any()` by @lhchavez in https://github.com/libgit2/libgit2/pull/5767
|
||||
* Support reading attributes from a specific commit by @ethomson in https://github.com/libgit2/libgit2/pull/5952
|
||||
* [Branch] Branch upstream with format by @lolgear in https://github.com/libgit2/libgit2/pull/5861
|
||||
* Dynamically load OpenSSL (optionally) by @ethomson in https://github.com/libgit2/libgit2/pull/5974
|
||||
* Set refs/remotes/origin/HEAD to default branch when branch is specified by @A-Ovchinnikov-mx in https://github.com/libgit2/libgit2/pull/6010
|
||||
* midx: Add a way to write multi-pack-index files by @lhchavez in https://github.com/libgit2/libgit2/pull/5404
|
||||
* Use error code GIT_EAUTH for authentication failures by @josharian in https://github.com/libgit2/libgit2/pull/5395
|
||||
* midx: Introduce git_odb_write_multi_pack_index() by @lhchavez in https://github.com/libgit2/libgit2/pull/5405
|
||||
* Checkout dry-run by @J0Nes90 in https://github.com/libgit2/libgit2/pull/5841
|
||||
* mbedTLS: Fix setting certificate directory by @mikezackles in https://github.com/libgit2/libgit2/pull/6004
|
||||
* remote: introduce remote_ready_cb, deprecate resolve_url callback by @ethomson in https://github.com/libgit2/libgit2/pull/6012
|
||||
* Introduce `create_commit_cb`, deprecate `signing_cb` by @ethomson in https://github.com/libgit2/libgit2/pull/6016
|
||||
* commit-graph: Add a way to write commit-graph files by @lhchavez in https://github.com/libgit2/libgit2/pull/5778
|
||||
|
||||
## Bug fixes
|
||||
|
||||
* Define `git___load` when building with `-DTHREADSAFE=OFF` by @lhchavez in https://github.com/libgit2/libgit2/pull/5664
|
||||
* Make the Windows leak detection more robust by @lhchavez in https://github.com/libgit2/libgit2/pull/5661
|
||||
* Refactor "global" state by @ethomson in https://github.com/libgit2/libgit2/pull/5546
|
||||
* threadstate: rename tlsdata when building w/o threads by @ethomson in https://github.com/libgit2/libgit2/pull/5668
|
||||
* Include `${MBEDTLS_INCLUDE_DIR}` when compiling `crypt_mbedtls.c` by @staticfloat in https://github.com/libgit2/libgit2/pull/5685
|
||||
* Fix the `-DTHREADSAFE=OFF` build by @lhchavez in https://github.com/libgit2/libgit2/pull/5690
|
||||
* Add missing worktree_dir check and test case by @rbmclean in https://github.com/libgit2/libgit2/pull/5692
|
||||
* msvc crtdbg -> win32 leakcheck by @ethomson in https://github.com/libgit2/libgit2/pull/5580
|
||||
* Introduce GIT_ASSERT macros by @ethomson in https://github.com/libgit2/libgit2/pull/5327
|
||||
* Also add the raw hostkey to `git_cert_hostkey` by @lhchavez in https://github.com/libgit2/libgit2/pull/5704
|
||||
* Make the odb race-free by @lhchavez in https://github.com/libgit2/libgit2/pull/5595
|
||||
* Make the pack and mwindow implementations data-race-free by @lhchavez in https://github.com/libgit2/libgit2/pull/5593
|
||||
* Thread-free implementation by @ethomson in https://github.com/libgit2/libgit2/pull/5719
|
||||
* Thread-local storage: a generic internal library (with no allocations) by @ethomson in https://github.com/libgit2/libgit2/pull/5720
|
||||
* Friendlier getting started in the lack of git_libgit2_init by @ethomson in https://github.com/libgit2/libgit2/pull/5578
|
||||
* Make git__strntol64() ~70%* faster by @lhchavez in https://github.com/libgit2/libgit2/pull/5735
|
||||
* Cache the parsed submodule config when diffing by @lhchavez in https://github.com/libgit2/libgit2/pull/5727
|
||||
* pack: continue zlib while we can make progress by @ethomson in https://github.com/libgit2/libgit2/pull/5740
|
||||
* Avoid using `__builtin_mul_overflow` with the clang+32-bit combo by @lhchavez in https://github.com/libgit2/libgit2/pull/5742
|
||||
* repository: use intptr_t's in the config map cache by @ethomson in https://github.com/libgit2/libgit2/pull/5746
|
||||
* Build with NO_MMAP by @0xdky in https://github.com/libgit2/libgit2/pull/5583
|
||||
* Add documentation for git_blob_filter_options.version by @JoshuaS3 in https://github.com/libgit2/libgit2/pull/5759
|
||||
* blob: fix name of `GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD` by @ethomson in https://github.com/libgit2/libgit2/pull/5760
|
||||
* Cope with empty default branch by @ethomson in https://github.com/libgit2/libgit2/pull/5770
|
||||
* README: instructions for using libgit2 without compiling by @ethomson in https://github.com/libgit2/libgit2/pull/5772
|
||||
* Use `p_pwrite`/`p_pread` consistently throughout the codebase by @lhchavez in https://github.com/libgit2/libgit2/pull/5769
|
||||
* midx: Fix a bug in `git_midx_needs_refresh()` by @lhchavez in https://github.com/libgit2/libgit2/pull/5768
|
||||
* mwindow: Fix a bug in the LRU window finding code by @lhchavez in https://github.com/libgit2/libgit2/pull/5783
|
||||
* refdb_fs: Check git_sortedcache wlock/rlock errors by @mamapanda in https://github.com/libgit2/libgit2/pull/5800
|
||||
* index: Check git_vector_dup error in write_entries by @mamapanda in https://github.com/libgit2/libgit2/pull/5801
|
||||
* Fix documentation formating on repository.h by @punkymaniac in https://github.com/libgit2/libgit2/pull/5806
|
||||
* include: fix typos in comments by @tniessen in https://github.com/libgit2/libgit2/pull/5805
|
||||
* Fix some typos by @aaronfranke in https://github.com/libgit2/libgit2/pull/5797
|
||||
* Check git_signature_dup failure by @mamapanda in https://github.com/libgit2/libgit2/pull/5817
|
||||
* merge: Check insert_head_ids error in create_virtual_base by @mamapanda in https://github.com/libgit2/libgit2/pull/5818
|
||||
* winhttp: skip certificate check if unable to send request by @ianhattendorf in https://github.com/libgit2/libgit2/pull/5814
|
||||
* Default to GIT_BRANCH_DEFAULT if init.defaultBranch is empty string by @ianhattendorf in https://github.com/libgit2/libgit2/pull/5832
|
||||
* Fix diff_entrycount -> diff_num_deltas doc typo by @mjsir911 in https://github.com/libgit2/libgit2/pull/5838
|
||||
* repo: specify init.defaultbranch is meant to be a branch name by @carlosmn in https://github.com/libgit2/libgit2/pull/5835
|
||||
* repo: remove an inappropriate use of PASSTHROUGH by @carlosmn in https://github.com/libgit2/libgit2/pull/5834
|
||||
* src: fix typos in header files by @tniessen in https://github.com/libgit2/libgit2/pull/5843
|
||||
* test: clean up memory leaks by @ethomson in https://github.com/libgit2/libgit2/pull/5858
|
||||
* buf: remove unnecessary buf_text namespace by @ethomson in https://github.com/libgit2/libgit2/pull/5860
|
||||
* Fix bug in git_diff_find_similar. by @staktrace in https://github.com/libgit2/libgit2/pull/5839
|
||||
* Fix issues with Proxy Authentication after httpclient refactor by @implausible in https://github.com/libgit2/libgit2/pull/5852
|
||||
* tests: clean up memory leak, fail on leak for win32 by @ethomson in https://github.com/libgit2/libgit2/pull/5892
|
||||
* Tolerate readlink size less than st_size by @dtolnay in https://github.com/libgit2/libgit2/pull/5900
|
||||
* Define WINHTTP_NO_CLIENT_CERT_CONTEXT if needed by @jacquesg in https://github.com/libgit2/libgit2/pull/5929
|
||||
* Update from regex to pcre licensing information in docs/contributing.md by @boretrk in https://github.com/libgit2/libgit2/pull/5916
|
||||
* Consider files executable only if the user can execute them by @novalis in https://github.com/libgit2/libgit2/pull/5915
|
||||
* git__timer: Limit ITimer usage to AmigaOS4 by @boretrk in https://github.com/libgit2/libgit2/pull/5936
|
||||
* Fix memory leak in git_smart__connect by @punkymaniac in https://github.com/libgit2/libgit2/pull/5908
|
||||
* config: fix included configs not refreshed more than once by @Batchyx in https://github.com/libgit2/libgit2/pull/5926
|
||||
* Fix wrong time_t used in function by @NattyNarwhal in https://github.com/libgit2/libgit2/pull/5938
|
||||
* fix check for ignoring of negate rules by @palmin in https://github.com/libgit2/libgit2/pull/5824
|
||||
* Make `FIND_PACKAGE(PythonInterp)` prefer `python3` by @lhchavez in https://github.com/libgit2/libgit2/pull/5913
|
||||
* git__timer: Allow compilation on systems without CLOCK_MONOTONIC by @boretrk in https://github.com/libgit2/libgit2/pull/5945
|
||||
* stdintification: use int64_t and INT64_C instead of long long by @NattyNarwhal in https://github.com/libgit2/libgit2/pull/5941
|
||||
* Optional stricter allocation checking (for `malloc(0)` cases) by @ethomson in https://github.com/libgit2/libgit2/pull/5951
|
||||
* Variadic arguments aren't in C89 by @NattyNarwhal in https://github.com/libgit2/libgit2/pull/5948
|
||||
* Fix typo in general.c by @Crayon2000 in https://github.com/libgit2/libgit2/pull/5954
|
||||
* common.h: use inline when compiling for C99 and later by @boretrk in https://github.com/libgit2/libgit2/pull/5953
|
||||
* Fix one memory leak in master by @lhchavez in https://github.com/libgit2/libgit2/pull/5957
|
||||
* tests: reset odb backend priority by @ethomson in https://github.com/libgit2/libgit2/pull/5961
|
||||
* cmake: extended futimens checking on macOS by @ethomson in https://github.com/libgit2/libgit2/pull/5962
|
||||
* amiga: use ';' as path list separator on AmigaOS by @boretrk in https://github.com/libgit2/libgit2/pull/5978
|
||||
* Respect the force flag on refspecs in git_remote_fetch by @alexjg in https://github.com/libgit2/libgit2/pull/5854
|
||||
* Fix LIBGIT2_FILENAME not being passed to the resource compiler by @jairbubbles in https://github.com/libgit2/libgit2/pull/5994
|
||||
* sha1dc: remove conditional for <sys/types.h> by @boretrk in https://github.com/libgit2/libgit2/pull/5997
|
||||
* openssl: don't fail when we can't customize allocators by @ethomson in https://github.com/libgit2/libgit2/pull/5999
|
||||
* C11 warnings by @boretrk in https://github.com/libgit2/libgit2/pull/6005
|
||||
* open: input validation for empty segments in path by @boretrk in https://github.com/libgit2/libgit2/pull/5950
|
||||
* Introduce GIT_WARN_UNUSED_RESULT by @lhchavez in https://github.com/libgit2/libgit2/pull/5802
|
||||
* GCC C11 warnings by @boretrk in https://github.com/libgit2/libgit2/pull/6006
|
||||
* array: check dereference from void * type by @boretrk in https://github.com/libgit2/libgit2/pull/6007
|
||||
* Homogenize semantics for atomic-related functions by @lhchavez in https://github.com/libgit2/libgit2/pull/5747
|
||||
* git_array_alloc: return objects of correct type by @boretrk in https://github.com/libgit2/libgit2/pull/6008
|
||||
* CMake. hash sha1 header has been added. by @lolgear in https://github.com/libgit2/libgit2/pull/6013
|
||||
* tests: change comments to c89 style by @boretrk in https://github.com/libgit2/libgit2/pull/6015
|
||||
* Set Host Header to match CONNECT authority target by @lollipopman in https://github.com/libgit2/libgit2/pull/6022
|
||||
* Fix worktree iteration when repository has no common directory by @kcsaul in https://github.com/libgit2/libgit2/pull/5943
|
||||
|
||||
## Documentation improvements
|
||||
|
||||
* Update README.md for additional Delphi bindings by @todaysoftware in https://github.com/libgit2/libgit2/pull/5831
|
||||
* Fix documentation formatting by @punkymaniac in https://github.com/libgit2/libgit2/pull/5850
|
||||
* docs: fix incorrect comment marker by @tiennou in https://github.com/libgit2/libgit2/pull/5897
|
||||
* Patch documentation by @punkymaniac in https://github.com/libgit2/libgit2/pull/5903
|
||||
* Fix misleading doc for `git_index_find` by @arxanas in https://github.com/libgit2/libgit2/pull/5910
|
||||
* docs: stop mentioning libgit2's "master" branch by @Batchyx in https://github.com/libgit2/libgit2/pull/5925
|
||||
* docs: fix some missing includes that cause Docurium to error out by @tiennou in https://github.com/libgit2/libgit2/pull/5917
|
||||
* Patch documentation by @punkymaniac in https://github.com/libgit2/libgit2/pull/5940
|
||||
|
||||
## Development improvements
|
||||
|
||||
* WIP: .devcontainer: settings for a codespace workflow by @ethomson in https://github.com/libgit2/libgit2/pull/5508
|
||||
|
||||
## CI Improvements
|
||||
|
||||
* Add a ThreadSanitizer build by @lhchavez in https://github.com/libgit2/libgit2/pull/5597
|
||||
* ci: more GitHub Actions by @ethomson in https://github.com/libgit2/libgit2/pull/5706
|
||||
* ci: run coverity in the nightly builds by @ethomson in https://github.com/libgit2/libgit2/pull/5707
|
||||
* ci: only report main branch in README status by @ethomson in https://github.com/libgit2/libgit2/pull/5708
|
||||
* Fix the `ENABLE_WERROR=ON` build in Groovy Gorilla (gcc 10.2) by @lhchavez in https://github.com/libgit2/libgit2/pull/5715
|
||||
* Re-enable the RC4 test by @carlosmn in https://github.com/libgit2/libgit2/pull/4418
|
||||
* ci: run codeql by @ethomson in https://github.com/libgit2/libgit2/pull/5709
|
||||
* github-actions: Also rename the main branch here by @lhchavez in https://github.com/libgit2/libgit2/pull/5771
|
||||
* ci: don't use ninja on macOS by @ethomson in https://github.com/libgit2/libgit2/pull/5780
|
||||
* ci: use GitHub for storing mingw-w64 build dependency by @ethomson in https://github.com/libgit2/libgit2/pull/5855
|
||||
* docker: remove the entrypoint by @ethomson in https://github.com/libgit2/libgit2/pull/5980
|
||||
* http: don't require a password by @ethomson in https://github.com/libgit2/libgit2/pull/5972
|
||||
* ci: update nightly to use source path by @ethomson in https://github.com/libgit2/libgit2/pull/5989
|
||||
* ci: add centos 7 and centos 8 by @ethomson in https://github.com/libgit2/libgit2/pull/5992
|
||||
* ci: update centos builds by @ethomson in https://github.com/libgit2/libgit2/pull/5995
|
||||
* ci: tag new containers with the latest tag by @ethomson in https://github.com/libgit2/libgit2/pull/6000
|
||||
|
||||
## Dependency updates
|
||||
|
||||
* ntlm: [ntlmclient](https://github.com/ethomson/ntlmclient) is now v0.9.1
|
||||
|
||||
**Full Changelog**: https://github.com/libgit2/libgit2/compare/v1.1.0...v1.2.0
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
v1.1
|
||||
----
|
||||
|
||||
@ -87,6 +319,8 @@ This is a bugfix release with the following changes:
|
||||
has been fixed. Previously, fetching from servers like Gerrit, that
|
||||
sent large data packets, would error.
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
v1.0
|
||||
----
|
||||
|
||||
@ -490,6 +724,9 @@ with v0.28.0.
|
||||
The breaking change is that the `username` member of the underlying struct
|
||||
is now hidden, and a new `git_cred_get_username` function has been provided.
|
||||
|
||||
* Some errors of class `GIT_ERROR_NET` now have class `GIT_ERROR_HTTP`.
|
||||
Most authentication failures now have error code `GIT_EAUTH` instead of `GIT_ERROR`.
|
||||
|
||||
### Breaking CMake configuration changes
|
||||
|
||||
* The CMake option to use a system http-parser library, instead of the
|
||||
@ -563,6 +800,8 @@ release:
|
||||
* Tyler Ang-Wanek
|
||||
* Tyler Wanek
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
v0.28
|
||||
-----
|
||||
|
||||
@ -711,6 +950,8 @@ v0.28
|
||||
out such files is not allowed as this can make a Git implementation write
|
||||
outside of the repository and bypass the fsck checks for CVE-2018-11235.
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
v0.27
|
||||
---------
|
||||
|
||||
@ -827,6 +1068,8 @@ v0.27
|
||||
`git_odb_backend` interface have changed their signatures to allow providing
|
||||
the object's size and type to the caller.
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
v0.26
|
||||
-----
|
||||
|
||||
@ -1071,6 +1314,8 @@ v0.25
|
||||
to provide the name of a merge driver to be used to handle files changed
|
||||
during a merge.
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
v0.24
|
||||
-------
|
||||
|
||||
@ -1186,6 +1431,8 @@ v0.24
|
||||
* `git_remote_connect()` now takes a `custom_headers` argument to set
|
||||
the extra HTTP header fields to send.
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
v0.23
|
||||
------
|
||||
|
||||
@ -1485,6 +1732,8 @@ v0.23
|
||||
* It is no longer allowed to call `git_buf_grow()` on buffers
|
||||
borrowing the memory they point to.
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
v0.22
|
||||
------
|
||||
|
||||
|
@ -172,7 +172,7 @@ tags:
|
||||
*
|
||||
* @param s String to froznicate
|
||||
* @return A newly allocated string or `NULL` in case an error occurred.
|
||||
* /
|
||||
*/
|
||||
char *froznicate(const char *s);
|
||||
```
|
||||
|
||||
|
@ -18,7 +18,7 @@ The bundled dependencies in the `deps` directories are governed
|
||||
by the following licenses:
|
||||
|
||||
- http-parser is licensed under [MIT license](../deps/http-parser/COPYING)
|
||||
- regex is governed by [LGPL v2.1+ license](../deps/regex/COPYING)
|
||||
- pcre is governed by [BSD license](../deps/pcre/LICENCE)
|
||||
- winhttp is governed by [LGPL v2.1+](../deps/winhttp/COPYING.LGPL) and [GPL v2 with linking exception](../deps/winhttp/COPYING.GPL)
|
||||
- zlib is governed by [zlib license](../deps/zlib/COPYING)
|
||||
|
||||
@ -35,7 +35,7 @@ easily accessible permanent record of the conversation.
|
||||
|
||||
## Libgit2 Versions
|
||||
|
||||
The `master` branch is the main branch where development happens.
|
||||
The `main` branch is the main branch where development happens.
|
||||
Releases are tagged
|
||||
(e.g. [v0.21.0](https://github.com/libgit2/libgit2/releases/tag/v0.21.0) )
|
||||
and when a critical bug fix needs to be backported, it will be done on a
|
||||
@ -51,7 +51,7 @@ commit SHA
|
||||
Using [`git describe`](http://git-scm.com/docs/git-describe) is a
|
||||
great way to tell us what version you're working with.
|
||||
|
||||
If you're not running against the latest `master` branch version,
|
||||
If you're not running against the latest `main` branch version,
|
||||
please compile and test against that to avoid re-reporting an issue that's
|
||||
already been fixed.
|
||||
|
||||
@ -68,11 +68,11 @@ flow](https://guides.github.com/introduction/flow/index.html), where
|
||||
contributors fork the [libgit2 repository](https://github.com/libgit2/libgit2),
|
||||
make their changes on branch, and submit a
|
||||
[Pull Request](https://help.github.com/articles/using-pull-requests)
|
||||
(a.k.a. "PR"). Pull requests should usually be targeted at the `master`
|
||||
(a.k.a. "PR"). Pull requests should usually be targeted at the `main`
|
||||
branch.
|
||||
|
||||
Life will be a lot easier for you (and us) if you follow this pattern
|
||||
(i.e. fork, named branch, submit PR). If you use your fork's `master`
|
||||
(i.e. fork, named branch, submit PR). If you use your fork's `main`
|
||||
branch directly, things can get messy.
|
||||
|
||||
Please include a nice description of your changes when you submit your PR;
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Releasing the library
|
||||
|
||||
We have three kinds of releases: "full" releases, maintenance releases and security releases. Full ones release the state of the `master` branch whereas maintenance releases provide bugfixes building on top of the currently released series. Security releases are also for the current series but only contain security fixes on top of the previous release.
|
||||
We have three kinds of releases: "full" releases, maintenance releases and security releases. Full ones release the state of the `main` branch whereas maintenance releases provide bugfixes building on top of the currently released series. Security releases are also for the current series but only contain security fixes on top of the previous release.
|
||||
|
||||
## Full release
|
||||
|
||||
@ -40,7 +40,7 @@ followed by the three sections in the changelog. For release candidates we can a
|
||||
|
||||
During the freeze, and certainly after the first release candidate, any bindings the core team work with should be updated in order to discover any issues that might come up with the multitude of approaches to memory management, embedding or linking.
|
||||
|
||||
Create a branch `maint/v0.X` at the current state of `master` after you've created the tag. This will be used for maintenance releases and lets our dependents track the latest state of the series.
|
||||
Create a branch `maint/v0.X` at the current state of `main` after you've created the tag. This will be used for maintenance releases and lets our dependents track the latest state of the series.
|
||||
|
||||
## Maintenance release
|
||||
|
||||
@ -76,7 +76,7 @@ We use docurium to generate our documentation. It is a tool written in ruby whic
|
||||
|
||||
gem install docurium
|
||||
|
||||
and run it against our description file with the tip of master checked out.
|
||||
and run it against our description file with the tip of `main` checked out.
|
||||
|
||||
cm doc api.docurium
|
||||
|
||||
|
36
docs/win32-longpaths.md
Normal file
36
docs/win32-longpaths.md
Normal file
@ -0,0 +1,36 @@
|
||||
core.longpaths support
|
||||
======================
|
||||
|
||||
Historically, Windows has limited absolute path lengths to `MAX_PATH`
|
||||
(260) characters.
|
||||
|
||||
Unfortunately, 260 characters is a punishing small maximum. This is
|
||||
especially true for developers where dependencies may have dependencies
|
||||
in a folder, each dependency themselves having dependencies in a
|
||||
sub-folder, ad (seemingly) infinitum.
|
||||
|
||||
So although the Windows APIs _by default_ honor this 260 character
|
||||
maximum, you can get around this by using separate APIs. Git honors a
|
||||
`core.longpaths` configuration option that allows some paths on Windows
|
||||
to exceed these 260 character limits.
|
||||
|
||||
And because they've gone and done it, that means that libgit2 has to
|
||||
honor this value, too.
|
||||
|
||||
Since `core.longpaths` is a _configuration option_ that means that we
|
||||
need to be able to resolve a configuration - including in _the repository
|
||||
itself_ in order to know whether long paths should be supported.
|
||||
|
||||
Therefore, in libgit2, `core.longpaths` affects paths in working
|
||||
directories _only_. Paths to the repository, and to items inside the
|
||||
`.git` folder, must be no longer than 260 characters.
|
||||
|
||||
This definition is required to avoid a paradoxical setting: if you
|
||||
had a repository in a folder that was 280 characters long, how would
|
||||
you know whether `core.longpaths` support should be enabled? Even if
|
||||
`core.longpaths` was set to true in a system configuration file, the
|
||||
repository itself may set `core.longpaths` to false in _its_ configuration
|
||||
file, which you could only read if `core.longpaths` were set to true.
|
||||
|
||||
Thus, `core.longpaths` must _only_ apply to working directory items,
|
||||
and cannot apply to the `.git` folder or its contents.
|
@ -54,7 +54,7 @@ int lg2_blame(git_repository *repo, int argc, char *argv[])
|
||||
*/
|
||||
if (o.commitspec) {
|
||||
check_lg2(git_revparse(&revspec, repo, o.commitspec), "Couldn't parse commit spec", NULL);
|
||||
if (revspec.flags & GIT_REVPARSE_SINGLE) {
|
||||
if (revspec.flags & GIT_REVSPEC_SINGLE) {
|
||||
git_oid_cpy(&blameopts.newest_commit, git_object_id(revspec.from));
|
||||
git_object_free(revspec.from);
|
||||
} else {
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/* Define the printf format specifer to use for size_t output */
|
||||
/* Define the printf format specifier to use for size_t output */
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
# define PRIuZ "Iu"
|
||||
# define PRIxZ "Ix"
|
||||
|
@ -36,7 +36,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef PRIuZ
|
||||
/* Define the printf format specifer to use for size_t output */
|
||||
/* Define the printf format specifier to use for size_t output */
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
# define PRIuZ "Iu"
|
||||
#else
|
||||
|
@ -26,6 +26,10 @@ static int config_get(git_config *cfg, const char *key)
|
||||
}
|
||||
|
||||
puts(entry->value);
|
||||
|
||||
/* Free the git_config_entry after use with `git_config_entry_free()`. */
|
||||
git_config_entry_free(entry);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -57,6 +61,11 @@ int lg2_config(git_repository *repo, int argc, char **argv)
|
||||
error = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* The configuration file must be freed once it's no longer
|
||||
* being used by the user.
|
||||
*/
|
||||
git_config_free(cfg);
|
||||
out:
|
||||
return error;
|
||||
}
|
||||
|
@ -154,11 +154,6 @@ static void oid_parsing(git_oid *oid)
|
||||
printf("\n*Raw to Hex*\n");
|
||||
out[GIT_OID_HEXSZ] = '\0';
|
||||
|
||||
/**
|
||||
* If you have a oid, you can easily get the hex value of the SHA as well.
|
||||
*/
|
||||
git_oid_fmt(out, oid);
|
||||
|
||||
/**
|
||||
* If you have a oid, you can easily get the hex value of the SHA as well.
|
||||
*/
|
||||
@ -713,7 +708,7 @@ static void reference_listing(git_repository *repo)
|
||||
/**
|
||||
* ### Config Files
|
||||
*
|
||||
* The [config API][config] allows you to list and updatee 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).
|
||||
*
|
||||
* [config]: http://libgit2.github.com/libgit2/#HEAD/group/config
|
||||
|
@ -245,7 +245,7 @@ static int add_revision(struct log_state *s, const char *revstr)
|
||||
}
|
||||
|
||||
if (*revstr == '^') {
|
||||
revs.flags = GIT_REVPARSE_SINGLE;
|
||||
revs.flags = GIT_REVSPEC_SINGLE;
|
||||
hide = !hide;
|
||||
|
||||
if (git_revparse_single(&revs.from, s->repo, revstr + 1) < 0)
|
||||
@ -253,12 +253,12 @@ static int add_revision(struct log_state *s, const char *revstr)
|
||||
} else if (git_revparse(&revs, s->repo, revstr) < 0)
|
||||
return -1;
|
||||
|
||||
if ((revs.flags & GIT_REVPARSE_SINGLE) != 0)
|
||||
if ((revs.flags & GIT_REVSPEC_SINGLE) != 0)
|
||||
push_rev(s, revs.from, hide);
|
||||
else {
|
||||
push_rev(s, revs.to, hide);
|
||||
|
||||
if ((revs.flags & GIT_REVPARSE_MERGE_BASE) != 0) {
|
||||
if ((revs.flags & GIT_REVSPEC_MERGE_BASE) != 0) {
|
||||
git_oid base;
|
||||
check_lg2(git_merge_base(&base, s->repo,
|
||||
git_object_id(revs.from), git_object_id(revs.to)),
|
||||
|
@ -73,7 +73,7 @@ static int push_range(git_repository *repo, git_revwalk *walk, const char *range
|
||||
if ((error = git_revparse(&revspec, repo, range)))
|
||||
return error;
|
||||
|
||||
if (revspec.flags & GIT_REVPARSE_MERGE_BASE) {
|
||||
if (revspec.flags & GIT_REVSPEC_MERGE_BASE) {
|
||||
/* TODO: support "<commit>...<commit>" */
|
||||
return GIT_EINVALIDSPEC;
|
||||
}
|
||||
|
@ -69,17 +69,17 @@ static int parse_revision(git_repository *repo, struct parse_state *ps)
|
||||
|
||||
check_lg2(git_revparse(&rs, repo, ps->spec), "Could not parse", ps->spec);
|
||||
|
||||
if ((rs.flags & GIT_REVPARSE_SINGLE) != 0) {
|
||||
if ((rs.flags & GIT_REVSPEC_SINGLE) != 0) {
|
||||
git_oid_tostr(str, sizeof(str), git_object_id(rs.from));
|
||||
printf("%s\n", str);
|
||||
git_object_free(rs.from);
|
||||
}
|
||||
else if ((rs.flags & GIT_REVPARSE_RANGE) != 0) {
|
||||
else if ((rs.flags & GIT_REVSPEC_RANGE) != 0) {
|
||||
git_oid_tostr(str, sizeof(str), git_object_id(rs.to));
|
||||
printf("%s\n", str);
|
||||
git_object_free(rs.to);
|
||||
|
||||
if ((rs.flags & GIT_REVPARSE_MERGE_BASE) != 0) {
|
||||
if ((rs.flags & GIT_REVSPEC_MERGE_BASE) != 0) {
|
||||
git_oid base;
|
||||
check_lg2(git_merge_base(&base, repo,
|
||||
git_object_id(rs.from), git_object_id(rs.to)),
|
||||
|
@ -188,7 +188,7 @@ static void action_delete_tag(tag_state *state)
|
||||
git_object_free(obj);
|
||||
}
|
||||
|
||||
static void action_create_lighweight_tag(tag_state *state)
|
||||
static void action_create_lightweight_tag(tag_state *state)
|
||||
{
|
||||
git_repository *repo = state->repo;
|
||||
struct tag_options *opts = state->opts;
|
||||
@ -260,7 +260,7 @@ static void parse_options(tag_action *action, struct tag_options *opts, int argc
|
||||
print_usage();
|
||||
|
||||
if (*action != &action_create_tag)
|
||||
*action = &action_create_lighweight_tag;
|
||||
*action = &action_create_lightweight_tag;
|
||||
} else if (!strcmp(curr, "-n")) {
|
||||
opts->num_lines = 1;
|
||||
*action = &action_list_tags;
|
||||
|
80
fuzzers/commit_graph_fuzzer.c
Normal file
80
fuzzers/commit_graph_fuzzer.c
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* libgit2 commit-graph 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 "git2.h"
|
||||
|
||||
#include "buffer.h"
|
||||
#include "common.h"
|
||||
#include "futils.h"
|
||||
#include "hash.h"
|
||||
#include "commit_graph.h"
|
||||
|
||||
int LLVMFuzzerInitialize(int *argc, char ***argv)
|
||||
{
|
||||
GIT_UNUSED(argc);
|
||||
GIT_UNUSED(argv);
|
||||
|
||||
if (git_libgit2_init() < 0) {
|
||||
fprintf(stderr, "Failed to initialize libgit2\n");
|
||||
abort();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
{
|
||||
git_commit_graph_file file = {{0}};
|
||||
git_commit_graph_entry e;
|
||||
git_buf commit_graph_buf = GIT_BUF_INIT;
|
||||
git_oid oid = {{0}};
|
||||
bool append_hash = false;
|
||||
|
||||
if (size < 4)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* If the first byte in the stream has the high bit set, append the
|
||||
* SHA1 hash so that the file is somewhat valid.
|
||||
*/
|
||||
append_hash = *data & 0x80;
|
||||
/* Keep a 4-byte alignment to avoid unaligned accesses. */
|
||||
data += 4;
|
||||
size -= 4;
|
||||
|
||||
if (append_hash) {
|
||||
if (git_buf_init(&commit_graph_buf, size + sizeof(oid)) < 0)
|
||||
goto cleanup;
|
||||
if (git_hash_buf(&oid, data, size) < 0) {
|
||||
fprintf(stderr, "Failed to compute the SHA1 hash\n");
|
||||
abort();
|
||||
}
|
||||
memcpy(commit_graph_buf.ptr, data, size);
|
||||
memcpy(commit_graph_buf.ptr + size, &oid, sizeof(oid));
|
||||
} else {
|
||||
git_buf_attach_notowned(&commit_graph_buf, (char *)data, size);
|
||||
}
|
||||
|
||||
if (git_commit_graph_file_parse(
|
||||
&file,
|
||||
(const unsigned char *)git_buf_cstr(&commit_graph_buf),
|
||||
git_buf_len(&commit_graph_buf))
|
||||
< 0)
|
||||
goto cleanup;
|
||||
|
||||
/* Search for any oid, just to exercise that codepath. */
|
||||
if (git_commit_graph_entry_find(&e, &file, &oid, GIT_OID_HEXSZ) < 0)
|
||||
goto cleanup;
|
||||
|
||||
cleanup:
|
||||
git_commit_graph_file_close(&file);
|
||||
git_buf_dispose(&commit_graph_buf);
|
||||
return 0;
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user