Skip to content

Commit eab9618

Browse files
author
John Haley
committed
Update to libgit2 v0.24.1
1 parent 138f398 commit eab9618

505 files changed

Lines changed: 14813 additions & 5170 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

generate/input/libgit2-docs.json

Lines changed: 2400 additions & 1834 deletions
Large diffs are not rendered by default.

vendor/libgit2/.mailmap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Xavier L. <xavier.l@afrosoft.tk> <xavier.l@afrosoft.tk>
1616
Sascha Cunz <sascha@babbelbox.org> <Sascha@BabbelBox.org>
1717
Authmillenon <authmillenon@googlemail.com> <martin@ucsmail.de>
1818
Authmillenon <authmillenon@googlemail.com> <authmillenon@googlemail.com>
19-
Edward Thomson <ethomson@microsoft.com> <ethomson@edwardthomson.com>
19+
Edward Thomson <ethomson@github.com> <ethomson@microsoft.com>
20+
Edward Thomson <ethomson@github.com> <ethomson@edwardthomson.com>
2021
J. David Ibáñez <jdavid.ibp@gmail.com> <jdavid@itaapy.com>
2122
Russell Belfer <rb@github.com> <arrbee@arrbee.com>

vendor/libgit2/.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ matrix:
4646
- compiler: gcc
4747
env:
4848
- VALGRIND=1
49-
OPTIONS="-DBUILD_CLAR=ON -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Debug"
49+
OPTIONS="-DBUILD_CLAR=ON -DBUILD_EXAMPLES=OFF -DDEBUG_POOL=ON -DCMAKE_BUILD_TYPE=Debug"
5050
os: linux
5151
allow_failures:
5252
- env: COVERITY=1
5353
- env:
5454
- VALGRIND=1
55-
OPTIONS="-DBUILD_CLAR=ON -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Debug"
55+
OPTIONS="-DBUILD_CLAR=ON -DBUILD_EXAMPLES=OFF -DDEBUG_POOL=ON -DCMAKE_BUILD_TYPE=Debug"
5656

5757
install:
5858
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then ./script/install-deps-${TRAVIS_OS_NAME}.sh; fi

vendor/libgit2/CHANGELOG.md

Lines changed: 113 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
v0.23 + 1
1+
v0.24 + 1
22
-------
33

44
### Changes or improvements
@@ -7,6 +7,116 @@ v0.23 + 1
77

88
### API removals
99

