mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-04 19:50:19 +00:00
Update upstream source from tag 'upstream/1.1.0+dfsg.1'
Update to upstream version '1.1.0+dfsg.1'
with Debian dir 55ab4a7303
This commit is contained in:
commit
07f2212cf5
244
.github/workflows/main.yml
vendored
Normal file
244
.github/workflows/main.yml
vendored
Normal file
@ -0,0 +1,244 @@
|
|||||||
|
# Continuous integration and pull request validation builds for the
|
||||||
|
# master and maintenance branches.
|
||||||
|
name: CI Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master, maint/* ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master, maint/* ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
docker-registry: docker.pkg.github.com
|
||||||
|
docker-config-path: azure-pipelines/docker
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# Build the docker container images that we will use for our Linux
|
||||||
|
# builds. This will identify the last commit to the repository that
|
||||||
|
# updated the docker images, and try to download the image tagged with
|
||||||
|
# that sha. If it does not exist, we'll do a docker build and push
|
||||||
|
# the image up to GitHub Packages for the actual CI/CD runs. We tag
|
||||||
|
# with both the sha and "latest" so that the subsequent runs need not
|
||||||
|
# know the sha. Only do this on CI builds (when the event is a "push")
|
||||||
|
# because PR builds from forks lack permission to write packages.
|
||||||
|
build_containers:
|
||||||
|
name: Create docker image
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
container:
|
||||||
|
- xenial
|
||||||
|
- bionic
|
||||||
|
- focal
|
||||||
|
- docurium
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
- name: Download existing container
|
||||||
|
run: azure-pipelines/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.container }}
|
||||||
|
env:
|
||||||
|
DOCKER_REGISTRY: ${{ env.docker-registry }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.github_token }}
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
- name: Build and publish image
|
||||||
|
run: |
|
||||||
|
docker build -t ${{ env.docker-registry-container-sha }} --build-arg BASE=${{ matrix.container.base }} -f ${{ matrix.container }} .
|
||||||
|
docker push ${{ env.docker-registry-container-sha }}
|
||||||
|
working-directory: ${{ env.docker-config-path }}
|
||||||
|
if: github.event_name == 'push' && 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]
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- # Xenial, GCC, OpenSSL
|
||||||
|
image: 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
|
||||||
|
image: 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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
image: 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
|
||||||
|
- # 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
|
||||||
|
setup-script: osx
|
||||||
|
- # Windows amd64 Visual Studio
|
||||||
|
os: windows-2019
|
||||||
|
env:
|
||||||
|
ARCH: amd64
|
||||||
|
CMAKE_GENERATOR: Visual Studio 16 2019
|
||||||
|
CMAKE_OPTIONS: -A x64 -DMSVC_CRTDBG=ON -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 -DMSVC_CRTDBG=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
|
||||||
|
fail-fast: false
|
||||||
|
env: ${{ matrix.platform.env }}
|
||||||
|
runs-on: ${{ matrix.platform.os }}
|
||||||
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Set up build environment
|
||||||
|
run: azure-pipelines/setup-${{ matrix.platform.setup-script }}.sh
|
||||||
|
shell: bash
|
||||||
|
if: matrix.platform.setup-script != ''
|
||||||
|
- name: Download container
|
||||||
|
run: azure-pipelines/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.platform.image }}
|
||||||
|
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'
|
||||||
|
- name: Build and test
|
||||||
|
run: |
|
||||||
|
export GITTEST_NEGOTIATE_PASSWORD="${{ secrets.GITTEST_NEGOTIATE_PASSWORD }}"
|
||||||
|
|
||||||
|
if [ -n "${{ matrix.platform.image }}" ]; then
|
||||||
|
docker run \
|
||||||
|
--rm \
|
||||||
|
-v "$(pwd):/home/libgit2/source" \
|
||||||
|
-w /home/libgit2/source \
|
||||||
|
-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 \
|
||||||
|
${{ env.docker-registry-container-sha }} \
|
||||||
|
/bin/bash -c "mkdir build && cd build && ../azure-pipelines/build.sh && ../azure-pipelines/test.sh"
|
||||||
|
else
|
||||||
|
mkdir build && cd build
|
||||||
|
../azure-pipelines/build.sh
|
||||||
|
../azure-pipelines/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
|
||||||
|
# published to our documentation site.
|
||||||
|
documentation:
|
||||||
|
name: Generate documentation
|
||||||
|
needs: [build_containers]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Generate documentation
|
||||||
|
run: |
|
||||||
|
git config user.name 'Documentation Generation'
|
||||||
|
git config user.email 'libgit2@users.noreply.github.com'
|
||||||
|
git branch gh-pages origin/gh-pages
|
||||||
|
docker login https://${{ env.docker-registry }} -u ${{ github.actor }} -p ${{ github.token }}
|
||||||
|
docker run \
|
||||||
|
--rm \
|
||||||
|
-v "$(pwd):/home/libgit2/source" \
|
||||||
|
-w /home/libgit2/source \
|
||||||
|
${{ env.docker-registry }}/${{ github.repository }}/docurium:latest \
|
||||||
|
cm doc api.docurium
|
||||||
|
git checkout gh-pages
|
||||||
|
zip --exclude .git/\* --exclude .gitignore --exclude .gitattributes -r api-documentation.zip .
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
name: Upload artifact
|
||||||
|
with:
|
||||||
|
name: api-documentation
|
||||||
|
path: api-documentation.zip
|
||||||
|
- name: Push documentation branch
|
||||||
|
run: git push origin gh-pages
|
||||||
|
if: github.event_name == 'push' && github.repository == 'libgit2/libgit2'
|
30
.gitignore
vendored
30
.gitignore
vendored
@ -1,37 +1,7 @@
|
|||||||
/tests/clar.suite
|
|
||||||
/tests/clar.suite.rule
|
|
||||||
/tests/.clarcache
|
|
||||||
/apidocs
|
|
||||||
/trash-*.exe
|
|
||||||
/libgit2.pc
|
|
||||||
/config.mak
|
|
||||||
*.o
|
|
||||||
*.a
|
|
||||||
*.exe
|
|
||||||
*.gcda
|
|
||||||
*.gcno
|
|
||||||
*.gcov
|
|
||||||
.lock-wafbuild
|
|
||||||
.waf*
|
|
||||||
build/
|
build/
|
||||||
build-amiga/
|
|
||||||
tests/tmp/
|
|
||||||
msvc/Debug/
|
|
||||||
msvc/Release/
|
|
||||||
*.sln
|
|
||||||
*.suo
|
|
||||||
*.vc*proj*
|
|
||||||
*.sdf
|
|
||||||
*.opensdf
|
|
||||||
*.aps
|
|
||||||
*.cmake
|
|
||||||
!cmake/Modules/*.cmake
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*~
|
*~
|
||||||
.*.swp
|
.*.swp
|
||||||
tags
|
tags
|
||||||
mkmf.log
|
|
||||||
*.profdata
|
|
||||||
*.profraw
|
|
||||||
CMakeSettings.json
|
CMakeSettings.json
|
||||||
.vs
|
.vs
|
||||||
|
100
CMakeLists.txt
100
CMakeLists.txt
@ -11,21 +11,12 @@
|
|||||||
# Install:
|
# Install:
|
||||||
# > cmake --build . --target install
|
# > cmake --build . --target install
|
||||||
|
|
||||||
PROJECT(libgit2 C)
|
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1)
|
||||||
CMAKE_POLICY(SET CMP0015 NEW)
|
|
||||||
IF(POLICY CMP0051)
|
project(libgit2 VERSION "1.1.0" LANGUAGES C)
|
||||||
CMAKE_POLICY(SET CMP0051 NEW)
|
|
||||||
ENDIF()
|
|
||||||
IF(POLICY CMP0042)
|
|
||||||
CMAKE_POLICY(SET CMP0042 NEW)
|
|
||||||
ENDIF()
|
|
||||||
IF(POLICY CMP0054)
|
|
||||||
CMAKE_POLICY(SET CMP0054 NEW)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
# Add find modules to the path
|
# Add find modules to the path
|
||||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${libgit2_SOURCE_DIR}/cmake/Modules/")
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${libgit2_SOURCE_DIR}/cmake/")
|
||||||
|
|
||||||
INCLUDE(CheckLibraryExists)
|
INCLUDE(CheckLibraryExists)
|
||||||
INCLUDE(CheckFunctionExists)
|
INCLUDE(CheckFunctionExists)
|
||||||
@ -49,8 +40,6 @@ OPTION(THREADSAFE "Build libgit2 as threadsafe" ON)
|
|||||||
OPTION(BUILD_CLAR "Build Tests using the Clar suite" ON)
|
OPTION(BUILD_CLAR "Build Tests using the Clar suite" ON)
|
||||||
OPTION(BUILD_EXAMPLES "Build library usage example apps" OFF)
|
OPTION(BUILD_EXAMPLES "Build library usage example apps" OFF)
|
||||||
OPTION(BUILD_FUZZERS "Build the fuzz targets" OFF)
|
OPTION(BUILD_FUZZERS "Build the fuzz targets" OFF)
|
||||||
OPTION(TAGS "Generate tags" OFF)
|
|
||||||
OPTION(PROFILE "Generate profiling information" OFF)
|
|
||||||
OPTION(ENABLE_TRACE "Enables tracing support" ON)
|
OPTION(ENABLE_TRACE "Enables tracing support" ON)
|
||||||
OPTION(LIBGIT2_FILENAME "Name of the produced binary" OFF)
|
OPTION(LIBGIT2_FILENAME "Name of the produced binary" OFF)
|
||||||
OPTION(USE_SSH "Link with libssh2 to enable SSH support" ON)
|
OPTION(USE_SSH "Link with libssh2 to enable SSH support" ON)
|
||||||
@ -104,16 +93,6 @@ IF(MSVC)
|
|||||||
OPTION(MSVC_CRTDBG "Enable CRTDBG memory leak reporting" OFF)
|
OPTION(MSVC_CRTDBG "Enable CRTDBG memory leak reporting" OFF)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
FILE(STRINGS "${libgit2_SOURCE_DIR}/include/git2/version.h" GIT2_HEADER REGEX "^#define LIBGIT2_VERSION \"[^\"]*\"$")
|
|
||||||
|
|
||||||
STRING(REGEX REPLACE "^.*LIBGIT2_VERSION \"([0-9]+).*$" "\\1" LIBGIT2_VERSION_MAJOR "${GIT2_HEADER}")
|
|
||||||
STRING(REGEX REPLACE "^.*LIBGIT2_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" LIBGIT2_VERSION_MINOR "${GIT2_HEADER}")
|
|
||||||
STRING(REGEX REPLACE "^.*LIBGIT2_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" LIBGIT2_VERSION_REV "${GIT2_HEADER}")
|
|
||||||
SET(LIBGIT2_VERSION_STRING "${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}.${LIBGIT2_VERSION_REV}")
|
|
||||||
|
|
||||||
FILE(STRINGS "${libgit2_SOURCE_DIR}/include/git2/version.h" GIT2_HEADER_SOVERSION REGEX "^#define LIBGIT2_SOVERSION \"([0-9.]+)\"$")
|
|
||||||
STRING(REGEX REPLACE "^.*LIBGIT2_SOVERSION \"([0-9.]+)\"$" "\\1" LIBGIT2_SOVERSION "${GIT2_HEADER_SOVERSION}")
|
|
||||||
|
|
||||||
IF (DEPRECATE_HARD)
|
IF (DEPRECATE_HARD)
|
||||||
ADD_DEFINITIONS(-DGIT_DEPRECATE_HARD)
|
ADD_DEFINITIONS(-DGIT_DEPRECATE_HARD)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@ -137,6 +116,11 @@ IF (MSVC)
|
|||||||
# /Gd - explicitly set cdecl calling convention
|
# /Gd - explicitly set cdecl calling convention
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd")
|
||||||
|
|
||||||
|
IF (NOT (MSVC_VERSION LESS 1900))
|
||||||
|
# /guard:cf - Enable Control Flow Guard
|
||||||
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:cf")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF (STATIC_CRT)
|
IF (STATIC_CRT)
|
||||||
SET(CRT_FLAG_DEBUG "/MTd")
|
SET(CRT_FLAG_DEBUG "/MTd")
|
||||||
SET(CRT_FLAG_RELEASE "/MT")
|
SET(CRT_FLAG_RELEASE "/MT")
|
||||||
@ -181,7 +165,12 @@ IF (MSVC)
|
|||||||
# /NXCOMPAT - Data execution prevention (DEP)
|
# /NXCOMPAT - Data execution prevention (DEP)
|
||||||
# /LARGEADDRESSAWARE - >2GB user address space on x86
|
# /LARGEADDRESSAWARE - >2GB user address space on x86
|
||||||
# /VERSION - Embed version information in PE header
|
# /VERSION - Embed version information in PE header
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "/DYNAMICBASE /NXCOMPAT /LARGEADDRESSAWARE /VERSION:${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}")
|
SET(CMAKE_EXE_LINKER_FLAGS "/DYNAMICBASE /NXCOMPAT /LARGEADDRESSAWARE /VERSION:${libgit2_VERSION_MAJOR}.${libgit2_VERSION_MINOR}")
|
||||||
|
|
||||||
|
IF (NOT (MSVC_VERSION LESS 1900))
|
||||||
|
# /GUARD:CF - Enable Control Flow Guard
|
||||||
|
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /GUARD:CF")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# /DEBUG - Create a PDB
|
# /DEBUG - Create a PDB
|
||||||
# /LTCG - Link time code generation (whole program optimization)
|
# /LTCG - Link time code generation (whole program optimization)
|
||||||
@ -232,35 +221,27 @@ ELSE ()
|
|||||||
ADD_DEFINITIONS(-D__USE_MINGW_ANSI_STDIO=1)
|
ADD_DEFINITIONS(-D__USE_MINGW_ANSI_STDIO=1)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
ENABLE_WARNINGS(documentation)
|
enable_warnings(documentation)
|
||||||
DISABLE_WARNINGS(missing-field-initializers)
|
disable_warnings(documentation-deprecated-sync)
|
||||||
ENABLE_WARNINGS(strict-aliasing)
|
disable_warnings(missing-field-initializers)
|
||||||
ENABLE_WARNINGS(strict-prototypes)
|
enable_warnings(strict-aliasing)
|
||||||
ENABLE_WARNINGS(declaration-after-statement)
|
enable_warnings(strict-prototypes)
|
||||||
ENABLE_WARNINGS(shift-count-overflow)
|
enable_warnings(declaration-after-statement)
|
||||||
ENABLE_WARNINGS(unused-const-variable)
|
enable_warnings(shift-count-overflow)
|
||||||
ENABLE_WARNINGS(unused-function)
|
enable_warnings(unused-const-variable)
|
||||||
ENABLE_WARNINGS(int-conversion)
|
enable_warnings(unused-function)
|
||||||
|
enable_warnings(int-conversion)
|
||||||
|
|
||||||
# MinGW uses gcc, which expects POSIX formatting for printf, but
|
# MinGW uses gcc, which expects POSIX formatting for printf, but
|
||||||
# uses the Windows C library, which uses its own format specifiers.
|
# uses the Windows C library, which uses its own format specifiers.
|
||||||
# Disable format specifier warnings.
|
# Disable format specifier warnings.
|
||||||
IF(MINGW)
|
if(MINGW)
|
||||||
DISABLE_WARNINGS(format)
|
disable_warnings(format)
|
||||||
DISABLE_WARNINGS(format-security)
|
disable_warnings(format-security)
|
||||||
ELSE()
|
else()
|
||||||
ENABLE_WARNINGS(format)
|
enable_warnings(format)
|
||||||
ENABLE_WARNINGS(format-security)
|
enable_warnings(format-security)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
|
||||||
DISABLE_WARNINGS(documentation-deprecated-sync)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF (PROFILE)
|
|
||||||
SET(CMAKE_C_FLAGS "-pg ${CMAKE_C_FLAGS}")
|
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "-pg ${CMAKE_EXE_LINKER_FLAGS}")
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Ensure that MinGW provides the correct header files.
|
# Ensure that MinGW provides the correct header files.
|
||||||
@ -300,25 +281,6 @@ IF (BUILD_CLAR)
|
|||||||
ADD_SUBDIRECTORY(tests)
|
ADD_SUBDIRECTORY(tests)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF (TAGS)
|
|
||||||
FIND_PROGRAM(CTAGS ctags)
|
|
||||||
IF (NOT CTAGS)
|
|
||||||
MESSAGE(FATAL_ERROR "Could not find ctags command")
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
FILE(GLOB_RECURSE SRC_ALL *.[ch])
|
|
||||||
|
|
||||||
ADD_CUSTOM_COMMAND(
|
|
||||||
OUTPUT tags
|
|
||||||
COMMAND ${CTAGS} -a ${SRC_ALL}
|
|
||||||
DEPENDS ${SRC_ALL}
|
|
||||||
)
|
|
||||||
ADD_CUSTOM_TARGET(
|
|
||||||
do_tags ALL
|
|
||||||
DEPENDS tags
|
|
||||||
)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF (BUILD_EXAMPLES)
|
IF (BUILD_EXAMPLES)
|
||||||
ADD_SUBDIRECTORY(examples)
|
ADD_SUBDIRECTORY(examples)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
17
README.md
17
README.md
@ -4,7 +4,7 @@ libgit2 - the Git linkable library
|
|||||||
| Build Status | |
|
| Build Status | |
|
||||||
| ------------ | - |
|
| ------------ | - |
|
||||||
| **master** branch CI builds | [](https://dev.azure.com/libgit2/libgit2/_build/latest?definitionId=7&branchName=master) |
|
| **master** branch CI builds | [](https://dev.azure.com/libgit2/libgit2/_build/latest?definitionId=7&branchName=master) |
|
||||||
| **v0.99 branch** CI builds | [](https://dev.azure.com/libgit2/libgit2/_build/latest?definitionId=7&branchName=maint/v0.99) |
|
| **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) |
|
| **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) |
|
| **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) |
|
||||||
|
|
||||||
@ -47,6 +47,7 @@ Table of Contents
|
|||||||
* [Compiler and linker options](#compiler-and-linker-options)
|
* [Compiler and linker options](#compiler-and-linker-options)
|
||||||
* [MacOS X](#macos-x)
|
* [MacOS X](#macos-x)
|
||||||
* [Android](#android)
|
* [Android](#android)
|
||||||
|
* [MinGW](#mingw)
|
||||||
* [Language Bindings](#language-bindings)
|
* [Language Bindings](#language-bindings)
|
||||||
* [How Can I Contribute?](#how-can-i-contribute)
|
* [How Can I Contribute?](#how-can-i-contribute)
|
||||||
* [License](#license)
|
* [License](#license)
|
||||||
@ -304,6 +305,20 @@ with full path to the toolchain):
|
|||||||
Add `-DCMAKE_TOOLCHAIN_FILE={pathToToolchainFile}` to cmake command
|
Add `-DCMAKE_TOOLCHAIN_FILE={pathToToolchainFile}` to cmake command
|
||||||
when configuring.
|
when configuring.
|
||||||
|
|
||||||
|
MinGW
|
||||||
|
-----
|
||||||
|
|
||||||
|
If you want to build the library in MinGW environment with SSH support enabled,
|
||||||
|
you may need to pass `-DCMAKE_LIBRARY_PATH="${MINGW_PREFIX}/${MINGW_CHOST}/lib/"` flag
|
||||||
|
to CMake when configuring. This is because CMake cannot find the Win32 libraries in
|
||||||
|
MinGW folders by default and you might see an error message stating that CMake
|
||||||
|
could not resolve `ws2_32` library during configuration.
|
||||||
|
|
||||||
|
Another option would be to install `msys2-w32api-runtime` package before configuring.
|
||||||
|
This package installs the Win32 libraries into `/usr/lib` folder which is by default
|
||||||
|
recognized as the library path by CMake. Please note though that this package is meant
|
||||||
|
for MSYS subsystem which is different from MinGW.
|
||||||
|
|
||||||
Language Bindings
|
Language Bindings
|
||||||
==================================
|
==================================
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ jobs:
|
|||||||
parameters:
|
parameters:
|
||||||
environmentVariables:
|
environmentVariables:
|
||||||
CMAKE_GENERATOR: Visual Studio 15 2017
|
CMAKE_GENERATOR: Visual Studio 15 2017
|
||||||
CMAKE_OPTIONS: -A x64 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON
|
CMAKE_OPTIONS: -A x64 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON
|
||||||
SKIP_SSH_TESTS: true
|
SKIP_SSH_TESTS: true
|
||||||
SKIP_NEGOTIATE_TESTS: true
|
SKIP_NEGOTIATE_TESTS: true
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ jobs:
|
|||||||
parameters:
|
parameters:
|
||||||
environmentVariables:
|
environmentVariables:
|
||||||
CMAKE_GENERATOR: Visual Studio 15 2017
|
CMAKE_GENERATOR: Visual Studio 15 2017
|
||||||
CMAKE_OPTIONS: -A Win32 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS
|
CMAKE_OPTIONS: -A Win32 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS -DUSE_BUNDLED_ZLIB=ON
|
||||||
SKIP_SSH_TESTS: true
|
SKIP_SSH_TESTS: true
|
||||||
SKIP_NEGOTIATE_TESTS: true
|
SKIP_NEGOTIATE_TESTS: true
|
||||||
|
|
||||||
@ -151,40 +151,3 @@ jobs:
|
|||||||
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
|
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
|
||||||
SKIP_SSH_TESTS: true
|
SKIP_SSH_TESTS: true
|
||||||
SKIP_NEGOTIATE_TESTS: true
|
SKIP_NEGOTIATE_TESTS: true
|
||||||
|
|
||||||
- job: documentation
|
|
||||||
displayName: 'Generate Documentation'
|
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-18.04'
|
|
||||||
steps:
|
|
||||||
- script: |
|
|
||||||
cd $(Build.SourcesDirectory)/azure-pipelines/docker
|
|
||||||
docker build -t libgit2/docurium --build-arg BASE=ubuntu:trusty -f docurium .
|
|
||||||
displayName: 'Build Docker image'
|
|
||||||
- script: |
|
|
||||||
git config user.name 'Documentation Generation'
|
|
||||||
git config user.email 'libgit2@users.noreply.github.com'
|
|
||||||
git branch gh-pages origin/gh-pages
|
|
||||||
docker run --rm -v $(Build.SourcesDirectory):/home/libgit2/source -w /home/libgit2/source libgit2/docurium:latest cm doc api.docurium
|
|
||||||
git checkout gh-pages
|
|
||||||
cp -R * '$(Build.BinariesDirectory)'
|
|
||||||
displayName: 'Generate Documentation'
|
|
||||||
- task: archivefiles@2
|
|
||||||
displayName: 'Archive Documentation'
|
|
||||||
inputs:
|
|
||||||
rootFolderOrFile: '$(Build.BinariesDirectory)'
|
|
||||||
includeRootFolder: false
|
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/api-documentation.zip'
|
|
||||||
- task: publishbuildartifacts@1
|
|
||||||
displayName: 'Upload Documentation Artifact'
|
|
||||||
inputs:
|
|
||||||
pathToPublish: '$(Build.ArtifactStagingDirectory)'
|
|
||||||
artifactName: 'docs'
|
|
||||||
- script: |
|
|
||||||
git remote -v
|
|
||||||
echo 'machine github.com' > ~/.netrc
|
|
||||||
echo 'login $(GITHUB_USERNAME)' >> ~/.netrc
|
|
||||||
echo 'password $(GITHUB_PAT)' >> ~/.netrc
|
|
||||||
git push origin gh-pages
|
|
||||||
displayName: 'Publish Documentation'
|
|
||||||
condition: and(eq(variables['Build.Repository.Name'], 'libgit2/libgit2'), eq(variables['Build.Reason'], 'IndividualCI'))
|
|
||||||
|
@ -13,6 +13,10 @@ BUILD_PATH=${BUILD_PATH:=$PATH}
|
|||||||
CMAKE=$(which cmake)
|
CMAKE=$(which cmake)
|
||||||
CMAKE_GENERATOR=${CMAKE_GENERATOR:-Unix Makefiles}
|
CMAKE_GENERATOR=${CMAKE_GENERATOR:-Unix Makefiles}
|
||||||
|
|
||||||
|
if [[ "$(uname -s)" == MINGW* ]]; then
|
||||||
|
BUILD_PATH=$(cygpath "$BUILD_PATH")
|
||||||
|
fi
|
||||||
|
|
||||||
indent() { sed "s/^/ /"; }
|
indent() { sed "s/^/ /"; }
|
||||||
|
|
||||||
echo "Source directory: ${SOURCE_DIR}"
|
echo "Source directory: ${SOURCE_DIR}"
|
||||||
@ -33,11 +37,18 @@ echo "Kernel version:"
|
|||||||
uname -a 2>&1 | indent
|
uname -a 2>&1 | indent
|
||||||
|
|
||||||
echo "CMake version:"
|
echo "CMake version:"
|
||||||
env PATH="$BUILD_PATH" "$CMAKE" --version 2>&1 | indent
|
env PATH="${BUILD_PATH}" "${CMAKE}" --version 2>&1 | indent
|
||||||
|
|
||||||
if test -n "$CC"; then
|
if test -n "${CC}"; then
|
||||||
echo "Compiler version:"
|
echo "Compiler version:"
|
||||||
"$CC" --version 2>&1 | indent
|
"${CC}" --version 2>&1 | indent
|
||||||
|
fi
|
||||||
|
echo "Environment:"
|
||||||
|
if test -n "${CC}"; then
|
||||||
|
echo "CC=${CC}" | indent
|
||||||
|
fi
|
||||||
|
if test -n "${CFLAGS}"; then
|
||||||
|
echo "CFLAGS=${CFLAGS}" | indent
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
@ -45,12 +56,12 @@ echo "##########################################################################
|
|||||||
echo "## Configuring build environment"
|
echo "## Configuring build environment"
|
||||||
echo "##############################################################################"
|
echo "##############################################################################"
|
||||||
|
|
||||||
echo cmake ${SOURCE_DIR} -DENABLE_WERROR=ON -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON -G \"${CMAKE_GENERATOR}\" ${CMAKE_OPTIONS}
|
echo cmake -DENABLE_WERROR=ON -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON -G \"${CMAKE_GENERATOR}\" ${CMAKE_OPTIONS} -S \"${SOURCE_DIR}\"
|
||||||
env PATH="$BUILD_PATH" "$CMAKE" ${SOURCE_DIR} -DENABLE_WERROR=ON -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON -G "${CMAKE_GENERATOR}" ${CMAKE_OPTIONS}
|
env PATH="${BUILD_PATH}" "${CMAKE}" -DENABLE_WERROR=ON -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON -G "${CMAKE_GENERATOR}" ${CMAKE_OPTIONS} -S "${SOURCE_DIR}"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "##############################################################################"
|
echo "##############################################################################"
|
||||||
echo "## Building libgit2"
|
echo "## Building libgit2"
|
||||||
echo "##############################################################################"
|
echo "##############################################################################"
|
||||||
|
|
||||||
env PATH="$BUILD_PATH" "$CMAKE" --build .
|
env PATH="${BUILD_PATH}" "${CMAKE}" --build .
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
ARG BASE
|
FROM ubuntu:bionic AS apt
|
||||||
FROM $BASE AS apt
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||||
clang \
|
clang \
|
||||||
|
79
azure-pipelines/docker/focal
Normal file
79
azure-pipelines/docker/focal
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
FROM ubuntu:focal AS apt
|
||||||
|
RUN apt-get update && \
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||||
|
bzip2 \
|
||||||
|
clang-10 \
|
||||||
|
cmake \
|
||||||
|
curl \
|
||||||
|
gcc-10 \
|
||||||
|
git \
|
||||||
|
krb5-user \
|
||||||
|
libcurl4-gnutls-dev \
|
||||||
|
libgcrypt20-dev \
|
||||||
|
libkrb5-dev \
|
||||||
|
libpcre3-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libz-dev \
|
||||||
|
llvm-10 \
|
||||||
|
make \
|
||||||
|
ninja-build \
|
||||||
|
openjdk-8-jre-headless \
|
||||||
|
openssh-server \
|
||||||
|
openssl \
|
||||||
|
pkgconf \
|
||||||
|
python \
|
||||||
|
sudo \
|
||||||
|
valgrind \
|
||||||
|
&& \
|
||||||
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
|
mkdir /usr/local/msan
|
||||||
|
|
||||||
|
FROM apt AS mbedtls
|
||||||
|
RUN cd /tmp && \
|
||||||
|
curl --location --silent --show-error https://tls.mbed.org/download/mbedtls-2.16.2-apache.tgz | \
|
||||||
|
tar -xz && \
|
||||||
|
cd mbedtls-2.16.2 && \
|
||||||
|
scripts/config.pl unset MBEDTLS_AESNI_C && \
|
||||||
|
scripts/config.pl set MBEDTLS_MD4_C 1 && \
|
||||||
|
mkdir build build-msan && \
|
||||||
|
cd build && \
|
||||||
|
CC=clang-10 CFLAGS="-fPIC" cmake -G Ninja -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=ON -DUSE_STATIC_MBEDTLS_LIBRARY=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_INSTALL_PREFIX=/usr/local .. && \
|
||||||
|
ninja install && \
|
||||||
|
cd ../build-msan && \
|
||||||
|
CC=clang-10 CFLAGS="-fPIC" cmake -G Ninja -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=ON -DUSE_STATIC_MBEDTLS_LIBRARY=OFF -DCMAKE_BUILD_TYPE=MemSanDbg -DCMAKE_INSTALL_PREFIX=/usr/local/msan .. && \
|
||||||
|
ninja install && \
|
||||||
|
cd .. && \
|
||||||
|
rm -rf mbedtls-2.16.2
|
||||||
|
|
||||||
|
FROM mbedtls AS libssh2
|
||||||
|
RUN cd /tmp && \
|
||||||
|
curl --insecure --location --silent --show-error https://www.libssh2.org/download/libssh2-1.8.2.tar.gz | \
|
||||||
|
tar -xz && \
|
||||||
|
cd libssh2-1.8.2 && \
|
||||||
|
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 .. && \
|
||||||
|
ninja install && \
|
||||||
|
cd ../build-msan && \
|
||||||
|
CC=clang-10 CFLAGS="-fPIC -fsanitize=memory -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer" LDFLAGS="-fsanitize=memory" cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCRYPTO_BACKEND=mbedTLS -DCMAKE_PREFIX_PATH=/usr/local/msan -DCMAKE_INSTALL_PREFIX=/usr/local/msan .. && \
|
||||||
|
ninja install && \
|
||||||
|
cd .. && \
|
||||||
|
rm -rf libssh2-1.8.2
|
||||||
|
|
||||||
|
FROM libssh2 AS valgrind
|
||||||
|
RUN cd /tmp && \
|
||||||
|
curl --insecure --location --silent --show-error https://sourceware.org/pub/valgrind/valgrind-3.15.0.tar.bz2 | \
|
||||||
|
tar -xj && \
|
||||||
|
cd valgrind-3.15.0 && \
|
||||||
|
CC=clang-10 ./configure && \
|
||||||
|
make MAKEFLAGS="-j -l$(grep -c ^processor /proc/cpuinfo)" && \
|
||||||
|
make install && \
|
||||||
|
cd .. && \
|
||||||
|
rm -rf valgrind-3.15.0
|
||||||
|
|
||||||
|
FROM valgrind AS configure
|
||||||
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
|
RUN chmod a+x /usr/local/bin/entrypoint.sh
|
||||||
|
RUN mkdir /var/run/sshd
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
@ -1,5 +1,4 @@
|
|||||||
ARG BASE
|
FROM ubuntu:xenial AS apt
|
||||||
FROM $BASE AS apt
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
|
45
azure-pipelines/getcontainer.sh
Executable file
45
azure-pipelines/getcontainer.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DOCKERFILE_PATH=$1
|
||||||
|
|
||||||
|
if [ "${DOCKERFILE_PATH}" = "" ]; then
|
||||||
|
echo "usage: $0 dockerfile"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${DOCKER_REGISTRY}" = "" ]; then
|
||||||
|
echo "DOCKER_REGISTRY environment variable is unset."
|
||||||
|
echo "Not running inside GitHub Actions or misconfigured?"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
DOCKER_CONTAINER="${GITHUB_REPOSITORY}/$(basename ${DOCKERFILE_PATH})"
|
||||||
|
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}"
|
||||||
|
|
||||||
|
# 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}"
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
exists="true"
|
||||||
|
docker login https://${DOCKER_REGISTRY} -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN} || exists="false"
|
||||||
|
|
||||||
|
if [ "${exists}" != "false" ]; then
|
||||||
|
docker pull ${DOCKER_REGISTRY_CONTAINER_SHA} || exists="false"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${exists}" = "true" ]; then
|
||||||
|
echo "::set-env name=docker-container-exists::true"
|
||||||
|
else
|
||||||
|
echo "::set-env name=docker-container-exists::false"
|
||||||
|
fi
|
@ -4,6 +4,9 @@ echo "##########################################################################
|
|||||||
echo "## Downloading mingw"
|
echo "## Downloading mingw"
|
||||||
echo "##############################################################################"
|
echo "##############################################################################"
|
||||||
|
|
||||||
|
BUILD_TEMP=${BUILD_TEMP:=$TEMP}
|
||||||
|
BUILD_TEMP=$(cygpath $BUILD_TEMP)
|
||||||
|
|
||||||
case "$ARCH" in
|
case "$ARCH" in
|
||||||
amd64)
|
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://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-x86_64-8.1.0-release-win32-seh-rt_v6-rev0.zip";;
|
||||||
@ -11,5 +14,12 @@ case "$ARCH" in
|
|||||||
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://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-i686-8.1.0-release-win32-sjlj-rt_v6-rev0.zip";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
curl -s -L "$MINGW_URI" -o "$TEMP"/mingw-"$ARCH".zip
|
if [ -z "$MINGW_URI" ]; then
|
||||||
unzip -q "$TEMP"/mingw-"$ARCH".zip -d "$TEMP"
|
echo "No URL"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$BUILD_TEMP"
|
||||||
|
|
||||||
|
curl -s -L "$MINGW_URI" -o "$BUILD_TEMP"/mingw-"$ARCH".zip
|
||||||
|
unzip -q "$BUILD_TEMP"/mingw-"$ARCH".zip -d "$BUILD_TEMP"
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
@CHECK_PROTOTYPE_DEFINITION_HEADER@
|
|
||||||
|
|
||||||
static void cmakeRequireSymbol(int dummy, ...) {
|
|
||||||
(void) dummy;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void checkSymbol(void) {
|
|
||||||
#ifndef @CHECK_PROTOTYPE_DEFINITION_SYMBOL@
|
|
||||||
cmakeRequireSymbol(0, &@CHECK_PROTOTYPE_DEFINITION_SYMBOL@);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
@CHECK_PROTOTYPE_DEFINITION_PROTO@ {
|
|
||||||
return @CHECK_PROTOTYPE_DEFINITION_RETURN@;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef __CLASSIC_C__
|
|
||||||
int main() {
|
|
||||||
int ac;
|
|
||||||
char*av[];
|
|
||||||
#else
|
|
||||||
int main(int ac, char *av[]) {
|
|
||||||
#endif
|
|
||||||
checkSymbol();
|
|
||||||
if (ac > 1000) {
|
|
||||||
return *av[0];
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,96 +0,0 @@
|
|||||||
# - Check if the protoype we expect is correct.
|
|
||||||
# check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER VARIABLE)
|
|
||||||
# FUNCTION - The name of the function (used to check if prototype exists)
|
|
||||||
# PROTOTYPE- The prototype to check.
|
|
||||||
# RETURN - The return value of the function.
|
|
||||||
# HEADER - The header files required.
|
|
||||||
# VARIABLE - The variable to store the result.
|
|
||||||
# Example:
|
|
||||||
# check_prototype_definition(getpwent_r
|
|
||||||
# "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)"
|
|
||||||
# "NULL"
|
|
||||||
# "unistd.h;pwd.h"
|
|
||||||
# SOLARIS_GETPWENT_R)
|
|
||||||
# The following variables may be set before calling this macro to
|
|
||||||
# modify the way the check is run:
|
|
||||||
#
|
|
||||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
|
||||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
|
||||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
|
||||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
|
||||||
|
|
||||||
#=============================================================================
|
|
||||||
# Copyright 2005-2009 Kitware, Inc.
|
|
||||||
# Copyright 2010-2011 Andreas Schneider <asn@cryptomilk.org>
|
|
||||||
#
|
|
||||||
# Distributed under the OSI-approved BSD License (the "License");
|
|
||||||
# see accompanying file Copyright.txt for details.
|
|
||||||
#
|
|
||||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
||||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
# See the License for more information.
|
|
||||||
#=============================================================================
|
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
|
||||||
# License text for the above reference.)
|
|
||||||
#
|
|
||||||
|
|
||||||
get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
||||||
|
|
||||||
function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE)
|
|
||||||
|
|
||||||
if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
|
|
||||||
set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n")
|
|
||||||
|
|
||||||
set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
|
||||||
if (CMAKE_REQUIRED_LIBRARIES)
|
|
||||||
set(CHECK_PROTOTYPE_DEFINITION_LIBS
|
|
||||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
|
||||||
else(CMAKE_REQUIRED_LIBRARIES)
|
|
||||||
set(CHECK_PROTOTYPE_DEFINITION_LIBS)
|
|
||||||
endif(CMAKE_REQUIRED_LIBRARIES)
|
|
||||||
if (CMAKE_REQUIRED_INCLUDES)
|
|
||||||
set(CMAKE_SYMBOL_EXISTS_INCLUDES
|
|
||||||
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
|
||||||
else(CMAKE_REQUIRED_INCLUDES)
|
|
||||||
set(CMAKE_SYMBOL_EXISTS_INCLUDES)
|
|
||||||
endif(CMAKE_REQUIRED_INCLUDES)
|
|
||||||
|
|
||||||
foreach(_FILE ${_HEADER})
|
|
||||||
set(CHECK_PROTOTYPE_DEFINITION_HEADER
|
|
||||||
"${CHECK_PROTOTYPE_DEFINITION_HEADER}#include <${_FILE}>\n")
|
|
||||||
endforeach(_FILE)
|
|
||||||
|
|
||||||
set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION})
|
|
||||||
set(CHECK_PROTOTYPE_DEFINITION_PROTO ${_PROTOTYPE})
|
|
||||||
set(CHECK_PROTOTYPE_DEFINITION_RETURN ${_RETURN})
|
|
||||||
|
|
||||||
configure_file("${__check_proto_def_dir}/CheckPrototypeDefinition.c.in"
|
|
||||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c" @ONLY)
|
|
||||||
|
|
||||||
file(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c _SOURCE)
|
|
||||||
|
|
||||||
try_compile(${_VARIABLE}
|
|
||||||
${CMAKE_BINARY_DIR}
|
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c
|
|
||||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
|
||||||
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CHECK_PROTOTYPE_DEFINITION_FLAGS}
|
|
||||||
"${CHECK_PROTOTYPE_DEFINITION_LIBS}"
|
|
||||||
"${CMAKE_SYMBOL_EXISTS_INCLUDES}"
|
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
|
||||||
|
|
||||||
if (${_VARIABLE})
|
|
||||||
set(${_VARIABLE} 1 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
|
|
||||||
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - True")
|
|
||||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
|
||||||
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n"
|
|
||||||
"${OUTPUT}\n\n")
|
|
||||||
else (${_VARIABLE})
|
|
||||||
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False")
|
|
||||||
set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
|
|
||||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
|
||||||
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n"
|
|
||||||
"${OUTPUT}\n\n${_SOURCE}\n\n")
|
|
||||||
endif (${_VARIABLE})
|
|
||||||
endif("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
|
|
||||||
|
|
||||||
endfunction(CHECK_PROTOTYPE_DEFINITION)
|
|
@ -1,35 +1,27 @@
|
|||||||
# Select the backend to use
|
|
||||||
|
|
||||||
# We try to find any packages our backends might use
|
|
||||||
|
|
||||||
INCLUDE(SanitizeBool)
|
INCLUDE(SanitizeBool)
|
||||||
|
|
||||||
|
# We try to find any packages our backends might use
|
||||||
FIND_PACKAGE(GSSAPI)
|
FIND_PACKAGE(GSSAPI)
|
||||||
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
INCLUDE(FindGSSFramework)
|
INCLUDE(FindGSSFramework)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Auto-select GSS backend
|
IF(USE_GSSAPI)
|
||||||
SanitizeBool(USE_GSSAPI)
|
# Auto-select GSS backend
|
||||||
IF (USE_GSSAPI STREQUAL ON)
|
SanitizeBool(USE_GSSAPI)
|
||||||
|
IF (USE_GSSAPI STREQUAL ON)
|
||||||
IF (GSSFRAMEWORK_FOUND)
|
IF (GSSFRAMEWORK_FOUND)
|
||||||
SET(GSS_BACKEND "GSS.framework")
|
SET(USE_GSSAPI "GSS.framework")
|
||||||
ELSEIF(GSSAPI_FOUND)
|
ELSEIF(GSSAPI_FOUND)
|
||||||
SET(GSS_BACKEND "gssapi")
|
SET(USE_GSSAPI "gssapi")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(FATAL_ERROR "Unable to autodetect a usable GSS backend."
|
MESSAGE(FATAL_ERROR "Unable to autodetect a usable GSS backend."
|
||||||
"Please pass the backend name explicitly (-DUSE_GSS=backend)")
|
"Please pass the backend name explicitly (-DUSE_GSS=backend)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSEIF(USE_GSSAPI)
|
ENDIF()
|
||||||
# Backend was explicitly set
|
|
||||||
SET(GSS_BACKEND ${USE_GSSAPI})
|
|
||||||
ELSE()
|
|
||||||
SET(GSS_BACKEND NO)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF(GSS_BACKEND)
|
|
||||||
# Check that we can find what's required for the selected backend
|
# Check that we can find what's required for the selected backend
|
||||||
IF (GSS_BACKEND STREQUAL "GSS.framework")
|
IF (USE_GSSAPI STREQUAL "GSS.framework")
|
||||||
IF (NOT GSSFRAMEWORK_FOUND)
|
IF (NOT GSSFRAMEWORK_FOUND)
|
||||||
MESSAGE(FATAL_ERROR "Asked for GSS.framework backend, but it wasn't found")
|
MESSAGE(FATAL_ERROR "Asked for GSS.framework backend, but it wasn't found")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@ -37,8 +29,8 @@ IF(GSS_BACKEND)
|
|||||||
LIST(APPEND LIBGIT2_LIBS ${GSSFRAMEWORK_LIBRARIES})
|
LIST(APPEND LIBGIT2_LIBS ${GSSFRAMEWORK_LIBRARIES})
|
||||||
|
|
||||||
SET(GIT_GSSFRAMEWORK 1)
|
SET(GIT_GSSFRAMEWORK 1)
|
||||||
ADD_FEATURE_INFO(SPNEGO GIT_GSSFRAMEWORK "SPNEGO authentication support (${GSS_BACKEND})")
|
ADD_FEATURE_INFO(SPNEGO GIT_GSSFRAMEWORK "SPNEGO authentication support (${USE_GSSAPI})")
|
||||||
ELSEIF (GSS_BACKEND STREQUAL "gssapi")
|
ELSEIF (USE_GSSAPI STREQUAL "gssapi")
|
||||||
IF (NOT GSSAPI_FOUND)
|
IF (NOT GSSAPI_FOUND)
|
||||||
MESSAGE(FATAL_ERROR "Asked for gssapi GSS backend, but it wasn't found")
|
MESSAGE(FATAL_ERROR "Asked for gssapi GSS backend, but it wasn't found")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@ -46,9 +38,9 @@ IF(GSS_BACKEND)
|
|||||||
LIST(APPEND LIBGIT2_LIBS ${GSSAPI_LIBRARIES})
|
LIST(APPEND LIBGIT2_LIBS ${GSSAPI_LIBRARIES})
|
||||||
|
|
||||||
SET(GIT_GSSAPI 1)
|
SET(GIT_GSSAPI 1)
|
||||||
ADD_FEATURE_INFO(SPNEGO GIT_GSSAPI "SPNEGO authentication support (${GSS_BACKEND})")
|
ADD_FEATURE_INFO(SPNEGO GIT_GSSAPI "SPNEGO authentication support (${USE_GSSAPI})")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(FATAL_ERROR "Asked for backend ${GSS_BACKEND} but it wasn't found")
|
MESSAGE(FATAL_ERROR "Asked for backend ${USE_GSSAPI} but it wasn't found")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(GIT_GSSAPI 0)
|
SET(GIT_GSSAPI 0)
|
@ -1,5 +1,3 @@
|
|||||||
# Select the backend to use
|
|
||||||
|
|
||||||
INCLUDE(SanitizeBool)
|
INCLUDE(SanitizeBool)
|
||||||
|
|
||||||
# We try to find any packages our backends might use
|
# We try to find any packages our backends might use
|
||||||
@ -10,36 +8,31 @@ IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
|||||||
FIND_PACKAGE(CoreFoundation)
|
FIND_PACKAGE(CoreFoundation)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Auto-select TLS backend
|
IF(USE_HTTPS)
|
||||||
SanitizeBool(USE_HTTPS)
|
# Auto-select TLS backend
|
||||||
IF (USE_HTTPS STREQUAL ON)
|
SanitizeBool(USE_HTTPS)
|
||||||
|
IF (USE_HTTPS STREQUAL ON)
|
||||||
IF (SECURITY_FOUND)
|
IF (SECURITY_FOUND)
|
||||||
IF (SECURITY_HAS_SSLCREATECONTEXT)
|
IF (SECURITY_HAS_SSLCREATECONTEXT)
|
||||||
SET(HTTPS_BACKEND "SecureTransport")
|
SET(USE_HTTPS "SecureTransport")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS "Security framework is too old, falling back to OpenSSL")
|
MESSAGE(STATUS "Security framework is too old, falling back to OpenSSL")
|
||||||
SET(HTTPS_BACKEND "OpenSSL")
|
SET(USE_HTTPS "OpenSSL")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSEIF (WINHTTP)
|
ELSEIF (WINHTTP)
|
||||||
SET(HTTPS_BACKEND "WinHTTP")
|
SET(USE_HTTPS "WinHTTP")
|
||||||
ELSEIF(OPENSSL_FOUND)
|
ELSEIF(OPENSSL_FOUND)
|
||||||
SET(HTTPS_BACKEND "OpenSSL")
|
SET(USE_HTTPS "OpenSSL")
|
||||||
ELSEIF(MBEDTLS_FOUND)
|
ELSEIF(MBEDTLS_FOUND)
|
||||||
SET(HTTPS_BACKEND "mbedTLS")
|
SET(USE_HTTPS "mbedTLS")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(FATAL_ERROR "Unable to autodetect a usable HTTPS backend."
|
MESSAGE(FATAL_ERROR "Unable to autodetect a usable HTTPS backend."
|
||||||
"Please pass the backend name explicitly (-DUSE_HTTPS=backend)")
|
"Please pass the backend name explicitly (-DUSE_HTTPS=backend)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSEIF(USE_HTTPS)
|
ENDIF()
|
||||||
# HTTPS backend was explicitly set
|
|
||||||
SET(HTTPS_BACKEND ${USE_HTTPS})
|
|
||||||
ELSE()
|
|
||||||
SET(HTTPS_BACKEND NO)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF(HTTPS_BACKEND)
|
|
||||||
# Check that we can find what's required for the selected backend
|
# Check that we can find what's required for the selected backend
|
||||||
IF (HTTPS_BACKEND STREQUAL "SecureTransport")
|
IF (USE_HTTPS STREQUAL "SecureTransport")
|
||||||
IF (NOT COREFOUNDATION_FOUND)
|
IF (NOT COREFOUNDATION_FOUND)
|
||||||
MESSAGE(FATAL_ERROR "Cannot use SecureTransport backend, CoreFoundation.framework not found")
|
MESSAGE(FATAL_ERROR "Cannot use SecureTransport backend, CoreFoundation.framework not found")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@ -54,7 +47,7 @@ IF(HTTPS_BACKEND)
|
|||||||
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${SECURITY_INCLUDE_DIR})
|
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${SECURITY_INCLUDE_DIR})
|
||||||
LIST(APPEND LIBGIT2_LIBS ${COREFOUNDATION_LDFLAGS} ${SECURITY_LDFLAGS})
|
LIST(APPEND LIBGIT2_LIBS ${COREFOUNDATION_LDFLAGS} ${SECURITY_LDFLAGS})
|
||||||
LIST(APPEND LIBGIT2_PC_LIBS ${COREFOUNDATION_LDFLAGS} ${SECURITY_LDFLAGS})
|
LIST(APPEND LIBGIT2_PC_LIBS ${COREFOUNDATION_LDFLAGS} ${SECURITY_LDFLAGS})
|
||||||
ELSEIF (HTTPS_BACKEND STREQUAL "OpenSSL")
|
ELSEIF (USE_HTTPS STREQUAL "OpenSSL")
|
||||||
IF (NOT OPENSSL_FOUND)
|
IF (NOT OPENSSL_FOUND)
|
||||||
MESSAGE(FATAL_ERROR "Asked for OpenSSL TLS backend, but it wasn't found")
|
MESSAGE(FATAL_ERROR "Asked for OpenSSL TLS backend, but it wasn't found")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@ -64,7 +57,7 @@ IF(HTTPS_BACKEND)
|
|||||||
LIST(APPEND LIBGIT2_LIBS ${OPENSSL_LIBRARIES})
|
LIST(APPEND LIBGIT2_LIBS ${OPENSSL_LIBRARIES})
|
||||||
LIST(APPEND LIBGIT2_PC_LIBS ${OPENSSL_LDFLAGS})
|
LIST(APPEND LIBGIT2_PC_LIBS ${OPENSSL_LDFLAGS})
|
||||||
LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
|
LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
|
||||||
ELSEIF(HTTPS_BACKEND STREQUAL "mbedTLS")
|
ELSEIF(USE_HTTPS STREQUAL "mbedTLS")
|
||||||
IF (NOT MBEDTLS_FOUND)
|
IF (NOT MBEDTLS_FOUND)
|
||||||
MESSAGE(FATAL_ERROR "Asked for mbedTLS backend, but it wasn't found")
|
MESSAGE(FATAL_ERROR "Asked for mbedTLS backend, but it wasn't found")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@ -113,14 +106,14 @@ IF(HTTPS_BACKEND)
|
|||||||
# https://github.com/ARMmbed/mbedtls/issues/228
|
# https://github.com/ARMmbed/mbedtls/issues/228
|
||||||
# For now, pass its link flags as our own
|
# For now, pass its link flags as our own
|
||||||
LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
|
LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
|
||||||
ELSEIF (HTTPS_BACKEND STREQUAL "WinHTTP")
|
ELSEIF (USE_HTTPS STREQUAL "WinHTTP")
|
||||||
# WinHTTP setup was handled in the WinHTTP-specific block above
|
# WinHTTP setup was handled in the WinHTTP-specific block above
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(FATAL_ERROR "Asked for backend ${HTTPS_BACKEND} but it wasn't found")
|
MESSAGE(FATAL_ERROR "Asked for backend ${USE_HTTPS} but it wasn't found")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(GIT_HTTPS 1)
|
SET(GIT_HTTPS 1)
|
||||||
ADD_FEATURE_INFO(HTTPS GIT_HTTPS "using ${HTTPS_BACKEND}")
|
ADD_FEATURE_INFO(HTTPS GIT_HTTPS "using ${USE_HTTPS}")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(GIT_HTTPS 0)
|
SET(GIT_HTTPS 0)
|
||||||
ADD_FEATURE_INFO(HTTPS NO "")
|
ADD_FEATURE_INFO(HTTPS NO "")
|
@ -5,37 +5,28 @@ INCLUDE(SanitizeBool)
|
|||||||
# USE_SHA1=CollisionDetection(ON)/HTTPS/Generic/OFF
|
# USE_SHA1=CollisionDetection(ON)/HTTPS/Generic/OFF
|
||||||
|
|
||||||
SanitizeBool(USE_SHA1)
|
SanitizeBool(USE_SHA1)
|
||||||
IF(USE_SHA1 STREQUAL ON OR USE_SHA1 STREQUAL "CollisionDetection")
|
IF(USE_SHA1 STREQUAL ON)
|
||||||
SET(SHA1_BACKEND "CollisionDetection")
|
SET(USE_SHA1 "CollisionDetection")
|
||||||
ELSEIF(USE_SHA1 STREQUAL "HTTPS")
|
ELSEIF(USE_SHA1 STREQUAL "HTTPS")
|
||||||
message(STATUS "Checking HTTPS backend… ${HTTPS_BACKEND}")
|
IF(USE_HTTPS STREQUAL "SecureTransport")
|
||||||
IF(HTTPS_BACKEND STREQUAL "SecureTransport")
|
SET(USE_SHA1 "CommonCrypto")
|
||||||
SET(SHA1_BACKEND "CommonCrypto")
|
ELSEIF(USE_HTTPS STREQUAL "WinHTTP")
|
||||||
ELSEIF(HTTPS_BACKEND STREQUAL "WinHTTP")
|
SET(USE_SHA1 "Win32")
|
||||||
SET(SHA1_BACKEND "Win32")
|
ELSEIF(USE_HTTPS)
|
||||||
ELSEIF(HTTPS_BACKEND)
|
SET(USE_SHA1 ${USE_HTTPS})
|
||||||
SET(SHA1_BACKEND ${HTTPS_BACKEND})
|
|
||||||
ELSE()
|
ELSE()
|
||||||
|
SET(USE_SHA1 "CollisionDetection")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT HTTPS_BACKEND)
|
|
||||||
SET(SHA1_BACKEND "CollisionDetection")
|
|
||||||
ENDIF()
|
|
||||||
message(STATUS "Using SHA1 backend ${SHA1_BACKEND}")
|
|
||||||
ELSEIF(USE_SHA1 STREQUAL "Generic")
|
|
||||||
SET(SHA1_BACKEND "Generic")
|
|
||||||
# ELSEIF(NOT USE_SHA1)
|
|
||||||
ELSE()
|
|
||||||
MESSAGE(FATAL_ERROR "Invalid value for USE_SHA1: ${USE_SHA1}")
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(SHA1_BACKEND STREQUAL "CollisionDetection")
|
IF(USE_SHA1 STREQUAL "CollisionDetection")
|
||||||
SET(GIT_SHA1_COLLISIONDETECT 1)
|
SET(GIT_SHA1_COLLISIONDETECT 1)
|
||||||
ADD_DEFINITIONS(-DSHA1DC_NO_STANDARD_INCLUDES=1)
|
ADD_DEFINITIONS(-DSHA1DC_NO_STANDARD_INCLUDES=1)
|
||||||
ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\")
|
ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\")
|
||||||
ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\")
|
ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\")
|
||||||
FILE(GLOB SRC_SHA1 hash/sha1/collisiondetect.* hash/sha1/sha1dc/*)
|
FILE(GLOB SRC_SHA1 hash/sha1/collisiondetect.* hash/sha1/sha1dc/*)
|
||||||
ELSEIF(SHA1_BACKEND STREQUAL "OpenSSL")
|
ELSEIF(USE_SHA1 STREQUAL "OpenSSL")
|
||||||
# OPENSSL_FOUND should already be set, we're checking HTTPS_BACKEND
|
# OPENSSL_FOUND should already be set, we're checking USE_HTTPS
|
||||||
|
|
||||||
SET(GIT_SHA1_OPENSSL 1)
|
SET(GIT_SHA1_OPENSSL 1)
|
||||||
IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||||
@ -44,10 +35,10 @@ ELSEIF(SHA1_BACKEND STREQUAL "OpenSSL")
|
|||||||
LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
|
LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
FILE(GLOB SRC_SHA1 hash/sha1/openssl.*)
|
FILE(GLOB SRC_SHA1 hash/sha1/openssl.*)
|
||||||
ELSEIF(SHA1_BACKEND STREQUAL "CommonCrypto")
|
ELSEIF(USE_SHA1 STREQUAL "CommonCrypto")
|
||||||
SET(GIT_SHA1_COMMON_CRYPTO 1)
|
SET(GIT_SHA1_COMMON_CRYPTO 1)
|
||||||
FILE(GLOB SRC_SHA1 hash/sha1/common_crypto.*)
|
FILE(GLOB SRC_SHA1 hash/sha1/common_crypto.*)
|
||||||
ELSEIF(SHA1_BACKEND STREQUAL "mbedTLS")
|
ELSEIF(USE_SHA1 STREQUAL "mbedTLS")
|
||||||
SET(GIT_SHA1_MBEDTLS 1)
|
SET(GIT_SHA1_MBEDTLS 1)
|
||||||
FILE(GLOB SRC_SHA1 hash/sha1/mbedtls.*)
|
FILE(GLOB SRC_SHA1 hash/sha1/mbedtls.*)
|
||||||
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${MBEDTLS_INCLUDE_DIR})
|
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${MBEDTLS_INCLUDE_DIR})
|
||||||
@ -56,14 +47,15 @@ ELSEIF(SHA1_BACKEND STREQUAL "mbedTLS")
|
|||||||
# https://github.com/ARMmbed/mbedtls/issues/228
|
# https://github.com/ARMmbed/mbedtls/issues/228
|
||||||
# For now, pass its link flags as our own
|
# For now, pass its link flags as our own
|
||||||
LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
|
LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
|
||||||
ELSEIF(SHA1_BACKEND STREQUAL "Win32")
|
ELSEIF(USE_SHA1 STREQUAL "Win32")
|
||||||
SET(GIT_SHA1_WIN32 1)
|
SET(GIT_SHA1_WIN32 1)
|
||||||
FILE(GLOB SRC_SHA1 hash/sha1/win32.*)
|
FILE(GLOB SRC_SHA1 hash/sha1/win32.*)
|
||||||
ELSEIF(SHA1_BACKEND STREQUAL "Generic")
|
ELSEIF(USE_SHA1 STREQUAL "Generic")
|
||||||
FILE(GLOB SRC_SHA1 hash/sha1/generic.*)
|
FILE(GLOB SRC_SHA1 hash/sha1/generic.*)
|
||||||
# ELSEIF(NOT USE_SHA1)
|
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(FATAL_ERROR "Asked for unknown SHA1 backend: ${SHA1_BACKEND}")
|
MESSAGE(FATAL_ERROR "Asked for unknown SHA1 backend: ${USE_SHA1}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ADD_FEATURE_INFO(SHA ON "using ${SHA1_BACKEND}")
|
list(SORT SRC_SHA1)
|
||||||
|
|
||||||
|
ADD_FEATURE_INFO(SHA ON "using ${USE_SHA1}")
|
@ -1,3 +1,62 @@
|
|||||||
|
v1.1
|
||||||
|
----
|
||||||
|
|
||||||
|
This is release v1.1, "Fernweh".
|
||||||
|
|
||||||
|
### Changes or improvements
|
||||||
|
|
||||||
|
* Our bundled PCRE dependency has been updated to 8.44.
|
||||||
|
|
||||||
|
* The `refs/remotes/origin/HEAD` file will be created at clone time to
|
||||||
|
point to the origin's default branch.
|
||||||
|
|
||||||
|
* libgit2 now uses the `__atomic_` intrinsics instead of `__sync_`
|
||||||
|
intrinsics on supported gcc and clang versions.
|
||||||
|
|
||||||
|
* The `init.defaultBranch` setting is now respected and `master` is
|
||||||
|
no longer the hardcoded as the default branch name.
|
||||||
|
|
||||||
|
* Patch files that do not contain an `index` line can now be parsed.
|
||||||
|
|
||||||
|
* Configuration files with multi-line values can now contain quotes
|
||||||
|
split across multiple lines.
|
||||||
|
|
||||||
|
* Windows clients now attempt to use TLS1.3 when available.
|
||||||
|
|
||||||
|
* Servers that request an upgrade to a newer HTTP version are
|
||||||
|
silently ignored instead of erroneously failing.
|
||||||
|
|
||||||
|
* Users can pass `NULL` to the options argument to
|
||||||
|
`git_describe_commit`.
|
||||||
|
|
||||||
|
* Clones and fetches of very large packfiles now succeeds on 32-bit
|
||||||
|
platforms.
|
||||||
|
|
||||||
|
* Custom reference database backends can now handle the repository's
|
||||||
|
`HEAD` correctly.
|
||||||
|
|
||||||
|
* Repositories with a large number of packfiles no longer exhaust the
|
||||||
|
number of file descriptors.
|
||||||
|
|
||||||
|
* The test framework now supports TAP output when the `-t` flag is
|
||||||
|
specified.
|
||||||
|
|
||||||
|
* The test framework can now specify an exact match to a test
|
||||||
|
function using a trailing `$`.
|
||||||
|
|
||||||
|
* All checkout types support `GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH`.
|
||||||
|
|
||||||
|
* `git_blame` now can ignore whitespace changes using the option
|
||||||
|
`GIT_BLAME_IGNORE_WHITESPACE`.
|
||||||
|
|
||||||
|
* Several new examples have been created, including an examples for
|
||||||
|
commit, add and push.
|
||||||
|
|
||||||
|
* Mode changes during rename are now supported in patch application.
|
||||||
|
|
||||||
|
* `git_checkout_head` now correctly removes untracked files in a
|
||||||
|
subdirectory when the `FORCE | REMOVE_UNTRACKED` options are specified.
|
||||||
|
|
||||||
v1.0.1
|
v1.0.1
|
||||||
------
|
------
|
||||||
|
|
||||||
|
364
docs/coding-style.md
Normal file
364
docs/coding-style.md
Normal file
@ -0,0 +1,364 @@
|
|||||||
|
# libgit2 Coding Style
|
||||||
|
|
||||||
|
This documentation describes the preferred coding style for the libgit2 project.
|
||||||
|
While not all parts of our code base conform to this coding style, the outlined
|
||||||
|
rules are what we aim for.
|
||||||
|
|
||||||
|
Note that in no case do we accept changes that convert huge parts of the code
|
||||||
|
base to use our coding style. Instead, it is encouraged to modernize small parts
|
||||||
|
of code you're going to modify anyway for a given change you want to introduce.
|
||||||
|
A good rule to follow is the Boy Scout Rule: "Leave the campground cleaner than
|
||||||
|
you found it."
|
||||||
|
|
||||||
|
## C Coding Style
|
||||||
|
|
||||||
|
The following sections define the coding style for all code files and headers.
|
||||||
|
|
||||||
|
### Indentation and Alignment
|
||||||
|
|
||||||
|
Code is indented by tabs, where a tab is 8 spaces. Each opening scope increases
|
||||||
|
the indentation level.
|
||||||
|
|
||||||
|
```c
|
||||||
|
int foobar(int void)
|
||||||
|
{
|
||||||
|
if (condition)
|
||||||
|
doit();
|
||||||
|
/* Body */
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Switch statements have their `case`s aligned with the `switch` keyword. Case
|
||||||
|
bodies are indented by an additional level. Case bodies should not open their
|
||||||
|
own scope to declare variables.
|
||||||
|
|
||||||
|
```c
|
||||||
|
switch (c) {
|
||||||
|
case 'a':
|
||||||
|
case 'b':
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Multi-line conditions should be aligned with the opening brace of the current
|
||||||
|
statement:
|
||||||
|
|
||||||
|
```c
|
||||||
|
if (one_very_long_condition(c) &&
|
||||||
|
another_very_long_condition(c))
|
||||||
|
doit();
|
||||||
|
```
|
||||||
|
|
||||||
|
### Spaces
|
||||||
|
|
||||||
|
There must be no space between the function and its arguments, arguments must be
|
||||||
|
separated by a space:
|
||||||
|
|
||||||
|
```c
|
||||||
|
int doit(int first_arg, int second_arg);
|
||||||
|
doit(1, 2);
|
||||||
|
```
|
||||||
|
|
||||||
|
For any binary or ternary operators, the arguments and separator must be
|
||||||
|
separated by a space:
|
||||||
|
|
||||||
|
```c
|
||||||
|
1 + 2;
|
||||||
|
x ? x : NULL;
|
||||||
|
```
|
||||||
|
|
||||||
|
Unary operators do not have a space between them and the argument they refer to:
|
||||||
|
|
||||||
|
```c
|
||||||
|
*c
|
||||||
|
&c
|
||||||
|
```
|
||||||
|
|
||||||
|
The `sizeof` operator always must not have a space and must use braces around
|
||||||
|
the type:
|
||||||
|
|
||||||
|
```
|
||||||
|
sizeof(int)
|
||||||
|
```
|
||||||
|
|
||||||
|
There must be a space after the keywords `if`, `switch`, `case`, `do` and
|
||||||
|
`while`.
|
||||||
|
|
||||||
|
### Braces
|
||||||
|
|
||||||
|
Functions must have their opening brace on the following line:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void foobar(void)
|
||||||
|
{
|
||||||
|
doit();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
For conditions, braces should be placed on the same line as the condition:
|
||||||
|
|
||||||
|
```c
|
||||||
|
if (condition(c)) {
|
||||||
|
doit();
|
||||||
|
dothat();
|
||||||
|
}
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
doit();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
In case a condition's body has a single line, only, it's allowed to omit braces,
|
||||||
|
except if any of its `else if` or `else` branches has more than one line:
|
||||||
|
|
||||||
|
```c
|
||||||
|
if (condition(c))
|
||||||
|
doit();
|
||||||
|
|
||||||
|
if (condition(c))
|
||||||
|
doit();
|
||||||
|
else if (other_condition(c))
|
||||||
|
doit();
|
||||||
|
|
||||||
|
/* This example must use braces as the `else if` requires them. */
|
||||||
|
if (condition(c)) {
|
||||||
|
doit();
|
||||||
|
} else if (other_condition(c)) {
|
||||||
|
doit();
|
||||||
|
dothat();
|
||||||
|
} else {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Comments
|
||||||
|
|
||||||
|
Comments must use C-style `/* */` comments. C++-style `// `comments are not
|
||||||
|
allowed in our codebase. This is a strict requirement as libgit2 tries to be
|
||||||
|
compliant with the ISO C90 standard, which only allows C-style comments.
|
||||||
|
|
||||||
|
Single-line comments may have their opening and closing tag on the same line:
|
||||||
|
|
||||||
|
```c
|
||||||
|
/* This is a short comment. */
|
||||||
|
```
|
||||||
|
|
||||||
|
For multi-line comments, the opening and closing tag should be empty:
|
||||||
|
|
||||||
|
```c
|
||||||
|
/*
|
||||||
|
* This is a rather long and potentially really unwiedly but informative
|
||||||
|
* multiline comment that helps quite a lot.
|
||||||
|
*/
|
||||||
|
```
|
||||||
|
|
||||||
|
Public functions must have documentation that explain their usage, internal
|
||||||
|
functions should have a comment. We use Docurium to generate documentation
|
||||||
|
derived from these comments, which uses syntax similar to Doxygen. The first
|
||||||
|
line should be a short summary of what the function does. More in-depth
|
||||||
|
explanation should be separated from that first line by an empty line.
|
||||||
|
Parameters and return values should be documented via `@return` and `@param`
|
||||||
|
tags:
|
||||||
|
|
||||||
|
```c
|
||||||
|
/*
|
||||||
|
* Froznicate the string.
|
||||||
|
*
|
||||||
|
* Froznicate the string by foobaring its internal structure into a more obvious
|
||||||
|
* translation. Note that the returned string is a newly allocated string that
|
||||||
|
* shall be `free`d by the caller.
|
||||||
|
*
|
||||||
|
* @param s String to froznicate
|
||||||
|
* @return A newly allocated string or `NULL` in case an error occurred.
|
||||||
|
* /
|
||||||
|
char *froznicate(const char *s);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Variables
|
||||||
|
|
||||||
|
Variables must be declared at the beginning of their scope. This is a strict
|
||||||
|
requirement as libgit2 tries to be compliant with the ISO C90 standard, which
|
||||||
|
forbids mixed declarations and code:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void foobar(void)
|
||||||
|
{
|
||||||
|
char *c = NULL;
|
||||||
|
int a, b;
|
||||||
|
|
||||||
|
a = 0;
|
||||||
|
b = 1;
|
||||||
|
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Naming
|
||||||
|
|
||||||
|
Variables must have all-lowercase names. In case a variable name has multiple
|
||||||
|
words, words should be separated by an underscore `_` character. While
|
||||||
|
recommended to use descriptive naming, common variable names like `i` for
|
||||||
|
indices are allowed.
|
||||||
|
|
||||||
|
All public functions must have a `git` prefix as well as a prefix indicating
|
||||||
|
their respective subsystem. E.g. a function that opens a repository should be
|
||||||
|
called `git_repository_open()`. Functions that are not public but declared in
|
||||||
|
an internal header file for use by other subsystems should follow the same
|
||||||
|
naming pattern. File-local static functions must not have a `git` prefix, but
|
||||||
|
should have a prefix indicating their respective subsystem.
|
||||||
|
|
||||||
|
All structures declared in the libgit2 project must have a `typedef`, we do not
|
||||||
|
use `struct type` variables. Type names follow the same schema as functions.
|
||||||
|
|
||||||
|
### Error Handling
|
||||||
|
|
||||||
|
The libgit2 project mostly uses error codes to indicate errors. Error codes are
|
||||||
|
always of type `int`, where `0` indicates success and a negative error code
|
||||||
|
indicates an error case. In some cases, positive error codes may be used to
|
||||||
|
indicate special cases. Returned values that are not an error code should be
|
||||||
|
returned via an out parameter. Out parameters must always come first in the list
|
||||||
|
of arguments.
|
||||||
|
|
||||||
|
```c
|
||||||
|
int doit(const char **out, int arg)
|
||||||
|
{
|
||||||
|
if (!arg)
|
||||||
|
return -1;
|
||||||
|
*out = "Got an argument";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
To avoid repetitive and fragile error handling in case a function has resources
|
||||||
|
that need to be free'd, we use `goto out`s:
|
||||||
|
|
||||||
|
```c
|
||||||
|
int doit(char **out, int arg)
|
||||||
|
{
|
||||||
|
int error = 0;
|
||||||
|
char *c;
|
||||||
|
|
||||||
|
c = malloc(strlen("Got an argument") + 1);
|
||||||
|
if (!c) {
|
||||||
|
error = -1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!arg) {
|
||||||
|
error = -1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
strcpy(c, "Got an argument")
|
||||||
|
*out = c;
|
||||||
|
|
||||||
|
out:
|
||||||
|
if (error)
|
||||||
|
free(c);
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
When calling functions that return an error code, you should assign the error
|
||||||
|
code to an `error` variable and, in case an error case is indicated and no
|
||||||
|
custom error handling is required, return that error code:
|
||||||
|
|
||||||
|
```c
|
||||||
|
int foobar(void)
|
||||||
|
{
|
||||||
|
int error;
|
||||||
|
|
||||||
|
if ((error = doit()) < 0)
|
||||||
|
return error;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
When doing multiple function calls where all of the functions return an error
|
||||||
|
code, it's common practice to chain these calls together:
|
||||||
|
|
||||||
|
```c
|
||||||
|
int doit(void)
|
||||||
|
{
|
||||||
|
int error;
|
||||||
|
|
||||||
|
if ((error = dothis()) < 0 ||
|
||||||
|
(error = dothat()) < 0)
|
||||||
|
return error;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## CMake Coding Style
|
||||||
|
|
||||||
|
The following section defines the coding style for our CMake build system.
|
||||||
|
|
||||||
|
### Indentation
|
||||||
|
|
||||||
|
Code is indented by tabs, where a tab is 8 spaces. Each opening scope increases
|
||||||
|
the indentation level.
|
||||||
|
|
||||||
|
```cmake
|
||||||
|
if(CONDITION)
|
||||||
|
doit()
|
||||||
|
endif()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Spaces
|
||||||
|
|
||||||
|
There must be no space between keywords and their opening brace. While this is
|
||||||
|
the same as in our C codebase for function calls, this also applies to
|
||||||
|
conditional keywords. This is done to avoid the awkward-looking `else ()`
|
||||||
|
statement.
|
||||||
|
|
||||||
|
```cmake
|
||||||
|
if(CONDITION)
|
||||||
|
doit()
|
||||||
|
else()
|
||||||
|
dothat()
|
||||||
|
endif()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Case
|
||||||
|
|
||||||
|
While CMake is completely case-insensitive when it comes to function calls, we
|
||||||
|
want to agree on a common coding style for this. To reduce the danger of
|
||||||
|
repetitive strain injuries, all function calls should be lower-case (NB: this is
|
||||||
|
not currently the case yet, but introduced as a new coding style by this
|
||||||
|
document).
|
||||||
|
|
||||||
|
Variables are written all-uppercase. In contrast to functions, variables are
|
||||||
|
case-sensitive in CMake. As CMake itself uses upper-case variables in all
|
||||||
|
places, we should follow suit and do the same.
|
||||||
|
|
||||||
|
Control flow keywords must be all lowercase. In contrast to that, test keywords
|
||||||
|
must be all uppercase:
|
||||||
|
|
||||||
|
```cmake
|
||||||
|
if(NOT CONDITION)
|
||||||
|
doit()
|
||||||
|
elseif(FOO AND BAR)
|
||||||
|
dothat()
|
||||||
|
endif()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Targets
|
||||||
|
|
||||||
|
CMake code should not use functions that modify the global scope but prefer
|
||||||
|
their targeted equivalents, instead. E.g. instead of using
|
||||||
|
`include_directories()`, you must use `target_include_directories()`. An
|
||||||
|
exception to this rule is setting up global compiler flags like warnings or
|
||||||
|
flags required to set up the build type.
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
Dependencies should not be discovered or set up in the main "CMakeLists.txt"
|
||||||
|
module. Instead, they should either have their own module in our top-level
|
||||||
|
"cmake/" directory or have a "CMakeLists.txt" in their respective "deps/"
|
||||||
|
directory in case it is a vendored library. All dependencies should expose
|
||||||
|
interface library targets that can be linked against with
|
||||||
|
`target_link_libraries()`.
|
@ -48,9 +48,11 @@ int lg2_add(git_repository *repo, int argc, char **argv)
|
|||||||
git_index_matched_path_cb matched_cb = NULL;
|
git_index_matched_path_cb matched_cb = NULL;
|
||||||
git_index *index;
|
git_index *index;
|
||||||
git_strarray array = {0};
|
git_strarray array = {0};
|
||||||
struct index_options options;
|
struct index_options options = {0};
|
||||||
struct args_info args = ARGS_INFO_INIT;
|
struct args_info args = ARGS_INFO_INIT;
|
||||||
|
|
||||||
|
options.mode = INDEX_ADD;
|
||||||
|
|
||||||
/* Parse the options & arguments. */
|
/* Parse the options & arguments. */
|
||||||
parse_opts(NULL, &options, &args);
|
parse_opts(NULL, &options, &args);
|
||||||
strarray_from_args(&array, &args);
|
strarray_from_args(&array, &args);
|
||||||
|
@ -239,7 +239,7 @@ next:
|
|||||||
|
|
||||||
out:
|
out:
|
||||||
git_reference_free(remote_ref);
|
git_reference_free(remote_ref);
|
||||||
git_strarray_free(&remotes);
|
git_strarray_dispose(&remotes);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
84
examples/commit.c
Normal file
84
examples/commit.c
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
/*
|
||||||
|
* libgit2 "commit" example - shows how to create a git commit
|
||||||
|
*
|
||||||
|
* Written by the libgit2 contributors
|
||||||
|
*
|
||||||
|
* To the extent possible under law, the author(s) have dedicated all copyright
|
||||||
|
* and related and neighboring rights to this software to the public domain
|
||||||
|
* worldwide. This software is distributed without any warranty.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the CC0 Public Domain Dedication along
|
||||||
|
* with this software. If not, see
|
||||||
|
* <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This example demonstrates the libgit2 commit APIs to roughly
|
||||||
|
* simulate `git commit` with the commit message argument.
|
||||||
|
*
|
||||||
|
* This does not have:
|
||||||
|
*
|
||||||
|
* - Robust error handling
|
||||||
|
* - Most of the `git commit` options
|
||||||
|
*
|
||||||
|
* This does have:
|
||||||
|
*
|
||||||
|
* - Example of performing a git commit with a comment
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int lg2_commit(git_repository *repo, int argc, char **argv)
|
||||||
|
{
|
||||||
|
const char *opt = argv[1];
|
||||||
|
const char *comment = argv[2];
|
||||||
|
int error;
|
||||||
|
|
||||||
|
git_oid commit_oid,tree_oid;
|
||||||
|
git_tree *tree;
|
||||||
|
git_index *index;
|
||||||
|
git_object *parent = NULL;
|
||||||
|
git_reference *ref = NULL;
|
||||||
|
git_signature *signature;
|
||||||
|
|
||||||
|
/* Validate args */
|
||||||
|
if (argc < 3 || strcmp(opt, "-m") != 0) {
|
||||||
|
printf ("USAGE: %s -m <comment>\n", argv[0]);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
error = git_revparse_ext(&parent, &ref, repo, "HEAD");
|
||||||
|
if (error == GIT_ENOTFOUND) {
|
||||||
|
printf("HEAD not found. Creating first commit\n");
|
||||||
|
error = 0;
|
||||||
|
} else if (error != 0) {
|
||||||
|
const git_error *err = git_error_last();
|
||||||
|
if (err) printf("ERROR %d: %s\n", err->klass, err->message);
|
||||||
|
else printf("ERROR %d: no detailed info\n", error);
|
||||||
|
}
|
||||||
|
|
||||||
|
check_lg2(git_repository_index(&index, repo), "Could not open repository index", NULL);
|
||||||
|
check_lg2(git_index_write_tree(&tree_oid, index), "Could not write tree", NULL);;
|
||||||
|
check_lg2(git_index_write(index), "Could not write index", NULL);;
|
||||||
|
|
||||||
|
check_lg2(git_tree_lookup(&tree, repo, &tree_oid), "Error looking up tree", NULL);
|
||||||
|
|
||||||
|
check_lg2(git_signature_default(&signature, repo), "Error creating signature", NULL);
|
||||||
|
|
||||||
|
check_lg2(git_commit_create_v(
|
||||||
|
&commit_oid,
|
||||||
|
repo,
|
||||||
|
"HEAD",
|
||||||
|
signature,
|
||||||
|
signature,
|
||||||
|
NULL,
|
||||||
|
comment,
|
||||||
|
tree,
|
||||||
|
parent ? 1 : 0, parent), "Error creating commit", NULL);
|
||||||
|
|
||||||
|
git_index_free(index);
|
||||||
|
git_signature_free(signature);
|
||||||
|
git_tree_free(tree);
|
||||||
|
|
||||||
|
return error;
|
||||||
|
}
|
@ -59,6 +59,7 @@ extern int lg2_blame(git_repository *repo, int argc, char **argv);
|
|||||||
extern int lg2_cat_file(git_repository *repo, int argc, char **argv);
|
extern int lg2_cat_file(git_repository *repo, int argc, char **argv);
|
||||||
extern int lg2_checkout(git_repository *repo, int argc, char **argv);
|
extern int lg2_checkout(git_repository *repo, int argc, char **argv);
|
||||||
extern int lg2_clone(git_repository *repo, int argc, char **argv);
|
extern int lg2_clone(git_repository *repo, int argc, char **argv);
|
||||||
|
extern int lg2_commit(git_repository *repo, int argc, char **argv);
|
||||||
extern int lg2_config(git_repository *repo, int argc, char **argv);
|
extern int lg2_config(git_repository *repo, int argc, char **argv);
|
||||||
extern int lg2_describe(git_repository *repo, int argc, char **argv);
|
extern int lg2_describe(git_repository *repo, int argc, char **argv);
|
||||||
extern int lg2_diff(git_repository *repo, int argc, char **argv);
|
extern int lg2_diff(git_repository *repo, int argc, char **argv);
|
||||||
@ -71,6 +72,7 @@ extern int lg2_log(git_repository *repo, int argc, char **argv);
|
|||||||
extern int lg2_ls_files(git_repository *repo, int argc, char **argv);
|
extern int lg2_ls_files(git_repository *repo, int argc, char **argv);
|
||||||
extern int lg2_ls_remote(git_repository *repo, int argc, char **argv);
|
extern int lg2_ls_remote(git_repository *repo, int argc, char **argv);
|
||||||
extern int lg2_merge(git_repository *repo, int argc, char **argv);
|
extern int lg2_merge(git_repository *repo, int argc, char **argv);
|
||||||
|
extern int lg2_push(git_repository *repo, int argc, char **argv);
|
||||||
extern int lg2_remote(git_repository *repo, int argc, char **argv);
|
extern int lg2_remote(git_repository *repo, int argc, char **argv);
|
||||||
extern int lg2_rev_list(git_repository *repo, int argc, char **argv);
|
extern int lg2_rev_list(git_repository *repo, int argc, char **argv);
|
||||||
extern int lg2_rev_parse(git_repository *repo, int argc, char **argv);
|
extern int lg2_rev_parse(git_repository *repo, int argc, char **argv);
|
||||||
|
@ -707,7 +707,7 @@ static void reference_listing(git_repository *repo)
|
|||||||
git_reference_free(ref);
|
git_reference_free(ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
git_strarray_free(&ref_list);
|
git_strarray_dispose(&ref_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,6 +15,7 @@ struct {
|
|||||||
{ "cat-file", lg2_cat_file, 1 },
|
{ "cat-file", lg2_cat_file, 1 },
|
||||||
{ "checkout", lg2_checkout, 1 },
|
{ "checkout", lg2_checkout, 1 },
|
||||||
{ "clone", lg2_clone, 0 },
|
{ "clone", lg2_clone, 0 },
|
||||||
|
{ "commit", lg2_commit, 1 },
|
||||||
{ "config", lg2_config, 1 },
|
{ "config", lg2_config, 1 },
|
||||||
{ "describe", lg2_describe, 1 },
|
{ "describe", lg2_describe, 1 },
|
||||||
{ "diff", lg2_diff, 1 },
|
{ "diff", lg2_diff, 1 },
|
||||||
@ -27,6 +28,7 @@ struct {
|
|||||||
{ "ls-files", lg2_ls_files, 1 },
|
{ "ls-files", lg2_ls_files, 1 },
|
||||||
{ "ls-remote", lg2_ls_remote, 1 },
|
{ "ls-remote", lg2_ls_remote, 1 },
|
||||||
{ "merge", lg2_merge, 1 },
|
{ "merge", lg2_merge, 1 },
|
||||||
|
{ "push", lg2_push, 1 },
|
||||||
{ "remote", lg2_remote, 1 },
|
{ "remote", lg2_remote, 1 },
|
||||||
{ "rev-list", lg2_rev_list, 1 },
|
{ "rev-list", lg2_rev_list, 1 },
|
||||||
{ "rev-parse", lg2_rev_parse, 1 },
|
{ "rev-parse", lg2_rev_parse, 1 },
|
||||||
|
@ -434,21 +434,28 @@ static int parse_options(
|
|||||||
else if (!strcmp(a, "--reverse"))
|
else if (!strcmp(a, "--reverse"))
|
||||||
set_sorting(s, GIT_SORT_REVERSE);
|
set_sorting(s, GIT_SORT_REVERSE);
|
||||||
else if (match_str_arg(&opt->author, &args, "--author"))
|
else if (match_str_arg(&opt->author, &args, "--author"))
|
||||||
/** Found valid --author */;
|
/** Found valid --author */
|
||||||
|
;
|
||||||
else if (match_str_arg(&opt->committer, &args, "--committer"))
|
else if (match_str_arg(&opt->committer, &args, "--committer"))
|
||||||
/** Found valid --committer */;
|
/** Found valid --committer */
|
||||||
|
;
|
||||||
else if (match_str_arg(&opt->grep, &args, "--grep"))
|
else if (match_str_arg(&opt->grep, &args, "--grep"))
|
||||||
/** Found valid --grep */;
|
/** Found valid --grep */
|
||||||
|
;
|
||||||
else if (match_str_arg(&s->repodir, &args, "--git-dir"))
|
else if (match_str_arg(&s->repodir, &args, "--git-dir"))
|
||||||
/** Found git-dir. */;
|
/** Found git-dir. */
|
||||||
|
;
|
||||||
else if (match_int_arg(&opt->skip, &args, "--skip", 0))
|
else if (match_int_arg(&opt->skip, &args, "--skip", 0))
|
||||||
/** Found valid --skip. */;
|
/** Found valid --skip. */
|
||||||
|
;
|
||||||
else if (match_int_arg(&opt->limit, &args, "--max-count", 0))
|
else if (match_int_arg(&opt->limit, &args, "--max-count", 0))
|
||||||
/** Found valid --max-count. */;
|
/** Found valid --max-count. */
|
||||||
|
;
|
||||||
else if (a[1] >= '0' && a[1] <= '9')
|
else if (a[1] >= '0' && a[1] <= '9')
|
||||||
is_integer(&opt->limit, a + 1, 0);
|
is_integer(&opt->limit, a + 1, 0);
|
||||||
else if (match_int_arg(&opt->limit, &args, "-n", 0))
|
else if (match_int_arg(&opt->limit, &args, "-n", 0))
|
||||||
/** Found valid -n. */;
|
/** Found valid -n. */
|
||||||
|
;
|
||||||
else if (!strcmp(a, "--merges"))
|
else if (!strcmp(a, "--merges"))
|
||||||
opt->min_parents = 2;
|
opt->min_parents = 2;
|
||||||
else if (!strcmp(a, "--no-merges"))
|
else if (!strcmp(a, "--no-merges"))
|
||||||
@ -458,9 +465,11 @@ static int parse_options(
|
|||||||
else if (!strcmp(a, "--no-max-parents"))
|
else if (!strcmp(a, "--no-max-parents"))
|
||||||
opt->max_parents = -1;
|
opt->max_parents = -1;
|
||||||
else if (match_int_arg(&opt->max_parents, &args, "--max-parents=", 1))
|
else if (match_int_arg(&opt->max_parents, &args, "--max-parents=", 1))
|
||||||
/** Found valid --max-parents. */;
|
/** Found valid --max-parents. */
|
||||||
|
;
|
||||||
else if (match_int_arg(&opt->min_parents, &args, "--min-parents=", 0))
|
else if (match_int_arg(&opt->min_parents, &args, "--min-parents=", 0))
|
||||||
/** Found valid --min_parents. */;
|
/** Found valid --min_parents. */
|
||||||
|
;
|
||||||
else if (!strcmp(a, "-p") || !strcmp(a, "-u") || !strcmp(a, "--patch"))
|
else if (!strcmp(a, "-p") || !strcmp(a, "-u") || !strcmp(a, "--patch"))
|
||||||
opt->show_diff = 1;
|
opt->show_diff = 1;
|
||||||
else if (!strcmp(a, "--log-size"))
|
else if (!strcmp(a, "--log-size"))
|
||||||
|
56
examples/push.c
Normal file
56
examples/push.c
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* libgit2 "push" example - shows how to push to remote
|
||||||
|
*
|
||||||
|
* Written by the libgit2 contributors
|
||||||
|
*
|
||||||
|
* To the extent possible under law, the author(s) have dedicated all copyright
|
||||||
|
* and related and neighboring rights to this software to the public domain
|
||||||
|
* worldwide. This software is distributed without any warranty.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the CC0 Public Domain Dedication along
|
||||||
|
* with this software. If not, see
|
||||||
|
* <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This example demonstrates the libgit2 push API to roughly
|
||||||
|
* simulate `git push`.
|
||||||
|
*
|
||||||
|
* This does not have:
|
||||||
|
*
|
||||||
|
* - Robust error handling
|
||||||
|
* - Any of the `git push` options
|
||||||
|
*
|
||||||
|
* This does have:
|
||||||
|
*
|
||||||
|
* - Example of push to origin/master
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Entry point for this command */
|
||||||
|
int lg2_push(git_repository *repo, int argc, char **argv) {
|
||||||
|
git_push_options options;
|
||||||
|
git_remote* remote = NULL;
|
||||||
|
char *refspec = "refs/heads/master";
|
||||||
|
const git_strarray refspecs = {
|
||||||
|
&refspec,
|
||||||
|
1
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Validate args */
|
||||||
|
if (argc > 1) {
|
||||||
|
printf ("USAGE: %s\n\nsorry, no arguments supported yet\n", argv[0]);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
check_lg2(git_remote_lookup(&remote, repo, "origin" ), "Unable to lookup remote", NULL);
|
||||||
|
|
||||||
|
check_lg2(git_push_options_init(&options, GIT_PUSH_OPTIONS_VERSION ), "Error initializing push", NULL);
|
||||||
|
|
||||||
|
check_lg2(git_remote_push(remote, &refspecs, &options), "Error pushing", NULL);
|
||||||
|
|
||||||
|
printf("pushed\n");
|
||||||
|
return 0;
|
||||||
|
}
|
@ -129,7 +129,7 @@ static int cmd_rename(git_repository *repo, struct remote_opts *o)
|
|||||||
puts(problems.strings[0]);
|
puts(problems.strings[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
git_strarray_free(&problems);
|
git_strarray_dispose(&problems);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@ static int cmd_show(git_repository *repo, struct remote_opts *o)
|
|||||||
git_remote_free(remote);
|
git_remote_free(remote);
|
||||||
}
|
}
|
||||||
|
|
||||||
git_strarray_free(&remotes);
|
git_strarray_dispose(&remotes);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ static void action_list_tags(tag_state *state)
|
|||||||
each_tag(tag_names.strings[i], state);
|
each_tag(tag_names.strings[i], state);
|
||||||
}
|
}
|
||||||
|
|
||||||
git_strarray_free(&tag_names);
|
git_strarray_dispose(&tag_names);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void action_delete_tag(tag_state *state)
|
static void action_delete_tag(tag_state *state)
|
||||||
|
BIN
fuzzers/corpora/midx/037cbbe0dc03807dd9d9e8629f1712d7df34ee18
Normal file
BIN
fuzzers/corpora/midx/037cbbe0dc03807dd9d9e8629f1712d7df34ee18
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/039ee34fef8f323ed618a10abc0109df123d0cb5
Normal file
BIN
fuzzers/corpora/midx/039ee34fef8f323ed618a10abc0109df123d0cb5
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
絎<02>綢
|
BIN
fuzzers/corpora/midx/055ca4cbc961ebf5fd5c922b4f73880d3fbfe39d
Normal file
BIN
fuzzers/corpora/midx/055ca4cbc961ebf5fd5c922b4f73880d3fbfe39d
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/05c4e5eb1b97bc9b6973921fcb30d4c5e2eb79e4
Normal file
BIN
fuzzers/corpora/midx/05c4e5eb1b97bc9b6973921fcb30d4c5e2eb79e4
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/0672eeda541a191cfc68d521a3c7ac0aac4057a6
Normal file
BIN
fuzzers/corpora/midx/0672eeda541a191cfc68d521a3c7ac0aac4057a6
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/06a58d1bd5562a668ebf01ef297fd774e0e587a6
Normal file
BIN
fuzzers/corpora/midx/06a58d1bd5562a668ebf01ef297fd774e0e587a6
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/06bf7c2461ae1049030f31b83ae76babfcc20c83
Normal file
BIN
fuzzers/corpora/midx/06bf7c2461ae1049030f31b83ae76babfcc20c83
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/06c2db67ea65758d971346bfd6beaa61ed12f22c
Normal file
BIN
fuzzers/corpora/midx/06c2db67ea65758d971346bfd6beaa61ed12f22c
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/07f88eefaf12609b7370fe78b82be2955f1b41fd
Normal file
BIN
fuzzers/corpora/midx/07f88eefaf12609b7370fe78b82be2955f1b41fd
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/08495c5f3828a56c167de870d385c46ffdce03c5
Normal file
BIN
fuzzers/corpora/midx/08495c5f3828a56c167de870d385c46ffdce03c5
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/08ec8594e5b35fb9e8e0726584f720154f0b2b5d
Normal file
BIN
fuzzers/corpora/midx/08ec8594e5b35fb9e8e0726584f720154f0b2b5d
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
腋7
|
@ -0,0 +1 @@
|
|||||||
|
ÃØseed
|
BIN
fuzzers/corpora/midx/09b40dd618373bfe4d3f2838f686a70f645e640b
Normal file
BIN
fuzzers/corpora/midx/09b40dd618373bfe4d3f2838f686a70f645e640b
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/0a00ef44d234c18d365ec41724dbf4f21b09d0c5
Normal file
BIN
fuzzers/corpora/midx/0a00ef44d234c18d365ec41724dbf4f21b09d0c5
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/0a94e9f4a9b8cf56d52a9e3e7f2fa9a0a5c80d30
Normal file
BIN
fuzzers/corpora/midx/0a94e9f4a9b8cf56d52a9e3e7f2fa9a0a5c80d30
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/0b35a123104b7872a7f15a710a23ef3594ace04d
Normal file
BIN
fuzzers/corpora/midx/0b35a123104b7872a7f15a710a23ef3594ace04d
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/0c3d7e6be32c014ea873440b0f095961d391af1a
Normal file
BIN
fuzzers/corpora/midx/0c3d7e6be32c014ea873440b0f095961d391af1a
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/0c65de477b89afc312a7e89cde06f8a17f65bd54
Normal file
BIN
fuzzers/corpora/midx/0c65de477b89afc312a7e89cde06f8a17f65bd54
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/0c81d0f368e979d2a0eb4598cbf1c9283936ba0c
Normal file
BIN
fuzzers/corpora/midx/0c81d0f368e979d2a0eb4598cbf1c9283936ba0c
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/0c95a44ae995070a5279a2991c36de2251081460
Normal file
BIN
fuzzers/corpora/midx/0c95a44ae995070a5279a2991c36de2251081460
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/0de38e2cb13167df7d5a882570633596f64bc4f4
Normal file
BIN
fuzzers/corpora/midx/0de38e2cb13167df7d5a882570633596f64bc4f4
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/0de96aa193045315457ade63c2614610c503db9e
Normal file
BIN
fuzzers/corpora/midx/0de96aa193045315457ade63c2614610c503db9e
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD>H
|
BIN
fuzzers/corpora/midx/0e44fc9176fe2c1bae4209369da5bc057f54b2d2
Normal file
BIN
fuzzers/corpora/midx/0e44fc9176fe2c1bae4209369da5bc057f54b2d2
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD>*
|
BIN
fuzzers/corpora/midx/10d542d5c7da060a5f0664e21478a0d598e29844
Normal file
BIN
fuzzers/corpora/midx/10d542d5c7da060a5f0664e21478a0d598e29844
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
聟ロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロ丸ロロロロロロロロロヒロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロヒロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロロ
|
BIN
fuzzers/corpora/midx/119b58eb353aa344264005016297fb911510ea0d
Normal file
BIN
fuzzers/corpora/midx/119b58eb353aa344264005016297fb911510ea0d
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/127626832c30d6d94bb29384c0fde7ac6bca75ec
Normal file
BIN
fuzzers/corpora/midx/127626832c30d6d94bb29384c0fde7ac6bca75ec
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/1284f1a162588d4de87ca17149474644a0863b27
Normal file
BIN
fuzzers/corpora/midx/1284f1a162588d4de87ca17149474644a0863b27
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/1458599f19f1a967c787562bf8ec3e67677da9c8
Normal file
BIN
fuzzers/corpora/midx/1458599f19f1a967c787562bf8ec3e67677da9c8
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/14ba6c1ddd05b22c6f2eae5f894721cd3efcbb16
Normal file
BIN
fuzzers/corpora/midx/14ba6c1ddd05b22c6f2eae5f894721cd3efcbb16
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/158cdc0a5aa005f167a8588d0beed9eee4aa36f2
Normal file
BIN
fuzzers/corpora/midx/158cdc0a5aa005f167a8588d0beed9eee4aa36f2
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/15dafc6fa800327f694b5eb2fc4ebf007be9c117
Normal file
BIN
fuzzers/corpora/midx/15dafc6fa800327f694b5eb2fc4ebf007be9c117
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/1613ed4b2e909871f8897fd6354ff80a4ac12f87
Normal file
BIN
fuzzers/corpora/midx/1613ed4b2e909871f8897fd6354ff80a4ac12f87
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/16daf4cb967bb47cf4566e9be7d96d3125bd2e12
Normal file
BIN
fuzzers/corpora/midx/16daf4cb967bb47cf4566e9be7d96d3125bd2e12
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/177783dce78efee878f6d6020fd87ab107bb11a1
Normal file
BIN
fuzzers/corpora/midx/177783dce78efee878f6d6020fd87ab107bb11a1
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/17a5090400a1fedc45070e4b530a26f320a89097
Normal file
BIN
fuzzers/corpora/midx/17a5090400a1fedc45070e4b530a26f320a89097
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/17dea5cfa498f4d54384289a1daed0d15a85e7cc
Normal file
BIN
fuzzers/corpora/midx/17dea5cfa498f4d54384289a1daed0d15a85e7cc
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/17e76ae5b54316679981113f52c27edc87dbcdea
Normal file
BIN
fuzzers/corpora/midx/17e76ae5b54316679981113f52c27edc87dbcdea
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/191ed5e9334693c53fc843f692dbc3c2c63e8241
Normal file
BIN
fuzzers/corpora/midx/191ed5e9334693c53fc843f692dbc3c2c63e8241
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/196a0ba4edb5bbfd66c1cda669abf0496573cf0e
Normal file
BIN
fuzzers/corpora/midx/196a0ba4edb5bbfd66c1cda669abf0496573cf0e
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/19742b6cee79fa5bf9b27dcbe367c82d0a399904
Normal file
BIN
fuzzers/corpora/midx/19742b6cee79fa5bf9b27dcbe367c82d0a399904
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/1a21d7581d3b0a8d67934d48e91d45bd818836e8
Normal file
BIN
fuzzers/corpora/midx/1a21d7581d3b0a8d67934d48e91d45bd818836e8
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/1b2f96c5d75c7ca09b1012be4e6c3a7b248ed924
Normal file
BIN
fuzzers/corpora/midx/1b2f96c5d75c7ca09b1012be4e6c3a7b248ed924
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/1b604ff0683d0e23dc7945431f6514ba30d6ca0d
Normal file
BIN
fuzzers/corpora/midx/1b604ff0683d0e23dc7945431f6514ba30d6ca0d
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/1b771dd5bd3ae2b1c42c4efe6c896c83b88a4f91
Normal file
BIN
fuzzers/corpora/midx/1b771dd5bd3ae2b1c42c4efe6c896c83b88a4f91
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/1b793a4ee73fa8bf423da70fca5f39ef32a8d288
Normal file
BIN
fuzzers/corpora/midx/1b793a4ee73fa8bf423da70fca5f39ef32a8d288
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>蕨蕨蕨蕨蕨蕨蕨蕨蕨蕨蕨蕨蕨蕨<EFBFBD>
|
BIN
fuzzers/corpora/midx/1cc0068f9f63b12dc8fdd38f9ebfb96c42664e95
Normal file
BIN
fuzzers/corpora/midx/1cc0068f9f63b12dc8fdd38f9ebfb96c42664e95
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/1de6e1f5579da6e5c40f4ee23ac62e29e4f90541
Normal file
BIN
fuzzers/corpora/midx/1de6e1f5579da6e5c40f4ee23ac62e29e4f90541
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/1eec93083260ebfab5f4c6d13119cf27c374b7e9
Normal file
BIN
fuzzers/corpora/midx/1eec93083260ebfab5f4c6d13119cf27c374b7e9
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/1f0f574addd363d1fed131289f301c5c033aaa8f
Normal file
BIN
fuzzers/corpora/midx/1f0f574addd363d1fed131289f301c5c033aaa8f
Normal file
Binary file not shown.
BIN
fuzzers/corpora/midx/1f3e85cffdb545c1ba7c8bbe1ca18ec13e341038
Normal file
BIN
fuzzers/corpora/midx/1f3e85cffdb545c1ba7c8bbe1ca18ec13e341038
Normal file
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