diff options
| -rw-r--r-- | CMakeLists.txt | 3 | ||||
| -rw-r--r-- | cmake/SelectXdiff.cmake | 9 | ||||
| -rw-r--r-- | deps/xdiff/CMakeLists.txt | 28 | ||||
| -rw-r--r-- | deps/xdiff/git-xdiff.h (renamed from src/libgit2/xdiff/git-xdiff.h) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xdiff.h (renamed from src/libgit2/xdiff/xdiff.h) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xdiffi.c (renamed from src/libgit2/xdiff/xdiffi.c) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xdiffi.h (renamed from src/libgit2/xdiff/xdiffi.h) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xemit.c (renamed from src/libgit2/xdiff/xemit.c) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xemit.h (renamed from src/libgit2/xdiff/xemit.h) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xhistogram.c (renamed from src/libgit2/xdiff/xhistogram.c) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xinclude.h (renamed from src/libgit2/xdiff/xinclude.h) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xmacros.h (renamed from src/libgit2/xdiff/xmacros.h) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xmerge.c (renamed from src/libgit2/xdiff/xmerge.c) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xpatience.c (renamed from src/libgit2/xdiff/xpatience.c) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xprepare.c (renamed from src/libgit2/xdiff/xprepare.c) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xprepare.h (renamed from src/libgit2/xdiff/xprepare.h) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xtypes.h (renamed from src/libgit2/xdiff/xtypes.h) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xutils.c (renamed from src/libgit2/xdiff/xutils.c) | 0 | ||||
| -rw-r--r-- | deps/xdiff/xutils.h (renamed from src/libgit2/xdiff/xutils.h) | 0 | ||||
| -rw-r--r-- | include/git2/version.h | 10 | ||||
| -rw-r--r-- | package.json | 2 | ||||
| -rw-r--r-- | src/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/libgit2/CMakeLists.txt | 20 | ||||
| -rw-r--r-- | src/libgit2/blame_git.c | 1 | ||||
| -rw-r--r-- | src/libgit2/config.c | 7 | ||||
| -rw-r--r-- | src/libgit2/diff_xdiff.h | 2 | ||||
| -rw-r--r-- | src/libgit2/merge_file.c | 2 | ||||
| -rw-r--r-- | tests/libgit2/config/find.c | 11 |
28 files changed, 64 insertions, 32 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index fa5167538..30527b928 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.5.1) -project(libgit2 VERSION "1.6.3" LANGUAGES C) +project(libgit2 VERSION "1.7.0" LANGUAGES C) # Add find modules to the path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake") @@ -36,6 +36,7 @@ option(USE_SHA1 "Enable SHA1. Can be set to CollisionDetection(ON option(USE_SHA256 "Enable SHA256. Can be set to HTTPS/Builtin" ON) option(USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF) set(USE_HTTP_PARSER "" CACHE STRING "Specifies the HTTP Parser implementation; either system or builtin.") +# set(USE_XDIFF "" CACHE STRING "Specifies the xdiff implementation; either system or builtin.") set(REGEX_BACKEND "" CACHE STRING "Regular expression implementation. One of regcomp_l, pcre2, pcre, regcomp, or builtin.") option(USE_BUNDLED_ZLIB "Use the bundled version of zlib. Can be set to one of Bundled(ON)/Chromium. The Chromium option requires a x86_64 processor with SSE4.2 and CLMUL" OFF) diff --git a/cmake/SelectXdiff.cmake b/cmake/SelectXdiff.cmake new file mode 100644 index 000000000..9ab9f3f4f --- /dev/null +++ b/cmake/SelectXdiff.cmake @@ -0,0 +1,9 @@ +# Optional external dependency: xdiff +if(USE_XDIFF STREQUAL "system") + message(FATAL_ERROR "external/system xdiff is not yet supported") +else() + add_subdirectory("${PROJECT_SOURCE_DIR}/deps/xdiff" "${PROJECT_BINARY_DIR}/deps/xdiff") + list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/xdiff") + list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$<TARGET_OBJECTS:xdiff>") + add_feature_info(xdiff ON "xdiff support (bundled)") +endif() diff --git a/deps/xdiff/CMakeLists.txt b/deps/xdiff/CMakeLists.txt new file mode 100644 index 000000000..743ac636f --- /dev/null +++ b/deps/xdiff/CMakeLists.txt @@ -0,0 +1,28 @@ + +file(GLOB SRC_XDIFF "*.c" "*.h") +list(SORT SRC_XDIFF) + +add_library(xdiff OBJECT ${SRC_XDIFF}) +target_include_directories(xdiff SYSTEM PRIVATE + "${PROJECT_SOURCE_DIR}/include" + "${PROJECT_SOURCE_DIR}/src/util" + "${PROJECT_BINARY_DIR}/src/util" + ${LIBGIT2_SYSTEM_INCLUDES} + ${LIBGIT2_DEPENDENCY_INCLUDES}) + +# the xdiff dependency is not (yet) warning-free, disable warnings +# as errors for the xdiff sources until we've sorted them out +if(MSVC) + set_source_files_properties(xdiffi.c PROPERTIES COMPILE_FLAGS -WX-) + set_source_files_properties(xemit.c PROPERTIES COMPILE_FLAGS -WX-) + set_source_files_properties(xhistogram.c PROPERTIES COMPILE_FLAGS -WX-) + set_source_files_properties(xmerge.c PROPERTIES COMPILE_FLAGS -WX-) + set_source_files_properties(xutils.c PROPERTIES COMPILE_FLAGS -WX-) + set_source_files_properties(xpatience.c PROPERTIES COMPILE_FLAGS -WX-) +else() + set_source_files_properties(xdiffi.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -Wno-unused-parameter") + set_source_files_properties(xemit.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -Wno-unused-parameter") + set_source_files_properties(xhistogram.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare") + set_source_files_properties(xutils.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare") + set_source_files_properties(xpatience.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare") +endif() diff --git a/src/libgit2/xdiff/git-xdiff.h b/deps/xdiff/git-xdiff.h index b75dba819..b75dba819 100644 --- a/src/libgit2/xdiff/git-xdiff.h +++ b/deps/xdiff/git-xdiff.h diff --git a/src/libgit2/xdiff/xdiff.h b/deps/xdiff/xdiff.h index fb47f63fb..fb47f63fb 100644 --- a/src/libgit2/xdiff/xdiff.h +++ b/deps/xdiff/xdiff.h diff --git a/src/libgit2/xdiff/xdiffi.c b/deps/xdiff/xdiffi.c index af31b7f4b..af31b7f4b 100644 --- a/src/libgit2/xdiff/xdiffi.c +++ b/deps/xdiff/xdiffi.c diff --git a/src/libgit2/xdiff/xdiffi.h b/deps/xdiff/xdiffi.h index 8f1c7c8b0..8f1c7c8b0 100644 --- a/src/libgit2/xdiff/xdiffi.h +++ b/deps/xdiff/xdiffi.h diff --git a/src/libgit2/xdiff/xemit.c b/deps/xdiff/xemit.c index 1cbf2b982..1cbf2b982 100644 --- a/src/libgit2/xdiff/xemit.c +++ b/deps/xdiff/xemit.c diff --git a/src/libgit2/xdiff/xemit.h b/deps/xdiff/xemit.h index 1b9887e67..1b9887e67 100644 --- a/src/libgit2/xdiff/xemit.h +++ b/deps/xdiff/xemit.h diff --git a/src/libgit2/xdiff/xhistogram.c b/deps/xdiff/xhistogram.c index 80794748b..80794748b 100644 --- a/src/libgit2/xdiff/xhistogram.c +++ b/deps/xdiff/xhistogram.c diff --git a/src/libgit2/xdiff/xinclude.h b/deps/xdiff/xinclude.h index 75db1d8f3..75db1d8f3 100644 --- a/src/libgit2/xdiff/xinclude.h +++ b/deps/xdiff/xinclude.h diff --git a/src/libgit2/xdiff/xmacros.h b/deps/xdiff/xmacros.h index 2809a28ca..2809a28ca 100644 --- a/src/libgit2/xdiff/xmacros.h +++ b/deps/xdiff/xmacros.h diff --git a/src/libgit2/xdiff/xmerge.c b/deps/xdiff/xmerge.c index 433e2d741..433e2d741 100644 --- a/src/libgit2/xdiff/xmerge.c +++ b/deps/xdiff/xmerge.c diff --git a/src/libgit2/xdiff/xpatience.c b/deps/xdiff/xpatience.c index c5d48e80a..c5d48e80a 100644 --- a/src/libgit2/xdiff/xpatience.c +++ b/deps/xdiff/xpatience.c diff --git a/src/libgit2/xdiff/xprepare.c b/deps/xdiff/xprepare.c index 4527a4a07..4527a4a07 100644 --- a/src/libgit2/xdiff/xprepare.c +++ b/deps/xdiff/xprepare.c diff --git a/src/libgit2/xdiff/xprepare.h b/deps/xdiff/xprepare.h index 947d9fc1b..947d9fc1b 100644 --- a/src/libgit2/xdiff/xprepare.h +++ b/deps/xdiff/xprepare.h diff --git a/src/libgit2/xdiff/xtypes.h b/deps/xdiff/xtypes.h index 8442bd436..8442bd436 100644 --- a/src/libgit2/xdiff/xtypes.h +++ b/deps/xdiff/xtypes.h diff --git a/src/libgit2/xdiff/xutils.c b/deps/xdiff/xutils.c index cfa6e2220..cfa6e2220 100644 --- a/src/libgit2/xdiff/xutils.c +++ b/deps/xdiff/xutils.c diff --git a/src/libgit2/xdiff/xutils.h b/deps/xdiff/xutils.h index fba7bae03..fba7bae03 100644 --- a/src/libgit2/xdiff/xutils.h +++ b/deps/xdiff/xutils.h diff --git a/include/git2/version.h b/include/git2/version.h index 78750740a..bed47f51e 100644 --- a/include/git2/version.h +++ b/include/git2/version.h @@ -11,16 +11,16 @@ * The version string for libgit2. This string follows semantic * versioning (v2) guidelines. */ -#define LIBGIT2_VERSION "1.6.3" +#define LIBGIT2_VERSION "1.7.0-alpha" /** The major version number for this version of libgit2. */ #define LIBGIT2_VER_MAJOR 1 /** The minor version number for this version of libgit2. */ -#define LIBGIT2_VER_MINOR 6 +#define LIBGIT2_VER_MINOR 7 /** The revision ("teeny") version number for this version of libgit2. */ -#define LIBGIT2_VER_REVISION 3 +#define LIBGIT2_VER_REVISION 0 /** The Windows DLL patch number for this version of libgit2. */ #define LIBGIT2_VER_PATCH 0 @@ -31,9 +31,9 @@ * a prerelease name like "beta" or "rc1". For final releases, this will * be `NULL`. */ -#define LIBGIT2_VER_PRERELEASE NULL +#define LIBGIT2_VER_PRERELEASE "alpha" /** The library ABI soversion for this version of libgit2. */ -#define LIBGIT2_SOVERSION "1.6" +#define LIBGIT2_SOVERSION "1.7" #endif diff --git a/package.json b/package.json index 5665b4edd..398446ea5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "libgit2", - "version": "1.6.3", + "version": "1.7.0-alpha", "repo": "https://github.com/libgit2/libgit2", "description": " A cross-platform, linkable library implementation of Git that you can use in your application.", "install": "mkdir build && cd build && cmake .. && cmake --build ." diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8fd22bc11..cc0a0d4dc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -41,6 +41,7 @@ include(SelectHTTPSBackend) include(SelectHashes) include(SelectHTTPParser) include(SelectRegex) +include(SelectXdiff) include(SelectSSH) include(SelectZlib) diff --git a/src/libgit2/CMakeLists.txt b/src/libgit2/CMakeLists.txt index dcb4279c1..876a703e8 100644 --- a/src/libgit2/CMakeLists.txt +++ b/src/libgit2/CMakeLists.txt @@ -24,8 +24,7 @@ target_sources(libgit2 PRIVATE ${SRC_H}) file(GLOB SRC_GIT2 *.c *.h streams/*.c streams/*.h - transports/*.c transports/*.h - xdiff/*.c xdiff/*.h) + transports/*.c transports/*.h) list(SORT SRC_GIT2) target_sources(libgit2 PRIVATE ${SRC_GIT2}) @@ -39,23 +38,6 @@ if(APPLE) set_source_files_properties(streams/stransport.c PROPERTIES COMPILE_FLAGS -Wno-deprecated) endif() -# the xdiff dependency is not (yet) warning-free, disable warnings -# as errors for the xdiff sources until we've sorted them out -if(MSVC) - set_source_files_properties(xdiff/xdiffi.c PROPERTIES COMPILE_FLAGS -WX-) - set_source_files_properties(xdiff/xemit.c PROPERTIES COMPILE_FLAGS -WX-) - set_source_files_properties(xdiff/xhistogram.c PROPERTIES COMPILE_FLAGS -WX-) - set_source_files_properties(xdiff/xmerge.c PROPERTIES COMPILE_FLAGS -WX-) - set_source_files_properties(xdiff/xutils.c PROPERTIES COMPILE_FLAGS -WX-) - set_source_files_properties(xdiff/xpatience.c PROPERTIES COMPILE_FLAGS -WX-) -else() - set_source_files_properties(xdiff/xdiffi.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -Wno-unused-parameter") - set_source_files_properties(xdiff/xemit.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -Wno-unused-parameter") - set_source_files_properties(xdiff/xhistogram.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare") - set_source_files_properties(xdiff/xutils.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare") - set_source_files_properties(xdiff/xpatience.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare") -endif() - ide_split_sources(libgit2) list(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:util> $<TARGET_OBJECTS:libgit2> ${LIBGIT2_DEPENDENCY_OBJECTS}) list(APPEND LIBGIT2_INCLUDES ${LIBGIT2_DEPENDENCY_INCLUDES}) diff --git a/src/libgit2/blame_git.c b/src/libgit2/blame_git.c index 2504b338a..69897b386 100644 --- a/src/libgit2/blame_git.c +++ b/src/libgit2/blame_git.c @@ -9,7 +9,6 @@ #include "commit.h" #include "blob.h" -#include "xdiff/xinclude.h" #include "diff_xdiff.h" /* diff --git a/src/libgit2/config.c b/src/libgit2/config.c index 6d15a8db6..23a8f9ffa 100644 --- a/src/libgit2/config.c +++ b/src/libgit2/config.c @@ -1174,9 +1174,12 @@ int git_config__find_programdata(git_str *path) GIT_FS_PATH_OWNER_CURRENT_USER | GIT_FS_PATH_OWNER_ADMINISTRATOR; bool is_safe; + int error; + + if ((error = git_sysdir_find_programdata_file(path, GIT_CONFIG_FILENAME_PROGRAMDATA)) < 0) + return error; - if (git_sysdir_find_programdata_file(path, GIT_CONFIG_FILENAME_PROGRAMDATA) < 0 || - git_fs_path_owner_is(&is_safe, path->ptr, owner_level) < 0) + if (git_fs_path_owner_is(&is_safe, path->ptr, owner_level) < 0) return -1; if (!is_safe) { diff --git a/src/libgit2/diff_xdiff.h b/src/libgit2/diff_xdiff.h index 9b303e9dc..327dc7c4a 100644 --- a/src/libgit2/diff_xdiff.h +++ b/src/libgit2/diff_xdiff.h @@ -10,7 +10,7 @@ #include "common.h" #include "diff.h" -#include "xdiff/xdiff.h" +#include "xdiff.h" #include "patch_generate.h" /* xdiff cannot cope with large files. these files should not be passed to diff --git a/src/libgit2/merge_file.c b/src/libgit2/merge_file.c index 732a047b1..ffe83cf2a 100644 --- a/src/libgit2/merge_file.c +++ b/src/libgit2/merge_file.c @@ -19,8 +19,6 @@ #include "git2/index.h" #include "git2/merge.h" -#include "xdiff/xdiff.h" - /* only examine the first 8000 bytes for binaryness. * https://github.com/git/git/blob/77bd3ea9f54f1584147b594abc04c26ca516d987/xdiff-interface.c#L197 */ diff --git a/tests/libgit2/config/find.c b/tests/libgit2/config/find.c new file mode 100644 index 000000000..7ca8ec767 --- /dev/null +++ b/tests/libgit2/config/find.c @@ -0,0 +1,11 @@ +#include "clar_libgit2.h" + +void test_config_find__one(void) +{ + git_buf buf = GIT_BUF_INIT; + + cl_git_fail_with(GIT_ENOTFOUND, git_config_find_global(&buf)); + cl_git_fail_with(GIT_ENOTFOUND, git_config_find_xdg(&buf)); + cl_git_fail_with(GIT_ENOTFOUND, git_config_find_system(&buf)); + cl_git_fail_with(GIT_ENOTFOUND, git_config_find_programdata(&buf)); +} |