10+
### Breaking API changes
11+
12+
v0.24
13+
-------
14+
15+
### Changes or improvements
16+
17+
* Custom filters can now be registered with wildcard attributes, for
18+
example `filter=*`. Consumers should examine the attributes parameter
19+
of the `check` function for details.
20+
21+
* Symlinks are now followed when locking a file, which can be
22+
necessary when multiple worktrees share a base repository.
23+
24+
* You can now set your own user-agent to be sent for HTTP requests by
25+
using the `GIT_OPT_SET_USER_AGENT` with `git_libgit2_opts()`.
26+
27+
* You can set custom HTTP header fields to be sent along with requests
28+
by passing them in the fetch and push options.
29+
30+
* Tree objects are now assumed to be sorted. If a tree is not
31+
correctly formed, it will give bad results. This is the git approach
32+
and cuts a significant amount of time when reading the trees.
33+
34+
* Filter registration is now protected against concurrent
35+
registration.
36+
37+
* Filenames which are not valid on Windows in an index no longer cause
38+
to fail to parse it on that OS.
39+
40+
* Rebases can now be performed purely in-memory, without touching the
41+
repository's workdir.
42+
43+
* When adding objects to the index, or when creating new tree or commit
44+
objects, the inputs are validated to ensure that the dependent objects
45+
exist and are of the correct type. This object validation can be
46+
disabled with the GIT_OPT_ENABLE_STRICT_OBJECT_CREATION option.
47+
48+
* The WinHTTP transport's handling of bad credentials now behaves like
49+
the others, asking for credentials again.
50+
51+
### API additions
52+
53+
* `git_config_lock()` has been added, which allow for
54+
transactional/atomic complex updates to the configuration, removing
55+
the opportunity for concurrent operations and not committing any
56+
changes until the unlock.
57+
58+
* `git_diff_options` added a new callback `progress_cb` to report on the
59+
progress of the diff as files are being compared. The documentation of
60+
the existing callback `notify_cb` was updated to reflect that it only
61+
gets called when new deltas are added to the diff.
62+
63+
* `git_fetch_options` and `git_push_options` have gained a `custom_headers`
64+
field to set the extra HTTP header fields to send.
65+
66+
* `git_stream_register_tls()` lets you register a callback to be used
67+
as the constructor for a TLS stream instead of the libgit2 built-in
68+
one.
69+
70+
* `git_commit_header_field()` allows you to look up a specific header
71+
field in a commit.
72+
73+
* `git_commit_extract_signature()` extracts the signature from a
74+
commit and gives you both the signature and the signed data so you
75+
can verify it.
76+
77+
### API removals
78+
79+
* No APIs were removed in this version.
80+
81+
### Breaking API changes
82+
83+
* The `git_merge_tree_flag_t` is now `git_merge_flag_t`. Subsequently,
84+
its members are no longer prefixed with `GIT_MERGE_TREE_FLAG` but are
85+
now prefixed with `GIT_MERGE_FLAG`, and the `tree_flags` field of the
86+
`git_merge_options` structure is now named `flags`.
87+
88+
* The `git_merge_file_flags_t` enum is now `git_merge_file_flag_t` for
89+
consistency with other enum type names.
90+
91+
* `git_cert` descendent types now have a proper `parent` member
92+
93+
* It is the responsibility of the refdb backend to decide what to do
94+
with the reflog on ref deletion. The file-based backend must delete
95+
it, a database-backed one may wish to archive it.
96+
97+
* `git_config_backend` has gained two entries. `lock` and `unlock`
98+
with which to implement the transactional/atomic semantics for the
99+
configuration backend.
100+
101+
* `git_index_add` and `git_index_conflict_add()` will now use the case
102+
as provided by the caller on case insensitive systems. Previous
103+
versions would keep the case as it existed in the index. This does
104+
not affect the higher-level `git_index_add_bypath` or
105+
`git_index_add_frombuffer` functions.
106+
107+
* The `notify_payload` field of `git_diff_options` was renamed to `payload`
108+
to reflect that it's also the payload for the new progress callback.
109+
110+
* The `git_config_level_t` enum has gained a higher-priority value
111+
`GIT_CONFIG_LEVEL_PROGRAMDATA` which represent a rough Windows equivalent
112+
to the system level configuration.
113+
114+
* `git_rebase_init()` not also takes a merge options.
115+
116+
* The index no longer performs locking itself. This is not something
117+
users of the library should have been relying on as it's not part of
118+
the concurrency guarantees.
119+
10120
v0.23
11121
------
12122

@@ -239,8 +349,8 @@ v0.23
239349

240350
* `git_rebase_options` now contains a `git_checkout_options` struct
241351
that will be used for functions that modify the working directory,
242-
namely `git_checkout_init`, `git_checkout_next` and
243-
`git_checkout_abort`. As a result, `git_rebase_open` now also takes
352+
namely `git_rebase_init`, `git_rebase_next` and
353+
`git_rebase_abort`. As a result, `git_rebase_open` now also takes
244354
a `git_rebase_options` and only the `git_rebase_init` and
245355
`git_rebase_open` functions take a `git_rebase_options`, where they
246356
will persist the options to subsequent `git_rebase` calls.

vendor/libgit2/CMakeLists.txt

Lines changed: 73 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Mo
2020

2121
INCLUDE(CheckLibraryExists)
2222
INCLUDE(CheckFunctionExists)
23+
INCLUDE(CheckStructHasMember)
2324
INCLUDE(AddCFlagIfSupported)
2425
INCLUDE(FindPkgConfig)
2526

