Skip to content

Commit bb24e83

Browse files
author
John Haley
committed
Bump libgit2 to 0.23.4
1 parent 9559dc2 commit bb24e83

Some content is hidden

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

59 files changed

+1023
-292
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "vendor/libgit2"]
22
path = vendor/libgit2
3-
url = git://github.com/nodegit/libgit2.git
3+
url = git://github.com/libgit2/libgit2.git

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
},
6363
"vendorDependencies": {
6464
"libgit2": {
65-
"sha": "dbf0c5c86ea2c0c621ba9ef5cbd5bb326d266989",
66-
"version": "0.23.3"
65+
"sha": "e8feafe32007ebd16a61820c70abd221655d053c",
66+
"version": "0.23.4"
6767
},
6868
"libssh2": "1.6.0",
6969
"http_parser": "2.5.0"

vendor/libgit2/CMakeLists.txt

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ CMAKE_POLICY(SET CMP0015 NEW)
1919
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
2020

2121
INCLUDE(CheckLibraryExists)
22+
INCLUDE(CheckFunctionExists)
2223
INCLUDE(AddCFlagIfSupported)
2324
INCLUDE(FindPkgConfig)
2425

@@ -95,6 +96,23 @@ SET(BIN_INSTALL_DIR bin CACHE PATH "Where to install binaries to.")
9596
SET(LIB_INSTALL_DIR lib CACHE PATH "Where to install libraries to.")
9697
SET(INCLUDE_INSTALL_DIR include CACHE PATH "Where to install headers to.")
9798

99+
# Set a couple variables to be substituted inside the .pc file.
100+
# We can't just use LIB_INSTALL_DIR in the .pc file, as passing them as absolue
101+
# or relative paths is both valid and supported by cmake.
102+
SET (PKGCONFIG_PREFIX ${CMAKE_INSTALL_PREFIX})
103+
104+
IF(IS_ABSOLUTE ${LIB_INSTALL_DIR})
105+
SET (PKGCONFIG_LIBDIR ${LIB_INSTALL_DIR})
106+
ELSE(IS_ABSOLUTE ${LIB_INSTALL_DIR})
107+
SET (PKGCONFIG_LIBDIR "\${prefix}/${LIB_INSTALL_DIR}")
108+
ENDIF (IS_ABSOLUTE ${LIB_INSTALL_DIR})
109+
110+
IF(IS_ABSOLUTE ${INCLUDE_INSTALL_DIR})
111+
SET (PKGCONFIG_INCLUDEDIR ${INCLUDE_INSTALL_DIR})
112+
ELSE(IS_ABSOLUTE ${INCLUDE_INSTALL_DIR})
113+
SET (PKGCONFIG_INCLUDEDIR "\${prefix}/${INCLUDE_INSTALL_DIR}")
114+
ENDIF(IS_ABSOLUTE ${INCLUDE_INSTALL_DIR})
115+
98116
FUNCTION(TARGET_OS_LIBRARIES target)
99117
IF(WIN32)
100118
TARGET_LINK_LIBRARIES(${target} ws2_32)
@@ -440,6 +458,21 @@ ELSE ()
440458
ENDIF ()
441459
ENDIF()
442460

461+
CHECK_FUNCTION_EXISTS(futimens HAVE_FUTIMENS)
462+
IF (HAVE_FUTIMENS)
463+
ADD_DEFINITIONS(-DHAVE_FUTIMENS)
464+
ENDIF ()
465+
466+
CHECK_FUNCTION_EXISTS(qsort_r HAVE_QSORT_R)
467+
IF (HAVE_QSORT_R)
468+
ADD_DEFINITIONS(-DHAVE_QSORT_R)
469+
ENDIF ()
470+
471+
CHECK_FUNCTION_EXISTS(qsort_s HAVE_QSORT_S)
472+
IF (HAVE_QSORT_S)
473+
ADD_DEFINITIONS(-DHAVE_QSORT_S)
474+
ENDIF ()
475+
443476
IF( NOT CMAKE_CONFIGURATION_TYPES )
444477
# Build Debug by default
445478
IF (NOT CMAKE_BUILD_TYPE)
@@ -546,7 +579,12 @@ INSTALL(FILES include/git2.h DESTINATION ${INCLUDE_INSTALL_DIR} )
546579
547580
# Tests
548581
IF (BUILD_CLAR)
549-
FIND_PACKAGE(PythonInterp REQUIRED)
582+
FIND_PACKAGE(PythonInterp)
583+
584+
IF(NOT PYTHONINTERP_FOUND)
585+
MESSAGE(FATAL_ERROR "Could not find a python interpeter, which is needed to build the tests. "
586+
"Make sure python is available, or pass -DBUILD_CLAR=OFF to skip building the tests")
587+
ENDIF()
550588
551589
SET(CLAR_FIXTURES "${CMAKE_CURRENT_SOURCE_DIR}/tests/resources/")
552590
SET(CLAR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/tests")

vendor/libgit2/include/git2/common.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
#include <time.h>
1111
#include <stdlib.h>
1212

13-
#ifdef _MSC_VER
14-
# include "inttypes.h"
15-
#else
16-
# include <inttypes.h>
17-
#endif
18-
1913
#ifdef __cplusplus
2014
# define GIT_BEGIN_DECL extern "C" {
2115
# define GIT_END_DECL }
@@ -26,6 +20,14 @@
2620
# define GIT_END_DECL /* empty */
2721
#endif
2822

23+
#if defined(_MSC_VER) && _MSC_VER < 1800
24+
GIT_BEGIN_DECL
25+
# include "inttypes.h"
26+
GIT_END_DECL
27+
#else
28+
# include <inttypes.h>
29+
#endif
30+
2931
/** Declare a public function exported for application use. */
3032
#if __GNUC__ >= 4
3133
# define GIT_EXTERN(type) extern \

vendor/libgit2/include/git2/sys/transport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "git2/net.h"
1212
#include "git2/types.h"
13+
#include "git2/strarray.h"
1314

1415
/**
1516
* @file git2/sys/transport.h

vendor/libgit2/include/git2/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#ifndef INCLUDE_git_version_h__
88
#define INCLUDE_git_version_h__
99

10-
#define LIBGIT2_VERSION "0.23.3"
10+
#define LIBGIT2_VERSION "0.23.4"
1111
#define LIBGIT2_VER_MAJOR 0
1212
#define LIBGIT2_VER_MINOR 23
13-
#define LIBGIT2_VER_REVISION 3
13+
#define LIBGIT2_VER_REVISION 4
1414
#define LIBGIT2_VER_PATCH 0
1515

1616
#define LIBGIT2_SOVERSION 23

vendor/libgit2/libgit2.pc.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
libdir=@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@
2-
includedir=@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_DIR@
1+
prefix=@PKGCONFIG_PREFIX@
2+
libdir=@PKGCONFIG_LIBDIR@
3+
includedir=@PKGCONFIG_INCLUDEDIR@
34

45
Name: libgit2
56
Description: The git library, take 2

vendor/libgit2/src/checkout.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,12 @@ static int checkout_action_common(
244244
if (delta->new_file.mode == GIT_FILEMODE_LINK && wd != NULL)
245245
*action |= CHECKOUT_ACTION__REMOVE;
246246

247+
/* if the file is on disk and doesn't match our mode, force update */
248+
if (wd &&
249+
GIT_PERMS_IS_EXEC(wd->mode) !=
250+
GIT_PERMS_IS_EXEC(delta->new_file.mode))
251+
*action |= CHECKOUT_ACTION__REMOVE;
252+
247253
notify = GIT_CHECKOUT_NOTIFY_UPDATED;
248254
}
249255

@@ -1501,15 +1507,6 @@ static int blob_content_to_file(
15011507
if (error < 0)
15021508
return error;
15031509

1504-
if (GIT_PERMS_IS_EXEC(mode)) {
1505-
data->perfdata.chmod_calls++;
1506-
1507-
if ((error = p_chmod(path, mode)) < 0) {
1508-
giterr_set(GITERR_OS, "Failed to set permissions on '%s'", path);
1509-
return error;
1510-
}
1511-
}
1512-
15131510
if (st) {
15141511
data->perfdata.stat_calls++;
15151512

vendor/libgit2/src/commit_list.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static int commit_quick_parse(
110110
const uint8_t *buffer_end = buffer + buffer_len;
111111
const uint8_t *parents_start, *committer_start;
112112
int i, parents = 0;
113-
int commit_time;
113+
int64_t commit_time;
114114

115115
buffer += strlen("tree ") + GIT_OID_HEXSZ + 1;
116116

@@ -166,10 +166,10 @@ static int commit_quick_parse(
166166
buffer--;
167167
}
168168

169-
if ((buffer == committer_start) || (git__strtol32(&commit_time, (char *)(buffer + 1), NULL, 10) < 0))
169+
if ((buffer == committer_start) || (git__strtol64(&commit_time, (char *)(buffer + 1), NULL, 10) < 0))
170170
return commit_error(commit, "cannot parse commit time");
171171

172-
commit->time = (time_t)commit_time;
172+
commit->time = commit_time;
173173
commit->parsed = 1;
174174
return 0;
175175
}

0 commit comments

Comments
 (0)