Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f23dc5b

Browse files
authored
Merge pull request #4846 from pks-t/pks/v0.27.6
Bugix release v0.27.7
2 parents 68e55c3 + a0c286b commit f23dc5b

29 files changed

+457
-66
lines changed

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1+
v0.27.7
2+
-------
3+
4+
This is a bugfix release with the following changes or improvements:
5+
6+
- Our continuous integration environment has switched from Travis and
7+
AppVeyor to Azure Pipelines CI.
8+
9+
- Fix adding worktrees for bare repositories.
10+
11+
- Fix parsed patches not computing the old respectively new line
12+
numbers correctly.
13+
14+
- Fix parsing configuration variables which do not have a section.
15+
16+
- Fix a zero-byte allocation when trying to detect file renames and
17+
copies of a diff without any hunks.
18+
19+
- Fix a zero-byte allocation when trying to resize or duplicate
20+
vectors.
21+
22+
- Fix return value when trying to unlock worktrees which aren't
23+
locked.
24+
25+
- Fix returning an unitialized error code when preparing a revision
26+
walk without any pushed commits.
27+
28+
- Fix return value of `git_remote_lookup` when lookup of
29+
"remote.$remote.tagopt" fails.
30+
31+
- Fix the revision walk always labelling commits as interesting due
32+
to a mishandling of the commit date.
33+
34+
- Fix the packbuilder inserting uninteresting blobs when adding a
35+
tree containing references to such blobs.
36+
37+
- Ignore unsupported authentication schemes in HTTP transport.
38+
39+
- Improve performane of `git_remote_prune`.
40+
41+
- Fix detection of whether `qsort_r` has a BSD or GNU function
42+
signature.
43+
44+
- Fix detection of iconv if it is provided by libc.
45+
146
v0.27.6
247
-------
348

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ INCLUDE(CheckLibraryExists)
2828
INCLUDE(CheckFunctionExists)
2929
INCLUDE(CheckSymbolExists)
3030
INCLUDE(CheckStructHasMember)
31+
INCLUDE(CheckPrototypeDefinition) # Added in CMake 3.0
3132
INCLUDE(AddCFlagIfSupported)
3233
INCLUDE(FindPkgLibraries)
3334
INCLUDE(FindThreads)
@@ -224,6 +225,9 @@ ELSE ()
224225
ENABLE_WARNINGS(shift-count-overflow)
225226
DISABLE_WARNINGS(unused-const-variable)
226227
DISABLE_WARNINGS(unused-function)
228+
ENABLE_WARNINGS(format)
229+
ENABLE_WARNINGS(format-security)
230+
ENABLE_WARNINGS(int-conversion)
227231