@@ -40,6 +41,11 @@ OPTION( USE_SSH "Link with libssh to enable SSH support" ON )
4041
OPTION( USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF )
4142
OPTION( VALGRIND "Configure build for valgrind" OFF )
4243
OPTION( CURL "User curl for HTTP if available" ON)
44+
OPTION( DEBUG_POOL "Enable debug pool allocator" OFF )
45+
46+
IF(DEBUG_POOL)
47+
ADD_DEFINITIONS(-DGIT_DEBUG_POOL)
48+
ENDIF()
4349

4450
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
4551
SET( USE_ICONV ON )
@@ -60,6 +66,10 @@ IF(MSVC)
6066
# are linking statically
6167
OPTION( STATIC_CRT "Link the static CRT libraries" ON )
6268

69+
# If you want to embed a copy of libssh2 into libgit2, pass a
70+
# path to libssh2
71+
OPTION( EMBED_SSH_PATH "Path to libssh2 to embed (Windows)" OFF )
72+
6373
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
6474
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
6575
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE)
@@ -81,6 +91,27 @@ IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
8191
OPTION( USE_OPENSSL "Link with and use openssl library" ON )
8292
ENDIF()
8393

94+
CHECK_STRUCT_HAS_MEMBER ("struct stat" st_mtim "sys/types.h;sys/stat.h"
95+
HAVE_STRUCT_STAT_ST_MTIM LANGUAGE C)
96+
CHECK_STRUCT_HAS_MEMBER ("struct stat" st_mtimespec "sys/types.h;sys/stat.h"
97+
HAVE_STRUCT_STAT_ST_MTIMESPEC LANGUAGE C)
98+
CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtime_nsec sys/stat.h
99+
HAVE_STRUCT_STAT_MTIME_NSEC LANGUAGE C)
100+
101+
IF (HAVE_STRUCT_STAT_ST_MTIM)
102+
CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtim.tv_nsec sys/stat.h
103+
HAVE_STRUCT_STAT_NSEC LANGUAGE C)
104+
ELSEIF (HAVE_STRUCT_STAT_ST_MTIMESPEC)
105+
CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtimespec.tv_nsec sys/stat.h
106+
HAVE_STRUCT_STAT_NSEC LANGUAGE C)
107+
ELSE ()
108+
SET( HAVE_STRUCT_STAT_NSEC ON )
109+
ENDIF()
110+
111+
IF (HAVE_STRUCT_STAT_NSEC OR WIN32)
112+
OPTION( USE_NSEC "Care about sub-second file mtimes and ctimes" OFF )
113+
ENDIF()
114+
84115
# This variable will contain the libraries we need to put into
85116
# libgit2.pc's Requires.private. That is, what we're linking to or
86117
# what someone who's statically linking us needs to link to.
@@ -133,13 +164,13 @@ FUNCTION(TARGET_OS_LIBRARIES target)
133164
ENDIF()
134165
ENDFUNCTION()
135166

136-
# For the MSVC IDE, this function splits up the source files like windows
137-
# explorer does. This is esp. useful with the libgit2_clar project, were
138-
# usually 2 or more files share the same name. Sadly, this file grouping
139-
# is a per-directory option in cmake and not per-target, resulting in
140-
# empty virtual folders "tests" for the git2.dll
141-
FUNCTION(MSVC_SPLIT_SOURCES target)
142-
IF(MSVC_IDE)
167+
# This function splits the sources files up into their appropriate
168+
# subdirectories. This is especially useful for IDEs like Xcode and
169+
# Visual Studio, so that you can navigate into the libgit2_clar project,
170+
# and see the folders within the tests folder (instead of just seeing all
171+
# source and tests in a single folder.)
172+
FUNCTION(IDE_SPLIT_SOURCES target)
173+
IF(MSVC_IDE OR CMAKE_GENERATOR STREQUAL Xcode)
143174
GET_TARGET_PROPERTY(sources ${target} SOURCES)
144175
FOREACH(source ${sources})
145176
IF(source MATCHES ".*/")
@@ -190,6 +221,13 @@ IF (COREFOUNDATION_FOUND)
190221
ENDIF()
191222

192223

224+
IF (WIN32 AND EMBED_SSH_PATH)
225+
FILE(GLOB SRC_SSH "${EMBED_SSH_PATH}/src/*.c")
226+
INCLUDE_DIRECTORIES("${EMBED_SSH_PATH}/include")
227+
FILE(WRITE "${EMBED_SSH_PATH}/src/libssh2_config.h" "#define HAVE_WINCNG\n#define LIBSSH2_WINCNG\n#include \"../win32/libssh2_config.h\"")
228+
ADD_DEFINITIONS(-DGIT_SSH)
229+
ENDIF()
230+
193231
IF (WIN32 AND WINHTTP)
194232
ADD_DEFINITIONS(-DGIT_WINHTTP)
195233
INCLUDE_DIRECTORIES(deps/http-parser)
@@ -206,7 +244,7 @@ IF (WIN32 AND WINHTTP)
206244
SET(LIBWINHTTP_PATH "${CMAKE_CURRENT_BINARY_DIR}/deps/winhttp")
207245
FILE(MAKE_DIRECTORY ${LIBWINHTTP_PATH})
208246

209-
IF ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
247+
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
210248
set(WINHTTP_DEF "${CMAKE_CURRENT_SOURCE_DIR}/deps/winhttp/winhttp64.def")
211249
ELSE()
212250
set(WINHTTP_DEF "${CMAKE_CURRENT_SOURCE_DIR}/deps/winhttp/winhttp.def")
@@ -228,7 +266,8 @@ IF (WIN32 AND WINHTTP)
228266
LINK_DIRECTORIES(${LIBWINHTTP_PATH})
229267
ENDIF ()
230268

231-
LINK_LIBRARIES(winhttp rpcrt4 crypt32)
269+
LINK_LIBRARIES(winhttp rpcrt4 crypt32 ole32)
270+
LIST(APPEND LIBGIT2_PC_LIBS "-lwinhttp" "-lrpcrt4" "-lcrypt32" "-lole32")
232271
ELSE ()
233272
IF (CURL)
234273
PKG_CHECK_MODULES(CURL libcurl)
@@ -364,6 +403,7 @@ IF (MSVC)
364403

365404
IF (MSVC_CRTDBG)
366405
SET(CRT_FLAG_DEBUG "${CRT_FLAG_DEBUG} /DGIT_MSVC_CRTDBG")
406+
SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}" "Dbghelp.lib")
367407
ENDIF()
368408

369409
# /Zi - Create debugging information
@@ -372,7 +412,7 @@ IF (MSVC)
372412
# /MTd - Statically link the multithreaded debug version of the CRT
373413
# /MDd - Dynamically link the multithreaded debug version of the CRT
374414
# /RTC1 - Run time checks
375-
SET(CMAKE_C_FLAGS_DEBUG "/Zi /Od /D_DEBUG /RTC1 ${CRT_FLAG_DEBUG}")
415+
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Zi /Od /D_DEBUG /RTC1 ${CRT_FLAG_DEBUG}")
376416

377417
# /DNDEBUG - Disables asserts
378418
# /MT - Statically link the multithreaded release version of the CRT
@@ -424,7 +464,7 @@ ELSE ()
424464
ENDIF()
425465

426466
IF (WIN32 AND NOT CYGWIN)
427-
SET(CMAKE_C_FLAGS_DEBUG "-D_DEBUG")
467+
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
428468
ENDIF ()
429469

430470
IF (MINGW) # MinGW always does PIC and complains if we tell it to
@@ -504,6 +544,18 @@ IF (THREADSAFE)
504544
ADD_DEFINITIONS(-DGIT_THREADS)
505545
ENDIF()
506546

547+
IF (USE_NSEC)
548+
ADD_DEFINITIONS(-DGIT_USE_NSEC)
549+
ENDIF()
550+
551+
IF (HAVE_STRUCT_STAT_ST_MTIM)
552+
ADD_DEFINITIONS(-DGIT_USE_STAT_MTIM)
553+
ELSEIF (HAVE_STRUCT_STAT_ST_MTIMESPEC)
554+
ADD_DEFINITIONS(-DGIT_USE_STAT_MTIMESPEC)
555+
ELSEIF (HAVE_STRUCT_STAT_ST_MTIME_NSEC)
556+
ADD_DEFINITIONS(-DGIT_USE_STAT_MTIME_NSEC)
557+
ENDIF()
558+
507559
ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64)
508560