228232
IF (APPLE) # Apple deprecated OpenSSL
229233
DISABLE_WARNINGS(deprecated-declarations)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@CHECK_PROTOTYPE_DEFINITION_HEADER@
2+
3+
static void cmakeRequireSymbol(int dummy, ...) {
4+
(void) dummy;
5+
}
6+
7+
static void checkSymbol(void) {
8+
#ifndef @CHECK_PROTOTYPE_DEFINITION_SYMBOL@
9+
cmakeRequireSymbol(0, &@CHECK_PROTOTYPE_DEFINITION_SYMBOL@);
10+
#endif
11+
}
12+
13+
@CHECK_PROTOTYPE_DEFINITION_PROTO@ {
14+
return @CHECK_PROTOTYPE_DEFINITION_RETURN@;
15+
}
16+
17+
#ifdef __CLASSIC_C__
18+
int main() {
19+
int ac;
20+
char*av[];
21+
#else
22+
int main(int ac, char *av[]) {
23+
#endif
24+
checkSymbol();
25+
if (ac > 1000) {
26+
return *av[0];
27+
}
28+
return 0;
29+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# - Check if the protoype we expect is correct.
2+
# check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER VARIABLE)
3+
# FUNCTION - The name of the function (used to check if prototype exists)
4+
# PROTOTYPE- The prototype to check.
5+
# RETURN - The return value of the function.
6+
# HEADER - The header files required.
7+
# VARIABLE - The variable to store the result.
8+
# Example:
9+
# check_prototype_definition(getpwent_r
10+
# "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)"
11+
# "NULL"
12+
# "unistd.h;pwd.h"
13+
# SOLARIS_GETPWENT_R)
14+
# The following variables may be set before calling this macro to
15+
# modify the way the check is run:
16+
#
17+
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
18+
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
19+
# CMAKE_REQUIRED_INCLUDES = list of include directories
20+
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
21+
22+
#=============================================================================
23+
# Copyright 2005-2009 Kitware, Inc.
24+
# Copyright 2010-2011 Andreas Schneider <[email protected]>
25+
#
26+
# Distributed under the OSI-approved BSD License (the "License");
27+
# see accompanying file Copyright.txt for details.
28+
#
29+
# This software is distributed WITHOUT ANY WARRANTY; without even the
30+
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
31+
# See the License for more information.
32+
#=============================================================================
33+
# (To distribute this file outside of CMake, substitute the full
34+
# License text for the above reference.)
35+
#
36+
37+
get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
38+
39+
function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE)
40+
41+
if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
42+
set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n")
43+
44+
set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS})
45+
if (CMAKE_REQUIRED_LIBRARIES)
46+
set(CHECK_PROTOTYPE_DEFINITION_LIBS
47+
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
48+
else(CMAKE_REQUIRED_LIBRARIES)
49+
set(CHECK_PROTOTYPE_DEFINITION_LIBS)
50+
endif(CMAKE_REQUIRED_LIBRARIES)
51+
if (CMAKE_REQUIRED_INCLUDES)
52+
set(CMAKE_SYMBOL_EXISTS_INCLUDES
53+
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
54+
else(CMAKE_REQUIRED_INCLUDES)
55+
set(CMAKE_SYMBOL_EXISTS_INCLUDES)
56+
endif(CMAKE_REQUIRED_INCLUDES)
57+
58+
foreach(_FILE ${_HEADER})
59+
set(CHECK_PROTOTYPE_DEFINITION_HEADER
60+
"${CHECK_PROTOTYPE_DEFINITION_HEADER}#include <${_FILE}>\n")
61+
endforeach(_FILE)
62+
63+
set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION})
64+
set(CHECK_PROTOTYPE_DEFINITION_PROTO ${_PROTOTYPE})
65+
set(CHECK_PROTOTYPE_DEFINITION_RETURN ${_RETURN})
66+
67+
configure_file("${__check_proto_def_dir}/CheckPrototypeDefinition.c.in"
68+
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c" @ONLY)
69+
70+
file(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c _SOURCE)
71+
72+
try_compile(${_VARIABLE}
73+
${CMAKE_BINARY_DIR}
74+
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c
75+
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
76+
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CHECK_PROTOTYPE_DEFINITION_FLAGS}
77+
"${CHECK_PROTOTYPE_DEFINITION_LIBS}"
78+
"${CMAKE_SYMBOL_EXISTS_INCLUDES}"
79+
OUTPUT_VARIABLE OUTPUT)
80+
81+
if (${_VARIABLE})
82+
set(${_VARIABLE} 1 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
83+
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - True")
84+
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
85+
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n"
86+
"${OUTPUT}\n\n")
87+
else (${_VARIABLE})
88+
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False")
89+
set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
90+
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
91+
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n"
92+
"${OUTPUT}\n\n${_SOURCE}\n\n")
93+
endif (${_VARIABLE})
94+
endif("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
95+
96+
endfunction(CHECK_PROTOTYPE_DEFINITION)

cmake/Modules/FindIconv.cmake

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@ IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
1212
ENDIF()
1313

1414
FIND_PATH(ICONV_INCLUDE_DIR iconv.h)
15+
CHECK_FUNCTION_EXISTS(iconv_open libc_has_iconv)
1516
FIND_LIBRARY(iconv_lib NAMES iconv libiconv libiconv-2 c)
1617

17-
IF(ICONV_INCLUDE_DIR AND iconv_lib)
18-
SET(ICONV_FOUND TRUE)
19-
ENDIF()
20-
21-
IF(ICONV_FOUND)
22-
# split iconv into -L and -l linker options, so we can set them for pkg-config
18+
IF(ICONV_INCLUDE_DIR AND libc_has_iconv)
19+
SET(ICONV_FOUND TRUE)
20+
SET(ICONV_LIBRARIES "")
21+
IF(NOT ICONV_FIND_QUIETLY)
22+
MESSAGE(STATUS "Found Iconv: provided by libc")
23+
ENDIF(NOT ICONV_FIND_QUIETLY)
24+
ELSEIF(ICONV_INCLUDE_DIR AND iconv_lib)
25+
SET(ICONV_FOUND TRUE)
26+
# split iconv into -L and -l linker options, so we can
27+
# set them for pkg-config
2328
GET_FILENAME_COMPONENT(iconv_path ${iconv_lib} PATH)
2429
GET_FILENAME_COMPONENT(iconv_name ${iconv_lib} NAME_WE)
2530
STRING(REGEX REPLACE "^lib" "" iconv_name ${iconv_name})

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.27.6"
10+
#define LIBGIT2_VERSION "0.27.7"
1111
#define LIBGIT2_VER_MAJOR 0
1212
#define LIBGIT2_VER_MINOR 27
13-
#define LIBGIT2_VER_REVISION 6
13+
#define LIBGIT2_VER_REVISION 7
1414
#define LIBGIT2_VER_PATCH 0
1515

1616
#define LIBGIT2_SOVERSION 27

src/CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,19 @@ IF (HAVE_FUTIMENS)
5757
SET(GIT_USE_FUTIMENS 1)
5858
ENDIF ()
5959

60-
CHECK_FUNCTION_EXISTS(qsort_r HAVE_QSORT_R)
61-
IF (HAVE_QSORT_R)
62-
ADD_DEFINITIONS(-DHAVE_QSORT_R)
63-
ENDIF ()
60+
CHECK_PROTOTYPE_DEFINITION(qsort_r
61+
"void qsort_r(void *base, size_t nmemb, size_t size, void *thunk, int (*compar)(void *, const void *, const void *))"
62+
"" "stdlib.h" HAVE_QSORT_R_BSD)
63+
IF (HAVE_QSORT_R_BSD)
64+
ADD_DEFINITIONS(-DHAVE_QSORT_R_BSD)
65+
ENDIF()
66+
67+
CHECK_PROTOTYPE_DEFINITION(qsort_r
68+
"void qsort_r(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *arg)"
69+
"" "stdlib.h" HAVE_QSORT_R_GNU)
70+
IF (HAVE_QSORT_R_GNU)
71+
ADD_DEFINITIONS(-DHAVE_QSORT_R_GNU)
72+
ENDIF()
6473

6574
CHECK_FUNCTION_EXISTS(qsort_s HAVE_QSORT_S)
6675
IF (HAVE_QSORT_S)

src/config_file.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,8 +1075,16 @@ static int read_on_variable(
10751075
GIT_UNUSED(line);
10761076
GIT_UNUSED(line_len);
10771077

1078+
if (current_section) {
1079+
/* TODO: Once warnings lang, we should likely warn
1080+
* here. Git appears to warn in most cases if it sees
1081+
* un-namespaced config options.
1082+
*/
1083+
git_buf_puts(&buf, current_section);
1084+
git_buf_putc(&buf, '.');
1085+
}
10781086
git__strtolower(var_name);
1079-
git_buf_printf(&buf, "%s.%s", current_section, var_name);
1087+
git_buf_puts(&buf, var_name);
10801088
git__free(var_name);
10811089

10821090
if (git_buf_oom(&buf)) {

src/diff_tform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ int git_diff_find_similar(
822822
num_deltas = diff->deltas.length;
823823

824824
/* TODO: maybe abort if deltas.length > rename_limit ??? */
825-
if (!git__is_uint32(num_deltas))
825+
if (!num_deltas || !git__is_uint32(num_deltas))
826826
goto cleanup;
827827

828828
/* No flags set; nothing to do */

src/index.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,8 @@ int git_index_conflict_add(git_index *index,
17741774
if (entries[i] && !valid_filemode(entries[i]->mode)) {
17751775
giterr_set(GITERR_INDEX, "invalid filemode for stage %d entry",
17761776
i + 1);
1777-
return -1;
1777+
ret = -1;
1778+
goto on_error;
17781779
}
17791780
}
17801781

@@ -3509,7 +3510,7 @@ int git_index_snapshot_new(git_vector *snap, git_index *index)
35093510
error = git_vector_dup(snap, &index->entries, index->entries._cmp);
35103511

35113512
if (error < 0)
3512-
git_index_free(index);
3513+
git_index_snapshot_release(snap, index);
35133514

35143515
return error;
35153516
}

0 commit comments

Comments
 (0)