509561
# Collect sourcefiles
@@ -533,7 +585,7 @@ ELSE()
533585
ENDIF()
534586

535587
# Compile and link libgit2
536-
ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SHA1} ${WIN_RC})
588+
ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1} ${WIN_RC})
537589
TARGET_LINK_LIBRARIES(git2 ${SECURITY_DIRS})
538590
TARGET_LINK_LIBRARIES(git2 ${COREFOUNDATION_DIRS})
539591
TARGET_LINK_LIBRARIES(git2 ${SSL_LIBRARIES})
@@ -548,14 +600,16 @@ IF(MSVC AND GIT_ARCH_64 AND NOT BUILD_SHARED_LIBS)
548600
SET_TARGET_PROPERTIES(git2 PROPERTIES STATIC_LIBRARY_FLAGS "/MACHINE:x64")
549601
ENDIF()
550602

551-
MSVC_SPLIT_SOURCES(git2)
603+
IDE_SPLIT_SOURCES(git2)
552604

553605
IF (SONAME)
554606
SET_TARGET_PROPERTIES(git2 PROPERTIES VERSION ${LIBGIT2_VERSION_STRING})
555607
SET_TARGET_PROPERTIES(git2 PROPERTIES SOVERSION ${LIBGIT2_SOVERSION})
556608
IF (LIBGIT2_FILENAME)
557609
ADD_DEFINITIONS(-DLIBGIT2_FILENAME=\"${LIBGIT2_FILENAME}\")
558610
SET_TARGET_PROPERTIES(git2 PROPERTIES OUTPUT_NAME ${LIBGIT2_FILENAME})
611+
ELSEIF (DEFINED LIBGIT2_PREFIX)
612+
SET_TARGET_PROPERTIES(git2 PROPERTIES PREFIX "${LIBGIT2_PREFIX}")
559613
ENDIF()
560614
ENDIF()
561615
STRING(REPLACE ";" " " LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS}")
@@ -608,7 +662,7 @@ IF (BUILD_CLAR)
608662
${CLAR_PATH}/clar.c
609663
PROPERTIES OBJECT_DEPENDS ${CLAR_PATH}/clar.suite)
610664
611-
ADD_EXECUTABLE(libgit2_clar ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_CLAR} ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SHA1})
665+
ADD_EXECUTABLE(libgit2_clar ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_CLAR} ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1})
612666
613667
TARGET_LINK_LIBRARIES(libgit2_clar ${COREFOUNDATION_DIRS})
614668
TARGET_LINK_LIBRARIES(libgit2_clar ${SECURITY_DIRS})
@@ -617,7 +671,7 @@ IF (BUILD_CLAR)
617671
TARGET_LINK_LIBRARIES(libgit2_clar ${GSSAPI_LIBRARIES})
618672
TARGET_LINK_LIBRARIES(libgit2_clar ${ICONV_LIBRARIES})
619673
TARGET_OS_LIBRARIES(libgit2_clar)
620-
MSVC_SPLIT_SOURCES(libgit2_clar)
674+
IDE_SPLIT_SOURCES(libgit2_clar)
621675
622676
IF (MSVC_IDE)
623677
# Precompiled headers
@@ -630,6 +684,10 @@ IF (BUILD_CLAR)
630684
ELSE ()
631685
ADD_TEST(libgit2_clar libgit2_clar -v)
632686
ENDIF ()
687+
688+
# Add a test target which runs the cred callback tests, to be
689+
# called after setting the url and user
690+
ADD_TEST(libgit2_clar-cred_callback libgit2_clar -v -sonline::clone::cred_callback)
633691
ENDIF ()
634692
635693
IF (TAGS)

0 commit comments

Comments
 (0)